diff --git a/packages/e2e-test-utils-playwright/src/test.ts b/packages/e2e-test-utils-playwright/src/test.ts index 894abf93dcd02e..eec8e4e279c0ff 100644 --- a/packages/e2e-test-utils-playwright/src/test.ts +++ b/packages/e2e-test-utils-playwright/src/test.ts @@ -136,18 +136,6 @@ const test = base.extend< storageStatePath: STORAGE_STATE_PATH, } ); - await Promise.all( [ - requestUtils.activateTheme( 'twentytwentyone' ), - // Disable this test plugin as it's conflicting with some of the tests. - // We already have reduced motion enabled and Playwright will wait for most of the animations anyway. - requestUtils.deactivatePlugin( - 'gutenberg-test-plugin-disables-the-css-animations' - ), - requestUtils.deleteAllPosts(), - requestUtils.deleteAllBlocks(), - requestUtils.resetPreferences(), - ] ); - await use( requestUtils ); }, { scope: 'worker', auto: true }, diff --git a/test/e2e/config/global-setup.ts b/test/e2e/config/global-setup.ts index 10f2822fdfe1ae..787488ac72fcab 100644 --- a/test/e2e/config/global-setup.ts +++ b/test/e2e/config/global-setup.ts @@ -25,6 +25,19 @@ async function globalSetup( config: FullConfig ) { // Authenticate and save the storageState to disk. await requestUtils.setupRest(); + // Reset the test environment before running the tests. + await Promise.all( [ + requestUtils.activateTheme( 'twentytwentyone' ), + // Disable this test plugin as it's conflicting with some of the tests. + // We already have reduced motion enabled and Playwright will wait for most of the animations anyway. + requestUtils.deactivatePlugin( + 'gutenberg-test-plugin-disables-the-css-animations' + ), + requestUtils.deleteAllPosts(), + requestUtils.deleteAllBlocks(), + requestUtils.resetPreferences(), + ] ); + await requestContext.dispose(); } diff --git a/test/performance/config/global-setup.ts b/test/performance/config/global-setup.ts index 10f2822fdfe1ae..787488ac72fcab 100644 --- a/test/performance/config/global-setup.ts +++ b/test/performance/config/global-setup.ts @@ -25,6 +25,19 @@ async function globalSetup( config: FullConfig ) { // Authenticate and save the storageState to disk. await requestUtils.setupRest(); + // Reset the test environment before running the tests. + await Promise.all( [ + requestUtils.activateTheme( 'twentytwentyone' ), + // Disable this test plugin as it's conflicting with some of the tests. + // We already have reduced motion enabled and Playwright will wait for most of the animations anyway. + requestUtils.deactivatePlugin( + 'gutenberg-test-plugin-disables-the-css-animations' + ), + requestUtils.deleteAllPosts(), + requestUtils.deleteAllBlocks(), + requestUtils.resetPreferences(), + ] ); + await requestContext.dispose(); }