Skip to content

Commit

Permalink
Try another approach
Browse files Browse the repository at this point in the history
  • Loading branch information
kevin940726 committed Apr 13, 2023
1 parent 9daffed commit 7aff89a
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ export async function visitSiteEditor(
} ).slice( 1 );

await this.visitAdminPage( 'site-editor.php', path );
await this.page.waitForSelector( CANVAS_SELECTOR );

if ( skipWelcomeGuide ) {
await this.page.evaluate( () => {
Expand All @@ -47,4 +46,12 @@ export async function visitSiteEditor(
.toggle( 'core/edit-site', 'welcomeGuideStyles', false );
} );
}

// The site editor initially loads with an empty body,
// we need to wait for the editor canvas to be rendered.
await this.page
.frameLocator( CANVAS_SELECTOR )
.locator( 'body > *' )
.first()
.waitFor();
}

0 comments on commit 7aff89a

Please sign in to comment.