Skip to content

Commit

Permalink
Fix editor canvas detaching error in e2e tests (#49374)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevin940726 committed Apr 13, 2023
1 parent 6d9a82b commit 308f3ee
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();
}

1 comment on commit 308f3ee

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in 308f3ee.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4685804264
📝 Reported issues:

Please sign in to comment.