From 9baf3232910692e9f38ab9e0fe31218b92982d0c Mon Sep 17 00:00:00 2001 From: Mukesh Panchal Date: Mon, 20 Jan 2025 10:07:24 +0530 Subject: [PATCH 1/7] Update reusable-performance.yml --- .github/workflows/reusable-performance.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/reusable-performance.yml b/.github/workflows/reusable-performance.yml index f75cb6b3e4969..712c9b438beb4 100644 --- a/.github/workflows/reusable-performance.yml +++ b/.github/workflows/reusable-performance.yml @@ -147,7 +147,7 @@ jobs: run: npm ci - name: Install Playwright browsers - run: npx playwright install --with-deps chromium + run: npx playwright install --with-deps - name: Build WordPress run: npm run build From 12fb433c1595588d664ae73c1d65133856132f05 Mon Sep 17 00:00:00 2001 From: Mukesh Panchal Date: Mon, 20 Jan 2025 10:43:41 +0530 Subject: [PATCH 2/7] Use only Chromium browser --- tests/performance/playwright.config.js | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/performance/playwright.config.js b/tests/performance/playwright.config.js index c4df0e2872953..1ec06f053edb4 100644 --- a/tests/performance/playwright.config.js +++ b/tests/performance/playwright.config.js @@ -31,6 +31,7 @@ const config = defineConfig( { webServer: { ...baseConfig.webServer, command: 'npm run env:start', + browserName: 'chromium', // Use only Chromium. }, use: { ...baseConfig.use, From 0022bd85783ebfe13fccd25e2d2e1ae715eb9e01 Mon Sep 17 00:00:00 2001 From: Mukesh Panchal Date: Mon, 20 Jan 2025 10:57:35 +0530 Subject: [PATCH 3/7] Update playwright.config.js --- tests/performance/playwright.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/performance/playwright.config.js b/tests/performance/playwright.config.js index 1ec06f053edb4..c806388e5a695 100644 --- a/tests/performance/playwright.config.js +++ b/tests/performance/playwright.config.js @@ -31,11 +31,11 @@ const config = defineConfig( { webServer: { ...baseConfig.webServer, command: 'npm run env:start', - browserName: 'chromium', // Use only Chromium. }, use: { ...baseConfig.use, video: 'off', + browserName: 'chromium', // Use only Chromium. }, } ); From 3bfc95487516644262377f0bf9b9b424fdf1cf1b Mon Sep 17 00:00:00 2001 From: Mukesh Panchal Date: Mon, 20 Jan 2025 11:04:53 +0530 Subject: [PATCH 4/7] Apply suggestions from code review --- .github/workflows/reusable-performance.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/reusable-performance.yml b/.github/workflows/reusable-performance.yml index 712c9b438beb4..f75cb6b3e4969 100644 --- a/.github/workflows/reusable-performance.yml +++ b/.github/workflows/reusable-performance.yml @@ -147,7 +147,7 @@ jobs: run: npm ci - name: Install Playwright browsers - run: npx playwright install --with-deps + run: npx playwright install --with-deps chromium - name: Build WordPress run: npm run build From 48ec74456652bfc96f3b58f93569ad975b2500b8 Mon Sep 17 00:00:00 2001 From: Mukesh Panchal Date: Mon, 20 Jan 2025 11:13:47 +0530 Subject: [PATCH 5/7] Update playwright.config.js --- tests/performance/playwright.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/performance/playwright.config.js b/tests/performance/playwright.config.js index c806388e5a695..4f48ea68966a9 100644 --- a/tests/performance/playwright.config.js +++ b/tests/performance/playwright.config.js @@ -7,7 +7,7 @@ import { defineConfig } from '@playwright/test'; /** * WordPress dependencies */ -import baseConfig from '@wordpress/scripts/config/playwright.config'; +const baseConfig = require( '@wordpress/scripts/config/playwright.config' ); process.env.WP_ARTIFACTS_PATH ??= path.join( process.cwd(), 'artifacts' ); process.env.STORAGE_STATE_PATH ??= path.join( From 62c5f9b107a7a1744cfe3d3b3df9d607ee262991 Mon Sep 17 00:00:00 2001 From: Mukesh Panchal Date: Mon, 20 Jan 2025 11:35:58 +0530 Subject: [PATCH 6/7] Update playwright.config.js --- tests/performance/playwright.config.js | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/performance/playwright.config.js b/tests/performance/playwright.config.js index 4f48ea68966a9..100521f642489 100644 --- a/tests/performance/playwright.config.js +++ b/tests/performance/playwright.config.js @@ -33,7 +33,6 @@ const config = defineConfig( { command: 'npm run env:start', }, use: { - ...baseConfig.use, video: 'off', browserName: 'chromium', // Use only Chromium. }, From c64b360a5a2698d8b8200c71ffa56e5e85643bbb Mon Sep 17 00:00:00 2001 From: Mukesh Panchal Date: Mon, 20 Jan 2025 11:50:49 +0530 Subject: [PATCH 7/7] Update global-setup.js --- tests/performance/config/global-setup.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/performance/config/global-setup.js b/tests/performance/config/global-setup.js index 25e99a47d8457..0c8063cf1a5a5 100644 --- a/tests/performance/config/global-setup.js +++ b/tests/performance/config/global-setup.js @@ -30,7 +30,12 @@ async function globalSetup( config ) { await requestUtils.setupRest(); // Reset the test environment before running the tests. - await Promise.all( [ requestUtils.activateTheme( 'twentytwentyone' ) ] ); + await Promise.all( [ + requestUtils.activateTheme( 'twentytwentyone' ), + requestUtils.deleteAllPosts(), + requestUtils.deleteAllBlocks(), + requestUtils.resetPreferences(), + ] ); await requestContext.dispose(); }