diff --git a/test/e2e/specs/site-editor/writing-flow.spec.js b/test/e2e/specs/site-editor/writing-flow.spec.js index d9c63a1da1ddc5..1656135262d22d 100644 --- a/test/e2e/specs/site-editor/writing-flow.spec.js +++ b/test/e2e/specs/site-editor/writing-flow.spec.js @@ -23,8 +23,12 @@ test.describe( 'Site editor writing flow', () => { await admin.visitSiteEditor( { postId: 'emptytheme//header', postType: 'wp_template_part', + canvas: 'edit', } ); - await editor.canvas.click( 'body' ); + + // Wait for the template part to be loaded. + await page.waitForLoadState( 'networkidle' ); + // Select the first site title block. const siteTitleBlock = editor.canvas.locator( 'role=document[name="Block: Site Title"i]' @@ -51,8 +55,12 @@ test.describe( 'Site editor writing flow', () => { await admin.visitSiteEditor( { postId: 'emptytheme//header', postType: 'wp_template_part', + canvas: 'edit', } ); - await editor.canvas.click( 'body' ); + + // Wait for the template part to be loaded. + await page.waitForLoadState( 'networkidle' ); + // Make sure the sidebar is open. await editor.openDocumentSettingsSidebar();