-
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
Fix flaky tests in navigation.spec.js
and other tests related to the Post Editor Template mode
#51790
Fix flaky tests in navigation.spec.js
and other tests related to the Post Editor Template mode
#51790
Conversation
navigation.spec.js
Size Change: 0 B Total Size: 1.42 MB ℹ️ View Unchanged
|
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
Ugh! There are still e2e tests that fail; they look unrelated, though... If they do not pass after re-running them, I'll probably merge this PR anyway. 🤷 EDIT: I link the failing tests for visibility |
navigation.spec.js
navigation.spec.js
and other tests related to the Post Editor Template mode
I fixed other tests that were failing (also locally) related to the Post Editor Template mode.
I did so by waiting for the Editor canvas to be loaded before using the keyboard. |
9ee7e63
to
c0139fe
Compare
I rebased this so that #51826 is included. Hopefully there's a ✅ |
@DAreRodz the Puppeteer test finally passed, so even if that one is still flaky, I'm going to merge this to unblock Great work finding out the problem with these ones! 🎉 |
Oh, I missed the previous @noisysocks' comment. Thanks for the other fix, Robert 🙂 |
@@ -993,11 +993,9 @@ test.describe( 'Navigation block - Frontend interactivity', () => { | |||
await expect( overlayMenuFirstElement ).toBeFocused(); | |||
|
|||
// Test: overlay menu traps focus | |||
await page.keyboard.press( 'Tab' ); | |||
await page.keyboard.press( 'Tab' ); | |||
await pageUtils.pressKeys( 'Tab', { times: 2, delay: 50 } ); |
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 love that it solves the issue and I have no problem merging this. I'm just wondering if there's an actual bug that makes us use delay
, which is a last resort? It feels weird to me that Playwright has no problem tabbing through elements in the editor but is "too fast" in the frontend 🤔 . Maybe there's something obvious I'm missing though!
…e Post Editor Template mode (WordPress#51790) * Add delay between consecutive keystrokes * Fix post editor template mode tests
What?
Fixes flaky tests in the
navigation.spec.js
file belonging to the 'Navigation block - Frontend interactivity' test group.Other tests were failing, this time related to the
Post Editor Template mode
(see post-editor-template-mode.spec.js). I fixed them as well.Why?
The feature works fine, but tests are randomly failing because Playwright seems to fail with consecutive
Tab
keystrokes without a delay in between.How?
Replaced consecutive
page.keyboard.press
calls withpageUtils.pressKeys
, passing a delay of 50 milliseconds.Testing Instructions
Automatic e2e tests should pass now.