Skip to content
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

Try to fix a11y test flakiness #48236

Merged
merged 4 commits into from
Feb 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions test/e2e/specs/editor/various/a11y.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,13 @@ test.describe( 'a11y (@firefox, @webkit)', () => {
// The Blocks tab panel content is long and scrollable.
// Check it's focusable.
await clickAndFocusTab( blocksTab );
// Explicitly wait for the modal content to be attached with certain attributes.
// This is necessary for solving a flaky result where Playwright runs too fast
// before DOM catching up.
await expect( preferencesModalContent ).toHaveAttribute(
'tabindex',
'0'
);
await page.keyboard.press( 'Shift+Tab' );
await expect( closeButton ).toBeFocused();
await page.keyboard.press( 'Shift+Tab' );
Expand Down