diff --git a/packages/e2e-tests/config/setup-performance-test.js b/packages/e2e-tests/config/setup-performance-test.js index 2c349605026937..384a88b8a3f2d3 100644 --- a/packages/e2e-tests/config/setup-performance-test.js +++ b/packages/e2e-tests/config/setup-performance-test.js @@ -35,19 +35,17 @@ beforeAll( async () => { await trashAllPosts(); await trashAllPosts( 'wp_block' ); await clearLocalStorage(); + await setupPage(); await activatePlugin( 'gutenberg-test-plugin-disables-the-css-animations' ); } ); -beforeEach( async () => { - // Close the previous page entirely and create a new page, so that the test +afterEach( async () => { + // Clear localStorage between tests so that the next test starts clean. + await clearLocalStorage(); + // Close the previous page entirely and create a new page, so that the next test // isn't affected by page unload work. await page.close(); page = await browser.newPage(); // Set up testing config on new page. await setupPage(); } ); - -afterEach( async () => { - // Clear localStorage between tests so that the next test starts clean. - await clearLocalStorage(); -} );