Add network mocking for end to end tests#9422
Merged
Conversation
Generated by 🚫 dangerJS |
0a93936 to
34bdf32
Compare
4e0f591 to
682df39
Compare
682df39 to
6edc2e9
Compare
This resolves a failed SSL handshake attempt when okhttp attempts to contact WireMock.
6edc2e9 to
8dbce8b
Compare
1 task
jkmassel
approved these changes
May 9, 2019
Contributor
jkmassel
left a comment
There was a problem hiding this comment.
✅ The code for this all looks sensible
✅ The tests pass on CLI
✅ The tests pass from within Android Studio
✅ ![]()
1 task
1 task
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds network mocking for all of our end-to-end (Espresso) tests, including screenshot tests.
localhost:8080which mimics the WP API. Request/response configuration is done with the JSON files. I hope to use the same JSON files to mock the iOS tests.public-api.wordpress.com. Thanks @aforcier for implementing this.WordPressMockswhich contains all of the configuration and mock files for WireMock. We can make this a subtree later and share the mocks with iOS.The diff is very big, but it should be not too difficult to review as it is mostly JSON files 😄 You can see it without the JSON files here for easier reviewing. Without the JSON files, this is the diff size 😄
Still to do:
Once the above is completed, this will be ready for review.I plan to move
libs/mocksto a subtreed repo so the mocks defined here can be shared with iOS.To test:
cp gradle.properties-example gradle.properties../gradlew WordPress:connectedVanillaDebugAndroidTest --stacktrace.Update release notes:
RELEASE-NOTES.txt.