From a6a0f440544f7e086ac9607142e997352cc8e53d Mon Sep 17 00:00:00 2001 From: George Mamadashvili Date: Mon, 20 Mar 2023 16:25:36 +0400 Subject: [PATCH] Fix flaky Site Editor title e2e tests --- test/e2e/specs/site-editor/title.spec.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/test/e2e/specs/site-editor/title.spec.js b/test/e2e/specs/site-editor/title.spec.js index e194e90449160c..fada3fbe41e1ef 100644 --- a/test/e2e/specs/site-editor/title.spec.js +++ b/test/e2e/specs/site-editor/title.spec.js @@ -15,14 +15,13 @@ test.describe( 'Site editor title', () => { test( 'displays the selected template name in the title for the index template', async ( { admin, page, - editor, } ) => { // Navigate to a template. await admin.visitSiteEditor( { postId: 'emptytheme//index', postType: 'wp_template', + canvas: 'edit', } ); - await editor.canvas.click( 'body' ); const title = page.locator( 'role=region[name="Editor top bar"i] >> role=heading[level=1]' ); @@ -33,14 +32,13 @@ test.describe( 'Site editor title', () => { test( 'displays the selected template name in the title for the header template', async ( { admin, page, - editor, } ) => { // Navigate to a template part. await admin.visitSiteEditor( { postId: 'emptytheme//header', postType: 'wp_template_part', + canvas: 'edit', } ); - await editor.canvas.click( 'body' ); const title = page.locator( 'role=region[name="Editor top bar"i] >> role=heading[level=1]' ); @@ -51,13 +49,12 @@ test.describe( 'Site editor title', () => { test( "displays the selected template part's name in the secondary title when a template part is selected from List View", async ( { admin, page, - editor, } ) => { await admin.visitSiteEditor( { postId: 'emptytheme//index', postType: 'wp_template', + canvas: 'edit', } ); - await editor.canvas.click( 'body' ); // Select the header template part via list view. await page.click( 'role=button[name="List View"i]' ); const listView = page.locator(