-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Plans on JP: Update UI tests for Plan Selection #20728
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
Conversation
Generated by 🚫 dangerJS |
|
| App Name | Jetpack Alpha |
|
| Configuration | Release-Alpha | |
| Build Number | pr20728-a3d5b7b | |
| Version | 22.4 | |
| Bundle ID | com.jetpack.alpha | |
| Commit | a3d5b7b | |
| App Center Build | jetpack-installable-builds #4816 |
|
| App Name | WordPress Alpha |
|
| Configuration | Release-Alpha | |
| Build Number | pr20728-a3d5b7b | |
| Version | 22.4 | |
| Bundle ID | org.wordpress.alpha | |
| Commit | a3d5b7b | |
| App Center Build | WPiOS - One-Offs #5785 |
- Added Domain suggestion, product fetching, and adding to cart API mocks - Select domain and confirm selection in UI tests
5cbbf96 to
ae1b70e
Compare
guarani
left a comment
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.
👋 @staskus, thanks for adding this UI test! The code changes look good.
When I run this locally for the first time (fresh run of testFreeToPaidCardNavigation on a simulator that's had "Erase all content and settings" applied), the test gets stuck because the card is missing:
Screen.Recording.2023-05-23.at.15.58.43.mov
If I re-run the test, the card is now there and the test passes. Can you reproduce this failure on the 1st run or does it work for you?
If this is failing locally I thought it might be failing on CI on the 1st attempt and passing on the 2nd (assuming its set to retry automatically). I searched the Buildkite logs and artifacts but couldn't find evidence of this. I also looked at https://github.com/wordpress-mobile/WordPress-iOS/blob/trunk/.buildkite/commands/run-ui-tests.sh and
WordPress-iOS/fastlane/lanes/build.rb
Line 81 in 2719dfb
| lane :test_without_building do |options| |
number_of_retries).
I also looked at the dashboard code and noticed that it loads (remote) cards from a cache via loadCardsFromCache when it loads local cards. It seems like the remote cards which are fetched via /wpcom/v2/sites/106707880/dashboard/cards-data/?cards=todays_stats,posts&_locale=en fail consistently in DashboardServiceRemote even thought they should load from the mock. Perhaps there's a corner case that when the remote cards fail to load so do the local ones. Then on the 2nd attempt, the cache is set (but still emty) and that allows the local ones to load. This is just a thought though since I haven't been able to verify.
Before spending more time digging, I want to check with you if it's just me seeing this failure or if you also see it.
Thanks for reviewing, @guarani! Yes, I see a similar thing. From warnings I would assume some mocks are outdated, but maybe there's an issue in the code as well that prevents a dashboard card from showing up even though it potentially could. I would need to investigate to understand more. |
|
I investigated the issue. Yes, there're misconfigured
With just setting different breakpoints, I could reproduce the same issue on debug, as we have on UI Tests. I always assumed dashboard cards are reloaded when Therefore, our initial issue in i tests was caused by However, fixing mocks is not enough, since with |
|
I assigned you for another review. However, if you prefer, we can first focus on finishing and merging other tasks and leave UI tests for the end. |
pachlava
left a comment
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.
@staskus 👋
Huuuge thanks for refactoring the test 👍 It works for me locally with no issues (after e2ae033, I suppose), both after having a clean Simulator, and also on the second try. I tried iOS 16.4 and 16.2.
I left a few nitpicky comments about functions naming/format, it's not anything blocking, feel free to apply the suggestions or ignore them.
P.S. Even though the most recent Buildkite executions are marked green, the test failed for iPad on Buildkite (see JetpackUITests.xml), however from the log it's seen that this happens during Set Up, so it's not related to the test itself. Actually, the same happens to testInsightsStatsLoadProperly, also during Set Up, and looks like the legendary spinning wheel issue (cc @tiagomar for confirmation) :
| } | ||
|
|
||
| @discardableResult | ||
| public func selectDomain() throws -> Self { |
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.
Since the screen contains Select domain button, it's easy to assume that the function taps this button. However, it does a different thing, which is tapping the last cell. WDYT of renaming the function?
| public func selectDomain() throws -> Self { | |
| public func tapLastDomain() throws -> Self { |
?
| @discardableResult | ||
| public func goToPlanSelection() throws -> PlanSelectionScreen { | ||
| app.buttons["Select domain"].tap() | ||
| return try PlanSelectionScreen() | ||
| } |
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.
It's a question of test steps details level, just thinking aloud. Do we need this function separately? What if we perform both the domain selection and Select domain tap in a single function?
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.
Yup, I think that would make sense!
guarani
left a comment
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.
Tested locally and working now on the 1st try. Thanks @staskus!
…ate-ui-tests There were conflicts on `WordPress/WordPress.xcodeproj/project.pbxproj` because both the working branch and `trunk` added a file. I resolved the by keeping both files and verifying the build.
|
Took over the PR to resolve the merge conflict and enable auto-merge in order to get ready for the upcoming 22.5 code freeze. |
|
🤔 looks like after merging I'll be looking into this ASAP, but cc @staskus @guarani @pachlava in case you have ideas. |
|
See #20751 |
|
The new fail seem to be related to #20731. "Search domains" screen was redesigned a bit, this is why |
|
I have a fix here (the commit is there, but the PR is not presented well yet. I'll be able to get back to it in 2 hours). Fails were caused by the redesign of Search domains screen. Now, the screen is presented as an overlay (not sure if I'm using a correct term), instead of a usual screen. Since this is an overlay, the bottom navigation bar is not visible:
However, it was still mentioned in the |
|
🎉 thanks @pachlava ! I was still looking into it but to no avail, as you can see from my PR still failing. What do you make of all the failures like: They occur on my end, too, and don't seem related to the UI changes. I say that because it looks like it fails immediately:
|
|
@pachlava I cherry picked your work on my PR, and I still got those failed to launch errors. However, the iPhone UI tests passed, which is a good improvement 🙌 I'm quite confused by those logs, by the way. I tried the same commit locally and got some of those failures but also tests that passed:
|
|
@mokagio 👋
These kinds of failures seem to be present in all cases of UI tests execution, no matter if they pass or fail. They might be related to the fact of parallel testing being enabled (@jostnes / @tiagomar ), but I might be wrong. Not having them is an ideal case, however it's not the reason why the tests fail. In my testing PR, the |
Taking my words back, this was also taking place before parallel testing. |
|
@pachlava, thank you for the investigation. Parallel testing would have been my first line of enquiry too 😄 |
Yep, these errors started showing up after we started deleting the app after each test. My understanding is that the test runner tries to launch the app while it's still being re-installed. It makes the log noisy and a bit misleading but so far I think the execution time saved and increased reliability with deleting the app kind of pays-off? |





Fixes #20720
Update UI tests for Plan Selection:
To test:
PR submission checklist:
RELEASE-NOTES.txtif necessary.plan.selection.mp4