From ad4da873ce4604dfb9bbb2752a7bcfeea7db5204 Mon Sep 17 00:00:00 2001 From: George Mamadashvili Date: Wed, 8 Jan 2025 09:19:22 +0400 Subject: [PATCH] Try: Fix e2e tests 'visitSiteEditor' helper (#68534) Co-authored-by: Mamaduka --- .../src/admin/visit-site-editor.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/e2e-test-utils-playwright/src/admin/visit-site-editor.ts b/packages/e2e-test-utils-playwright/src/admin/visit-site-editor.ts index 21bf56b578b57..1e79a30306e4c 100644 --- a/packages/e2e-test-utils-playwright/src/admin/visit-site-editor.ts +++ b/packages/e2e-test-utils-playwright/src/admin/visit-site-editor.ts @@ -39,6 +39,15 @@ export async function visitSiteEditor( await this.visitAdminPage( 'site-editor.php', query.toString() ); + if ( ! options.showWelcomeGuide ) { + await this.editor.setPreferences( 'core/edit-site', { + welcomeGuide: false, + welcomeGuideStyles: false, + welcomeGuidePage: false, + welcomeGuideTemplate: false, + } ); + } + /** * @todo This is a workaround for the fact that the editor canvas is seen as * ready and visible before the loading spinner is hidden. Ideally, the @@ -63,13 +72,4 @@ export async function visitSiteEditor( timeout: 60_000, } ); } - - if ( ! options.showWelcomeGuide ) { - await this.editor.setPreferences( 'core/edit-site', { - welcomeGuide: false, - welcomeGuideStyles: false, - welcomeGuidePage: false, - welcomeGuideTemplate: false, - } ); - } }