From 030b6ead1e89becf2445823cf529049336fd4268 Mon Sep 17 00:00:00 2001 From: Jerry Jones Date: Wed, 7 Feb 2024 15:35:14 -0600 Subject: [PATCH 01/12] Enter editing mode via Enter or Spacebar There was a regression in being able to enter editing mode via keydown on the site editor due to the onKeydown event being blocked. This allows an onKeydown prop to be fired if passed to the iframe. I'm not positive this is the best way. I also added a test to check for this as well as general keyboard navigation of the site editor in view mode. --- .../src/components/iframe/index.js | 5 +- test/e2e/specs/site-editor/navigation.spec.js | 80 +++++++++++++++++++ 2 files changed, 84 insertions(+), 1 deletion(-) create mode 100644 test/e2e/specs/site-editor/navigation.spec.js diff --git a/packages/block-editor/src/components/iframe/index.js b/packages/block-editor/src/components/iframe/index.js index de482c5f059dc8..673562fde34f58 100644 --- a/packages/block-editor/src/components/iframe/index.js +++ b/packages/block-editor/src/components/iframe/index.js @@ -273,13 +273,16 @@ function Iframe( { src={ src } title={ __( 'Editor canvas' ) } onKeyDown={ ( event ) => { + if ( props.onKeyDown ) { + props.onKeyDown( event ); + } // If the event originates from inside the iframe, it means // it bubbled through the portal, but only with React // events. We need to to bubble native events as well, // though by doing so we also trigger another React event, // so we need to stop the propagation of this event to avoid // duplication. - if ( + else if ( event.currentTarget.ownerDocument !== event.target.ownerDocument ) { diff --git a/test/e2e/specs/site-editor/navigation.spec.js b/test/e2e/specs/site-editor/navigation.spec.js new file mode 100644 index 00000000000000..bf84efc1b16071 --- /dev/null +++ b/test/e2e/specs/site-editor/navigation.spec.js @@ -0,0 +1,80 @@ +/** + * WordPress dependencies + */ +const { test, expect } = require( '@wordpress/e2e-test-utils-playwright' ); + +test.describe( 'Site editor navigation', () => { + test.beforeAll( async ( { requestUtils } ) => { + await requestUtils.activateTheme( 'emptytheme' ); + } ); + + test.afterAll( async ( { requestUtils } ) => { + await requestUtils.activateTheme( 'twentytwentyone' ); + } ); + + test( 'Can use keyboard to navigate the site editor', async ( { + admin, + page, + pageUtils, + } ) => { + await admin.visitSiteEditor(); + + // Navigate to the iframe + await pageUtils.pressKeys( 'Tab', { times: 3 } ); + // Open the command palette via button press + await expect( page.getByLabel( 'Open command palette' ) ).toBeFocused(); + await pageUtils.pressKeys( 'Enter' ); + await expect( + page.getByPlaceholder( 'Search for commands' ) + ).toBeFocused(); + // Return focus to the button + await pageUtils.pressKeys( 'Escape' ); + await expect( page.getByLabel( 'Open command palette' ) ).toBeFocused(); + // Open it again with Command + K + await pageUtils.pressKeys( 'primary+k' ); + await expect( + page.getByPlaceholder( 'Search for commands' ) + ).toBeFocused(); + await pageUtils.pressKeys( 'Escape' ); + await expect( page.getByLabel( 'Open command palette' ) ).toBeFocused(); + // Go to the Pages button + await pageUtils.pressKeys( 'Tab', { times: 4 } ); + await expect( + page.getByRole( 'button', { name: 'Pages' } ) + ).toBeFocused(); + await pageUtils.pressKeys( 'Enter' ); + // We should be in the Pages sidebar + await expect( + page.getByRole( 'button', { name: 'Back', exact: true } ) + ).toBeFocused(); + await pageUtils.pressKeys( 'Enter' ); + // Go back to the main navigation + await expect( + page.getByRole( 'button', { name: 'Pages' } ) + ).toBeFocused(); + await pageUtils.pressKeys( 'Tab', { times: 6 } ); + // Getting the actual iframe as a cleaner locator was suprisingly tricky, + // so we're using a css selector with .is-focused which should be present when the iframe has focus. + await expect( + page.locator( 'iframe[name="editor-canvas"].is-focused' ) + ).toBeFocused(); + + // Enter into editing mode + await pageUtils.pressKeys( 'Enter' ); + + // We should now be in editing mode + await pageUtils.pressKeys( 'Shift+Tab', { times: 9 } ); + + // Open the sidebar again + await expect( + page.getByRole( 'button', { + name: 'Open Navigation', + exact: true, + } ) + ).toBeFocused(); + await pageUtils.pressKeys( 'Enter' ); + await expect( + page.getByLabel( 'Go to the Dashboard' ).first() + ).toBeFocused(); + } ); +} ); From 75a8d558e2444ca60aaf2b5693fbceb02b240de6 Mon Sep 17 00:00:00 2001 From: Jerry Jones Date: Tue, 13 Feb 2024 10:37:59 -0600 Subject: [PATCH 02/12] Document tests. Solidify the iframe check. Remove flaky shift+tab from editor to sidebar navigation --- test/e2e/specs/site-editor/navigation.spec.js | 37 +++++++++++++++++-- 1 file changed, 33 insertions(+), 4 deletions(-) diff --git a/test/e2e/specs/site-editor/navigation.spec.js b/test/e2e/specs/site-editor/navigation.spec.js index bf84efc1b16071..c6454b4e839aee 100644 --- a/test/e2e/specs/site-editor/navigation.spec.js +++ b/test/e2e/specs/site-editor/navigation.spec.js @@ -19,8 +19,11 @@ test.describe( 'Site editor navigation', () => { } ) => { await admin.visitSiteEditor(); + // Test: // Navigate to the iframe await pageUtils.pressKeys( 'Tab', { times: 3 } ); + + // Test: Doesn't lose focus when using the command palette from the site editor navigation sidebar // Open the command palette via button press await expect( page.getByLabel( 'Open command palette' ) ).toBeFocused(); await pageUtils.pressKeys( 'Enter' ); @@ -30,6 +33,8 @@ test.describe( 'Site editor navigation', () => { // Return focus to the button await pageUtils.pressKeys( 'Escape' ); await expect( page.getByLabel( 'Open command palette' ) ).toBeFocused(); + + // Test: Doesn't lose focus when using the command palette from the command + k shortcut // Open it again with Command + K await pageUtils.pressKeys( 'primary+k' ); await expect( @@ -37,6 +42,8 @@ test.describe( 'Site editor navigation', () => { ).toBeFocused(); await pageUtils.pressKeys( 'Escape' ); await expect( page.getByLabel( 'Open command palette' ) ).toBeFocused(); + + // Test: Can navigate to a sidebar item and into its subnavigation frame without losing focus // Go to the Pages button await pageUtils.pressKeys( 'Tab', { times: 4 } ); await expect( @@ -52,18 +59,39 @@ test.describe( 'Site editor navigation', () => { await expect( page.getByRole( 'button', { name: 'Pages' } ) ).toBeFocused(); + + // Test: Can navigate into the iframe using the keyboard await pageUtils.pressKeys( 'Tab', { times: 6 } ); // Getting the actual iframe as a cleaner locator was suprisingly tricky, // so we're using a css selector with .is-focused which should be present when the iframe has focus. await expect( page.locator( 'iframe[name="editor-canvas"].is-focused' ) ).toBeFocused(); - - // Enter into editing mode + // Enter into the site editor frame await pageUtils.pressKeys( 'Enter' ); + // Focus should still be on the iframe. + await expect( + page.locator( 'iframe[name="editor-canvas"]' ) + ).toBeFocused(); + // But did it do anything? + // Test to make sure a Tab keypress works as expected. + // As of this writing, we are in select mode and a tab + /// keypress will reveal the header template select mode + // button. This test is not documenting that we _want_ + // that action, but checking that we are within the site + // editor and keypresses work as intened. + await pageUtils.pressKeys( 'Tab' ); + await expect( + page.getByRole( 'button', { + name: 'Template Part Block. Row 1. header', + } ) + ).toBeFocused(); - // We should now be in editing mode - await pageUtils.pressKeys( 'Shift+Tab', { times: 9 } ); + // Test: We can go back to the main navigation from the editor frame + // Move to the document toolbar + await pageUtils.pressKeys( 'alt+F10' ); + // Go to the open navigation button + await pageUtils.pressKeys( 'shift+Tab' ); // Open the sidebar again await expect( @@ -73,6 +101,7 @@ test.describe( 'Site editor navigation', () => { } ) ).toBeFocused(); await pageUtils.pressKeys( 'Enter' ); + await expect( page.getByLabel( 'Go to the Dashboard' ).first() ).toBeFocused(); From 4316b4a08e2f8dc5f9c061d575df65745987a23d Mon Sep 17 00:00:00 2001 From: Jerry Jones Date: Tue, 13 Feb 2024 10:38:34 -0600 Subject: [PATCH 03/12] Remove command palette focus tests --- test/e2e/specs/site-editor/navigation.spec.js | 26 +------------------ 1 file changed, 1 insertion(+), 25 deletions(-) diff --git a/test/e2e/specs/site-editor/navigation.spec.js b/test/e2e/specs/site-editor/navigation.spec.js index c6454b4e839aee..07fcc9e4ae0279 100644 --- a/test/e2e/specs/site-editor/navigation.spec.js +++ b/test/e2e/specs/site-editor/navigation.spec.js @@ -19,33 +19,9 @@ test.describe( 'Site editor navigation', () => { } ) => { await admin.visitSiteEditor(); - // Test: - // Navigate to the iframe - await pageUtils.pressKeys( 'Tab', { times: 3 } ); - - // Test: Doesn't lose focus when using the command palette from the site editor navigation sidebar - // Open the command palette via button press - await expect( page.getByLabel( 'Open command palette' ) ).toBeFocused(); - await pageUtils.pressKeys( 'Enter' ); - await expect( - page.getByPlaceholder( 'Search for commands' ) - ).toBeFocused(); - // Return focus to the button - await pageUtils.pressKeys( 'Escape' ); - await expect( page.getByLabel( 'Open command palette' ) ).toBeFocused(); - - // Test: Doesn't lose focus when using the command palette from the command + k shortcut - // Open it again with Command + K - await pageUtils.pressKeys( 'primary+k' ); - await expect( - page.getByPlaceholder( 'Search for commands' ) - ).toBeFocused(); - await pageUtils.pressKeys( 'Escape' ); - await expect( page.getByLabel( 'Open command palette' ) ).toBeFocused(); - // Test: Can navigate to a sidebar item and into its subnavigation frame without losing focus // Go to the Pages button - await pageUtils.pressKeys( 'Tab', { times: 4 } ); + await pageUtils.pressKeys( 'Tab', { times: 7 } ); await expect( page.getByRole( 'button', { name: 'Pages' } ) ).toBeFocused(); From 8cc925364afa2c06e8c51e6a2a470a6e7bdf24b4 Mon Sep 17 00:00:00 2001 From: Jerry Jones Date: Tue, 13 Feb 2024 11:04:12 -0600 Subject: [PATCH 04/12] Make tabbing long distances less flakey --- test/e2e/specs/site-editor/navigation.spec.js | 25 +++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/test/e2e/specs/site-editor/navigation.spec.js b/test/e2e/specs/site-editor/navigation.spec.js index 07fcc9e4ae0279..654d12eede69c6 100644 --- a/test/e2e/specs/site-editor/navigation.spec.js +++ b/test/e2e/specs/site-editor/navigation.spec.js @@ -21,7 +21,20 @@ test.describe( 'Site editor navigation', () => { // Test: Can navigate to a sidebar item and into its subnavigation frame without losing focus // Go to the Pages button - await pageUtils.pressKeys( 'Tab', { times: 7 } ); + + for ( let i = 0; i < 10; i++ ) { + await pageUtils.pressKeys( 'Tab' ); + const activeLabel = await page.evaluate( () => { + return ( + document.activeElement.getAttribute( 'aria-label' ) || + document.activeElement.textContent + ); + } ); + if ( activeLabel === 'Pages' ) { + break; + } + } + await expect( page.getByRole( 'button', { name: 'Pages' } ) ).toBeFocused(); @@ -37,7 +50,15 @@ test.describe( 'Site editor navigation', () => { ).toBeFocused(); // Test: Can navigate into the iframe using the keyboard - await pageUtils.pressKeys( 'Tab', { times: 6 } ); + for ( let i = 0; i < 10; i++ ) { + await pageUtils.pressKeys( 'Tab' ); + const activeNode = await page.evaluate( () => { + return document.activeElement.nodeName; + } ); + if ( activeNode === 'IFRAME' ) { + break; + } + } // Getting the actual iframe as a cleaner locator was suprisingly tricky, // so we're using a css selector with .is-focused which should be present when the iframe has focus. await expect( From 08c81eb9de78d53da4378e3f465aff154e2c56df Mon Sep 17 00:00:00 2001 From: Jerry Jones Date: Tue, 13 Feb 2024 11:16:34 -0600 Subject: [PATCH 05/12] Extract tabTo logic to util --- test/e2e/specs/site-editor/navigation.spec.js | 66 +++++++++++++------ 1 file changed, 45 insertions(+), 21 deletions(-) diff --git a/test/e2e/specs/site-editor/navigation.spec.js b/test/e2e/specs/site-editor/navigation.spec.js index 654d12eede69c6..f901552671589a 100644 --- a/test/e2e/specs/site-editor/navigation.spec.js +++ b/test/e2e/specs/site-editor/navigation.spec.js @@ -3,6 +3,12 @@ */ const { test, expect } = require( '@wordpress/e2e-test-utils-playwright' ); +test.use( { + editorNavigationUtils: async ( { page, pageUtils }, use ) => { + await use( new EditorNavigationUtils( { page, pageUtils } ) ); + }, +} ); + test.describe( 'Site editor navigation', () => { test.beforeAll( async ( { requestUtils } ) => { await requestUtils.activateTheme( 'emptytheme' ); @@ -14,6 +20,7 @@ test.describe( 'Site editor navigation', () => { test( 'Can use keyboard to navigate the site editor', async ( { admin, + editorNavigationUtils, page, pageUtils, } ) => { @@ -22,18 +29,7 @@ test.describe( 'Site editor navigation', () => { // Test: Can navigate to a sidebar item and into its subnavigation frame without losing focus // Go to the Pages button - for ( let i = 0; i < 10; i++ ) { - await pageUtils.pressKeys( 'Tab' ); - const activeLabel = await page.evaluate( () => { - return ( - document.activeElement.getAttribute( 'aria-label' ) || - document.activeElement.textContent - ); - } ); - if ( activeLabel === 'Pages' ) { - break; - } - } + await editorNavigationUtils.tabToLabel( 'Pages', { times: 10 } ); await expect( page.getByRole( 'button', { name: 'Pages' } ) @@ -50,15 +46,7 @@ test.describe( 'Site editor navigation', () => { ).toBeFocused(); // Test: Can navigate into the iframe using the keyboard - for ( let i = 0; i < 10; i++ ) { - await pageUtils.pressKeys( 'Tab' ); - const activeNode = await page.evaluate( () => { - return document.activeElement.nodeName; - } ); - if ( activeNode === 'IFRAME' ) { - break; - } - } + await editorNavigationUtils.tabToNode( 'IFRAME', { times: 10 } ); // Getting the actual iframe as a cleaner locator was suprisingly tricky, // so we're using a css selector with .is-focused which should be present when the iframe has focus. await expect( @@ -104,3 +92,39 @@ test.describe( 'Site editor navigation', () => { ).toBeFocused(); } ); } ); + +class EditorNavigationUtils { + constructor( { page, pageUtils } ) { + this.page = page; + this.pageUtils = pageUtils; + } + + async tabToLabel( label, { times = 10 } ) { + for ( let i = 0; i < times; i++ ) { + await this.pageUtils.pressKeys( 'Tab' ); + const activeLabel = await this.page.evaluate( () => { + return ( + document.activeElement.getAttribute( 'aria-label' ) || + document.activeElement.textContent + ); + } ); + if ( activeLabel === label ) { + return activeLabel; + } + } + return null; + } + + async tabToNode( nodeName, { times = 10 } ) { + for ( let i = 0; i < times; i++ ) { + await this.pageUtils.pressKeys( 'Tab' ); + const activeNode = await this.page.evaluate( () => { + return document.activeElement.nodeName; + } ); + if ( activeNode === nodeName ) { + break; + } + } + return null; + } +} From d8e988e45680210716c410bcd891672c04e0e9e7 Mon Sep 17 00:00:00 2001 From: Jerry Jones Date: Tue, 13 Feb 2024 11:21:45 -0600 Subject: [PATCH 06/12] Don't return anything from tabToX utils --- test/e2e/specs/site-editor/navigation.spec.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/test/e2e/specs/site-editor/navigation.spec.js b/test/e2e/specs/site-editor/navigation.spec.js index f901552671589a..251fb91e5e96f7 100644 --- a/test/e2e/specs/site-editor/navigation.spec.js +++ b/test/e2e/specs/site-editor/navigation.spec.js @@ -109,10 +109,9 @@ class EditorNavigationUtils { ); } ); if ( activeLabel === label ) { - return activeLabel; + return; } } - return null; } async tabToNode( nodeName, { times = 10 } ) { @@ -122,9 +121,8 @@ class EditorNavigationUtils { return document.activeElement.nodeName; } ); if ( activeNode === nodeName ) { - break; + return; } } - return null; } } From ad788fc435d1eed3044f340e9d019357b964bf2b Mon Sep 17 00:00:00 2001 From: Jerry Jones Date: Wed, 14 Feb 2024 09:36:59 -0600 Subject: [PATCH 07/12] Remove extra forward slash Co-authored-by: Aki Hamano <54422211+t-hamano@users.noreply.github.com> --- test/e2e/specs/site-editor/navigation.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/e2e/specs/site-editor/navigation.spec.js b/test/e2e/specs/site-editor/navigation.spec.js index 251fb91e5e96f7..870f7a3f81acc8 100644 --- a/test/e2e/specs/site-editor/navigation.spec.js +++ b/test/e2e/specs/site-editor/navigation.spec.js @@ -61,7 +61,7 @@ test.describe( 'Site editor navigation', () => { // But did it do anything? // Test to make sure a Tab keypress works as expected. // As of this writing, we are in select mode and a tab - /// keypress will reveal the header template select mode + // keypress will reveal the header template select mode // button. This test is not documenting that we _want_ // that action, but checking that we are within the site // editor and keypresses work as intened. From 39b0a10c6740d524bdaae70f2f9e1a1a45841ded Mon Sep 17 00:00:00 2001 From: Jerry Jones Date: Wed, 14 Feb 2024 09:39:04 -0600 Subject: [PATCH 08/12] Find editor canvas by button role Co-authored-by: Aki Hamano <54422211+t-hamano@users.noreply.github.com> --- test/e2e/specs/site-editor/navigation.spec.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/test/e2e/specs/site-editor/navigation.spec.js b/test/e2e/specs/site-editor/navigation.spec.js index 870f7a3f81acc8..41c52f2ec78f74 100644 --- a/test/e2e/specs/site-editor/navigation.spec.js +++ b/test/e2e/specs/site-editor/navigation.spec.js @@ -47,10 +47,8 @@ test.describe( 'Site editor navigation', () => { // Test: Can navigate into the iframe using the keyboard await editorNavigationUtils.tabToNode( 'IFRAME', { times: 10 } ); - // Getting the actual iframe as a cleaner locator was suprisingly tricky, - // so we're using a css selector with .is-focused which should be present when the iframe has focus. await expect( - page.locator( 'iframe[name="editor-canvas"].is-focused' ) + page.getByRole( 'button', { name: 'Editor Canvas' } ) ).toBeFocused(); // Enter into the site editor frame await pageUtils.pressKeys( 'Enter' ); From 0ef75facd9a8b3ce12f4a092ed582203e3b6e588 Mon Sep 17 00:00:00 2001 From: Jerry Jones Date: Wed, 14 Feb 2024 09:47:51 -0600 Subject: [PATCH 09/12] Remove tabToNode. Use iframe button role. --- test/e2e/specs/site-editor/navigation.spec.js | 31 ++++++++----------- 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/test/e2e/specs/site-editor/navigation.spec.js b/test/e2e/specs/site-editor/navigation.spec.js index 41c52f2ec78f74..d8dac549d0531b 100644 --- a/test/e2e/specs/site-editor/navigation.spec.js +++ b/test/e2e/specs/site-editor/navigation.spec.js @@ -46,17 +46,22 @@ test.describe( 'Site editor navigation', () => { ).toBeFocused(); // Test: Can navigate into the iframe using the keyboard - await editorNavigationUtils.tabToNode( 'IFRAME', { times: 10 } ); - await expect( - page.getByRole( 'button', { name: 'Editor Canvas' } ) - ).toBeFocused(); + await editorNavigationUtils.tabToLabel( 'Editor Canvas', { + times: 10, + } ); + const editorCanvasButton = page.getByRole( 'button', { + name: 'Editor Canvas', + } ); + await expect( editorCanvasButton ).toBeFocused(); // Enter into the site editor frame await pageUtils.pressKeys( 'Enter' ); - // Focus should still be on the iframe. + // Focus should be on the iframe without the button role await expect( page.locator( 'iframe[name="editor-canvas"]' ) ).toBeFocused(); - // But did it do anything? + // The button role should have been removed from the iframe. + await expect( editorCanvasButton ).toBeHidden(); + // Test to make sure a Tab keypress works as expected. // As of this writing, we are in select mode and a tab // keypress will reveal the header template select mode @@ -88,6 +93,8 @@ test.describe( 'Site editor navigation', () => { await expect( page.getByLabel( 'Go to the Dashboard' ).first() ).toBeFocused(); + // We should have our editor canvas button back + await expect( editorCanvasButton ).toBeVisible(); } ); } ); @@ -111,16 +118,4 @@ class EditorNavigationUtils { } } } - - async tabToNode( nodeName, { times = 10 } ) { - for ( let i = 0; i < times; i++ ) { - await this.pageUtils.pressKeys( 'Tab' ); - const activeNode = await this.page.evaluate( () => { - return document.activeElement.nodeName; - } ); - if ( activeNode === nodeName ) { - return; - } - } - } } From e9a28610df49bd71ded1db60846376ea53d64d95 Mon Sep 17 00:00:00 2001 From: Jerry Jones Date: Thu, 15 Feb 2024 08:43:20 -0600 Subject: [PATCH 10/12] Use times param directly instead of as object Co-authored-by: Aki Hamano <54422211+t-hamano@users.noreply.github.com> --- test/e2e/specs/site-editor/navigation.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/e2e/specs/site-editor/navigation.spec.js b/test/e2e/specs/site-editor/navigation.spec.js index d8dac549d0531b..879de94c8e6e78 100644 --- a/test/e2e/specs/site-editor/navigation.spec.js +++ b/test/e2e/specs/site-editor/navigation.spec.js @@ -104,7 +104,7 @@ class EditorNavigationUtils { this.pageUtils = pageUtils; } - async tabToLabel( label, { times = 10 } ) { + async tabToLabel( label, times = 10 ) { for ( let i = 0; i < times; i++ ) { await this.pageUtils.pressKeys( 'Tab' ); const activeLabel = await this.page.evaluate( () => { From 7441ad2643f1d1388bb17bdcd9b10539bb9ab0f4 Mon Sep 17 00:00:00 2001 From: Jerry Jones Date: Thu, 15 Feb 2024 08:43:31 -0600 Subject: [PATCH 11/12] Rely on default times value Co-authored-by: Aki Hamano <54422211+t-hamano@users.noreply.github.com> --- test/e2e/specs/site-editor/navigation.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/e2e/specs/site-editor/navigation.spec.js b/test/e2e/specs/site-editor/navigation.spec.js index 879de94c8e6e78..8f58f809ef1cca 100644 --- a/test/e2e/specs/site-editor/navigation.spec.js +++ b/test/e2e/specs/site-editor/navigation.spec.js @@ -29,7 +29,7 @@ test.describe( 'Site editor navigation', () => { // Test: Can navigate to a sidebar item and into its subnavigation frame without losing focus // Go to the Pages button - await editorNavigationUtils.tabToLabel( 'Pages', { times: 10 } ); + await editorNavigationUtils.tabToLabel( 'Pages' ); await expect( page.getByRole( 'button', { name: 'Pages' } ) From fea790d5a665f63e57c2dd44a4734a06bd572e55 Mon Sep 17 00:00:00 2001 From: Jerry Jones Date: Thu, 15 Feb 2024 08:43:42 -0600 Subject: [PATCH 12/12] Rely on default times value Co-authored-by: Aki Hamano <54422211+t-hamano@users.noreply.github.com> --- test/e2e/specs/site-editor/navigation.spec.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/test/e2e/specs/site-editor/navigation.spec.js b/test/e2e/specs/site-editor/navigation.spec.js index 8f58f809ef1cca..25a5b5dee59ffb 100644 --- a/test/e2e/specs/site-editor/navigation.spec.js +++ b/test/e2e/specs/site-editor/navigation.spec.js @@ -46,9 +46,7 @@ test.describe( 'Site editor navigation', () => { ).toBeFocused(); // Test: Can navigate into the iframe using the keyboard - await editorNavigationUtils.tabToLabel( 'Editor Canvas', { - times: 10, - } ); + await editorNavigationUtils.tabToLabel( 'Editor Canvas' ); const editorCanvasButton = page.getByRole( 'button', { name: 'Editor Canvas', } );