Skip to content

Commit

Permalink
Find editor canvas by button role
Browse files Browse the repository at this point in the history
Co-authored-by: Aki Hamano <54422211+t-hamano@users.noreply.github.com>
  • Loading branch information
jeryj and t-hamano authored Feb 14, 2024
1 parent ad788fc commit 39b0a10
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions test/e2e/specs/site-editor/navigation.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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' );
Expand Down

0 comments on commit 39b0a10

Please sign in to comment.