Skip to content

Commit

Permalink
Adjust Safari test.
Browse files Browse the repository at this point in the history
  • Loading branch information
afercia committed Feb 24, 2025
1 parent 22630ee commit 489df62
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions test/e2e/specs/editor/various/a11y.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ test.describe( 'a11y (@firefox, @webkit)', () => {
page,
pageUtils,
editor,
browserName,
} ) => {
// To do: run with iframe.
await editor.switchToLegacyCanvas();
Expand Down Expand Up @@ -49,14 +48,12 @@ test.describe( 'a11y (@firefox, @webkit)', () => {
// When full screen mode is enabled, check the first tabbable element
// within the 'Editor top bar' region is the 'View Posts' link otherwise
// check it's the 'Block Inserter' button.
// In webkit (Safari) links aren't tabbable by default so we always test
// for the 'Block Inserter' button.
let elementToTest = isFullScreenMode
// When running this test locally, make sure that in macOS webkit (Safari)
// links are focusable and tabbable by setting the related preferences at
// system and browser level.
const elementToTest = isFullScreenMode
? 'role=link[name=/View Posts/i]'
: 'role=button[name=/Block Inserter/i]';
if ( browserName === 'webkit' ) {
elementToTest = 'role=button[name=/Block Inserter/i]';
}

await expect( page.locator( elementToTest ) ).toBeFocused();
} );
Expand Down

0 comments on commit 489df62

Please sign in to comment.