Skip to content

Commit

Permalink
Try fixing perf tests
Browse files Browse the repository at this point in the history
  • Loading branch information
WunderBart committed Feb 14, 2023
1 parent aaf1276 commit 03d5b02
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions packages/e2e-test-utils/src/site-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,13 +166,15 @@ export async function openPreviousGlobalStylesPanel() {
* Enters edit mode.
*/
export async function enterEditMode() {
const isViewMode = await page.$(
'.edit-site-visual-editor__editor-canvas[role="button"]'
);
// This check is necessary for the performance tests in old branches
// where the site editor toggle was not implemented yet.
if ( ! isViewMode ) {
return;
try {
await page.waitForSelector(
'.edit-site-visual-editor__editor-canva[role="button"]',
{ timeout: 3000 }
);

await canvas().click( 'body' );
} catch {
// This catch is necessary for the performance tests in old branches
// where the site editor toggle was not implemented yet.
}
await canvas().click( 'body' );
}

0 comments on commit 03d5b02

Please sign in to comment.