Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move request utils reset to global setup #52412

Merged
merged 1 commit into from
Jul 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions packages/e2e-test-utils-playwright/src/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
Expand Down
13 changes: 13 additions & 0 deletions test/e2e/config/global-setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down
13 changes: 13 additions & 0 deletions test/performance/config/global-setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down
Loading