-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Network mocking for all UI and screenshot tests #11788
Conversation
979a2df
to
192515e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I confirmed the tests in the WordPressUITests
target all pass. Thanks for finishing the magic link test with the mocking!
However, I did get this warning in the terminal when I started the mock server:
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
And while running the UI tests on an iPad simulator (iPad Pro, 12.9-inch, 3rd Generation), I saw a number of "Request was not matched" errors (although the tests still pass). These didn't show up when running the tests on an iPhone simulator. Here were the requests without a matching stub:
/rest/v1.2/read/sites/53424024?locale=en
/rest/v1.1/sites/158396482/stats//?locale=en&max=10
/v1.1/users/suggest?locale=en&site_id=158396482
Let me know if you need more details or can't reproduce that on your end.
Note: The screenshot tests are broken in develop due to the recent stats changes. I think we should fix that in a separate change.
Agreed, I think that's fine to address separately.
Thanks @rachelmcr!
This is expected and fine. It doesn't affect us.
Oh great, thank you! These should all be quick to fix. |
Okay, I've updated wordpress-mobile/WordPressMocks#3 with the missing requests. @rachelmcr It should all be working now. Once you pull, you will need to run |
Looks great now! |
Thanks, @rachelmcr! Could you also take a quick look at wordpress-mobile/WordPressMocks#3? That's where the mocks live and you have already effectively tested them by reviewing this 😄 Once that is merged, we can merge this PR and get these tests running on CI. |
Okay, I have updated to the release version of |
This PR updates all of our UI and screenshot tests to use mocked networking using WireMock. The mocking functionality is shared with WPAndroid from the WordPressMocks repo.
It relies on the following open PRs:
Other related PRs:
To test:
rake dependencies
as usual.rake mocks
to start the mock server.WordPressUITests
target with Xcode.Note: The screenshot tests are broken in
develop
due to the recent stats changes. I think we should fix that in a separate change.Update release notes:
RELEASE-NOTES.txt
.