Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow Pact generation in Android Automation tests #1807

Open
canny bot opened this issue Jun 26, 2024 · 2 comments
Open

Allow Pact generation in Android Automation tests #1807

canny bot opened this issue Jun 26, 2024 · 2 comments

Comments

@canny
Copy link

canny bot commented Jun 26, 2024

Description of the feature request:
This feature request proposes the ability to generate pacts off the back of Android automation tests that utilise a mock server.
Use case / for what or how I would use it:
OkHttp provides a MockWebServer to which a Dispatcher can be added. This MockWebServer, is as the name describes, a mock instance for receiving responses when running automation tests. The Dispatcher that is provided gives developers access to both the request that is made as well as the response that they are expecting. Given these two pieces of information, we could create pacts.
There are caveats with this suggestion however, and I don’t claim to have the answers. One of the blockers that stand out for me would be the mechanism of pulling the pact files to a project directory - the generated pacts described above would be stored on the device during automation tests.
I propose this feature after observing the overhead required to write pacts that cover each permutation that a request can take for a given endpoint. Considering that this information could already be available to developers when they introduce Pact to their project, this could make Pact adoption much easier.

https://pact.canny.io/admin/board/feature-requests/p/allow-pact-generation-in-android-automation-tests

Copy link
Author

canny bot commented Jun 26, 2024

This issue has been linked to a Canny post: Allow Pact generation in Android Automation tests 🎉

@YOU54F
Copy link
Member

YOU54F commented Jun 26, 2024

Matt Fellows - July 9, 2021

I must have missed this idea, but the biggest problem is adding matchers. Without matchers, a provider side test with Pact might be painful. One option would be to just default to a like matcher, so that it just looks at shape.
This would work nicely, however, with the Pactflow bi-directional feature (https://docs.pactflow.io/docs/workshops/bi-directional)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant