-
Notifications
You must be signed in to change notification settings - Fork 1.1k
[UI Test] Enhance EditorPostSettings Screen Object and reduce testCreateScheduledPost() flakiness. #21402
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
|
| App Name | Jetpack Alpha |
|
| Configuration | Release-Alpha | |
| Build Number | pr21402-09fc217 | |
| Version | 23.1 | |
| Bundle ID | com.jetpack.alpha | |
| Commit | 09fc217 | |
| App Center Build | jetpack-installable-builds #5868 |
|
| App Name | WordPress Alpha |
|
| Configuration | Release-Alpha | |
| Build Number | pr21402-09fc217 | |
| Version | 23.1 | |
| Bundle ID | org.wordpress.alpha | |
| Commit | 09fc217 | |
| App Center Build | WPiOS - One-Offs #6827 |
jostnes
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.
Thanks for making the element stricter @tiagomar! Though I agree that it would probably not solve the flakiness entirely. I had a look at the test flakiness previously and have yet to find a proper solution, but the reason it's flaky, I believe, is due to the timing of the test.
The test expects to tap on the View button on the notice, seen here:

But when the test reaches the code to do the actual tap, the notice has disappeared and, in the process, will fail the test:

It's always tricky for UI tests to depend on unreliable elements like the notice, especially in CI runs.
|
@tiagomar I've been thinking about the WordPress-iOS/WordPress/UITestsFoundation/Screens/Editor/EditorNoticeComponent.swift Lines 30 to 37 in 605427c
And only depend on the asserts in |
|
Good point, @jostnes! I checked the failures and 12 out of 17 apparently fail just like you described. The assertion itself takes less than 1s in my machine, but it could take longer in CI. But in this case, I think that having a dedicated Screen Object to the notice is an overkill and the Another thing I noticed is that we wait up to 3 seconds to dismiss Blogging Reminder but it apparently doesn't show up for scheduled posts? WordPress-iOS/WordPress/UITestsFoundation/Screens/Editor/BlockEditorScreen.swift Lines 405 to 412 in f697472
I'm working on a PR touching these points and you should be pinged soon. =] |


Description
testCreateScheduledPost()is currently the least reliable ui test in iPad with ~85% at the time of writing. While working on another tests,testCreateScheduledPost()started consistently failing locally for me, so I could take a closer look. The error I've seen doesn't match all the errors in CI but fixing it is a good improvement at least.The test fails when trying to select the day in the Calendar. The element being tapped is
staticText["1"]which was not hittable in my case. Checking the hierarchy,staticText["1"]in under a button that is hittable. This PR changes thefirstCalendarDaylocator fromstaticText["1"]to a button containingstaticText["1"].Testing
Run the test locally on iPhone and iPad.
CI must be 🟢.