-
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] - E2E helpers - Update dismissKeyboard helper #48415
Conversation
Size Change: +827 B (0%) Total Size: 1.33 MB
ℹ️ View Unchanged
|
Flaky tests detected in d3bc4e2. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4283010705
|
- It adds new waitForElementToBeDisplayedByXPath helper - It adds a new functionality for dismissKeyboard which will handle waiting until the keyboard is fully hidden by taking the initial position of the Add block button in the editor. - It adds setupInitialValues which will handle initial values we want to have available during the tests
a2231b3
to
298f7d1
Compare
@@ -60,10 +60,6 @@ describe( 'Gutenberg Editor tests for Block insertion', () => { | |||
await editorPage.sendTextToParagraphBlock( 1, testData.longText ); | |||
// Should have 3 paragraph blocks at this point. | |||
|
|||
if ( isAndroid() ) { | |||
await editorPage.dismissKeyboard(); |
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.
This is now handled within dismissKeyboard
if the orientation is LANDSCAPE
(on Android) it will hide the Keyboard using the driver's hideDeviceKeyboard
method.
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.
LGTM 🎊 !
I checked the E2E tests in the GB-mobile PR and all succeeded 🎊.
I added a comment regarding a potential alternative to wait for the keyboard to be hidden. I haven't checked it myself so it might not work, so consider this suggestion optional. Thanks!
const ADD_BLOCK_ID = isAndroid() | ||
? 'Add block, Double tap to add a block' | ||
: 'Add block'; |
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.
Nitpick: Since this is a constant I'd consider having it before the definition of functions.
Related PRs:
What?
This PR updates some existing E2E helpers and it adds new ones.
Why?
To address an issue with a recently added visual test that fails in
trunk
in the Gutenberg Mobile repo.How?
It introduces
setupInitialValues
which for now will store the initial location of theAdd block
button (when the editor loads). This will be used to detect if the keyboard was fully dismissed and the button is back to the initial position. Relying onsleep
values is unreliable on CI so I think this approach might be more stable.Updates
dismissKeyboard
to take into account the location of theAdd block
button by calling the newwaitForKeyboardToBeHidden
helper.It adds
waitForElementToBeDisplayedByXPath
to wait for elements to be visible by XPaths.Testing Instructions
CI checks should pass on both Gutenberg and Gutenberg mobile.
Testing Instructions for Keyboard
N/A
Screenshots or screencast
N/A