diff --git a/test/e2e/specs/site-editor/pages.spec.js b/test/e2e/specs/site-editor/pages.spec.js index 8358c5f4941dd..8c63036a60ebb 100644 --- a/test/e2e/specs/site-editor/pages.spec.js +++ b/test/e2e/specs/site-editor/pages.spec.js @@ -78,7 +78,7 @@ test.describe( 'Pages', () => { ).toBeVisible(); // Switch to template editing focus. - await page.getByRole( 'button', { name: 'Settings' } ).click(); + await editor.openDocumentSettingsSidebar(); await page .getByRole( 'region', { name: 'Editor settings' } ) .getByRole( 'button', { name: 'Edit template' } ) @@ -102,7 +102,10 @@ test.describe( 'Pages', () => { .fill( 'New Site Title' ); // Go back to page editing focus. - await page.getByRole( 'button', { name: 'Back', exact: true } ).click(); + await page + .getByRole( 'region', { name: 'Editor top bar' } ) + .getByRole( 'button', { name: 'Back' } ) + .click(); // Site Title and Page entities should have been modified. await page.getByRole( 'button', { name: 'Save', exact: true } ).click();