-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
[Mobile] - Update E2E tests organization and helpers #48026
Conversation
Size Change: 0 B Total Size: 1.33 MB ℹ️ View Unchanged
|
Flaky tests detected in 07a792b. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4183474973
|
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.
Awesome work @geriux 🏅 , LGTM 🎊 !
I checked the E2E test results on wordpress-mobile/gutenberg-mobile#5462 and confirmed they succeeded. I added some minor comments in the PR but none of them should block the PR.
Related PRs:
What?
This PR updates some of the current E2E tests we have by merging them into one file, it also updates some of them to use accessibility IDs instead of XPaths.
Why?
After working on wordpress-mobile/gutenberg-mobile#5462 to only make the builds once and reuse them to run E2E test in different jobs e.g. Canary/Full test, it was clear that for iOS it was still taking a bit of time compared to Android.
By investigating I realized that each test takes up to 1 minute and 30 seconds to load the MacOS VM and the simulator, without taking into account the amount of time each test takes. By merging some tests into one file we save up that time and it also makes sense for a few tests to be together.
This is also a pre-work for upcoming visual regression tests where we should use the same approach and have different tests in one file.
I also checked some of the tests and how they were finding elements and a lot of them use XPaths which is not recommended as it is slower compared to using accessibility IDs.
It also removes some workarounds like this one which was already addressed and we can safely remove it.
How?
By merging a few tests together:
gutenberg-editor-audio.test
,gutenberg-editor-cover.test
,gutenberg-editor-file-@canary.test
, andgutenberg-editor-image-@canary.test
are now ingutenberg-editor-media-blocks-@canary.test
gutenberg-editor-slash-inserter-@canary.test
was moved into:gutenberg-editor-block-insertion-@canary.test
.gutenberg-editor-paste.test
, andgutenberg-editor-rotation.test
are nowgutenberg-editor-device-actions.test
Updates different helpers:
getTitleElement
,addNewBlock
to use accessibility IDs instead of XPaths.openBlockSettings
to use accessibility IDs instead of XPaths and also to usewaitForElementByAccessibilityId
and theisDisplayed
asserter.removeBlock
which is different fromremoveBlockAtPosition
, it removes the selected block.waitForInserter
to wait for the Inserter modal to be displayed.assertSlashInserterPresent
now uses accessibility IDs, we had issues with this as it would take a few tries to find the element before.Testing Instructions
CI Checks should pass on both PRs
Testing Instructions for Keyboard
N/A
Screenshots or screencast
N/A