diff --git a/packages/e2e-tests/experimental-features.js b/packages/e2e-tests/experimental-features.js index 0976b2c4086037..8e649d3781ae94 100644 --- a/packages/e2e-tests/experimental-features.js +++ b/packages/e2e-tests/experimental-features.js @@ -157,4 +157,17 @@ export const siteEditor = { return ''; } ); }, + + async disableWelcomeGuide() { + const isWelcomeGuideActive = await page.evaluate( () => + wp.data.select( 'core/edit-site' ).isFeatureActive( 'welcomeGuide' ) + ); + if ( isWelcomeGuideActive ) { + await page.evaluate( () => + wp.data + .dispatch( 'core/edit-site' ) + .toggleFeature( 'welcomeGuide' ) + ); + } + }, }; diff --git a/packages/e2e-tests/specs/experiments/document-settings.test.js b/packages/e2e-tests/specs/experiments/document-settings.test.js index c3a13c75abb102..0d764a3e3dda34 100644 --- a/packages/e2e-tests/specs/experiments/document-settings.test.js +++ b/packages/e2e-tests/specs/experiments/document-settings.test.js @@ -36,6 +36,7 @@ describe( 'Document Settings', () => { beforeEach( async () => { await siteEditor.visit(); + await siteEditor.disableWelcomeGuide(); } ); describe( 'when a template is selected from the navigation sidebar', () => { diff --git a/packages/e2e-tests/specs/experiments/multi-entity-editing.test.js b/packages/e2e-tests/specs/experiments/multi-entity-editing.test.js index c2090e340f39cf..8d8a6ac7e4fc7d 100644 --- a/packages/e2e-tests/specs/experiments/multi-entity-editing.test.js +++ b/packages/e2e-tests/specs/experiments/multi-entity-editing.test.js @@ -145,6 +145,7 @@ describe( 'Multi-entity editor states', () => { it( 'should not display any dirty entities when loading the site editor', async () => { await siteEditor.visit(); + await siteEditor.disableWelcomeGuide(); expect( await openEntitySavePanel() ).toBe( false ); } ); @@ -204,6 +205,7 @@ describe( 'Multi-entity editor states', () => { ); await saveAllEntities(); await siteEditor.visit(); + await siteEditor.disableWelcomeGuide(); // Wait for site editor to load. await canvas().waitForSelector( diff --git a/packages/e2e-tests/specs/experiments/settings-sidebar.test.js b/packages/e2e-tests/specs/experiments/settings-sidebar.test.js index be3e44fce32b47..d36bc9bc092250 100644 --- a/packages/e2e-tests/specs/experiments/settings-sidebar.test.js +++ b/packages/e2e-tests/specs/experiments/settings-sidebar.test.js @@ -53,6 +53,7 @@ describe( 'Settings sidebar', () => { } ); beforeEach( async () => { await siteEditor.visit(); + await siteEditor.disableWelcomeGuide(); } ); describe( 'Template tab', () => { diff --git a/packages/e2e-tests/specs/experiments/site-editor-export.test.js b/packages/e2e-tests/specs/experiments/site-editor-export.test.js index 961a19525c6a23..b534509de4b006 100644 --- a/packages/e2e-tests/specs/experiments/site-editor-export.test.js +++ b/packages/e2e-tests/specs/experiments/site-editor-export.test.js @@ -41,6 +41,7 @@ describe( 'Site Editor Templates Export', () => { beforeEach( async () => { await siteEditor.visit(); + await siteEditor.disableWelcomeGuide(); } ); it( 'clicking export should download edit-site-export.zip file', async () => { diff --git a/packages/e2e-tests/specs/experiments/site-editor-inserter.test.js b/packages/e2e-tests/specs/experiments/site-editor-inserter.test.js index 3aa7d649f86ef1..fab65066206a3f 100644 --- a/packages/e2e-tests/specs/experiments/site-editor-inserter.test.js +++ b/packages/e2e-tests/specs/experiments/site-editor-inserter.test.js @@ -19,6 +19,7 @@ describe( 'Site Editor Inserter', () => { } ); beforeEach( async () => { await siteEditor.visit(); + await siteEditor.disableWelcomeGuide(); } ); it( 'inserter toggle button should toggle global inserter', async () => { diff --git a/packages/e2e-tests/specs/experiments/template-part.test.js b/packages/e2e-tests/specs/experiments/template-part.test.js index ddec6e7d362018..8f18da2b88006e 100644 --- a/packages/e2e-tests/specs/experiments/template-part.test.js +++ b/packages/e2e-tests/specs/experiments/template-part.test.js @@ -36,6 +36,7 @@ describe( 'Template Part', () => { describe( 'Template part block', () => { beforeEach( async () => { await siteEditor.visit(); + await siteEditor.disableWelcomeGuide(); } ); async function navigateToHeader() { diff --git a/packages/e2e-tests/specs/experiments/template-revert.test.js b/packages/e2e-tests/specs/experiments/template-revert.test.js index 67a167728cbdd9..771578215ca701 100644 --- a/packages/e2e-tests/specs/experiments/template-revert.test.js +++ b/packages/e2e-tests/specs/experiments/template-revert.test.js @@ -16,7 +16,11 @@ import { addQueryArgs } from '@wordpress/url'; */ import { siteEditor } from '../../experimental-features'; -const { visit: visitSiteEditor, getEditedPostContent } = siteEditor; +const { + visit: visitSiteEditor, + getEditedPostContent, + disableWelcomeGuide, +} = siteEditor; const assertSaveButtonIsDisabled = () => page.waitForSelector( @@ -97,6 +101,7 @@ describe( 'Template Revert', () => { beforeEach( async () => { await trashAllPosts( 'wp_template' ); await visitSiteEditor(); + await disableWelcomeGuide(); } ); it( 'should delete the template after saving the reverted template', async () => {