From 489df62d0d195d7cee0dec0142f90cffc2505aa7 Mon Sep 17 00:00:00 2001 From: Andrea Fercia Date: Mon, 24 Feb 2025 16:15:03 +0100 Subject: [PATCH] Adjust Safari test. --- test/e2e/specs/editor/various/a11y.spec.js | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/test/e2e/specs/editor/various/a11y.spec.js b/test/e2e/specs/editor/various/a11y.spec.js index 1f5dec0b9882f5..f7d0b63cb895eb 100644 --- a/test/e2e/specs/editor/various/a11y.spec.js +++ b/test/e2e/specs/editor/various/a11y.spec.js @@ -21,7 +21,6 @@ test.describe( 'a11y (@firefox, @webkit)', () => { page, pageUtils, editor, - browserName, } ) => { // To do: run with iframe. await editor.switchToLegacyCanvas(); @@ -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(); } );