Skip to content

Commit

Permalink
Try to fix a11y test flakiness (#48236)
Browse files Browse the repository at this point in the history
* Try to fix a11y test flakiness

* Try a different approach

* Try a different approach

* Use tabindex
  • Loading branch information
kevin940726 authored Feb 21, 2023
1 parent bd8ffc1 commit 73711ad
Showing 1 changed file with 7 additions and 0 deletions.
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

1 comment on commit 73711ad

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in 73711ad.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4229486863
📝 Reported issues:

Please sign in to comment.