Skip to content

Commit

Permalink
Try a different fix
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad committed Feb 16, 2023
1 parent 4531dde commit bebe92d
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions packages/e2e-test-utils/src/site-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,14 +166,15 @@ export async function openPreviousGlobalStylesPanel() {
* Enters edit mode.
*/
export async function enterEditMode() {
const isSidebarVisible = await page.$( '.edit-site-layout__sidebar' );
// This check is necessary for the performance tests in old branches
// where the site editor toggle was not implemented yet.
if ( ! isSidebarVisible ) {
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 page.waitForSelector(
'.edit-site-visual-editor__editor-canvas[role="button"]'
);
await canvas().click( 'body' );
}

0 comments on commit bebe92d

Please sign in to comment.