Commit 6fa5e868b76 for woocommerce
commit 6fa5e868b763c41b9dd15f504aabd7811824b0fb
Author: Adrian Moldovan <3854374+adimoldovan@users.noreply.github.com>
Date: Thu Jul 23 14:58:53 2026 +0300
Replace the stale WP_ENV_TESTS_PORT with WP_ENV_PORT in test suites (#66829)
diff --git a/plugins/woocommerce/changelog/task-remove-the-stale-wp-env-tests-port b/plugins/woocommerce/changelog/task-remove-the-stale-wp-env-tests-port
new file mode 100644
index 00000000000..2ef908402a3
--- /dev/null
+++ b/plugins/woocommerce/changelog/task-remove-the-stale-wp-env-tests-port
@@ -0,0 +1,4 @@
+Significance: patch
+Type: dev
+
+Replace the stale WP_ENV_TESTS_PORT override with WP_ENV_PORT in the E2E, metrics and k6 test configs.
diff --git a/plugins/woocommerce/tests/e2e/playwright.config.ts b/plugins/woocommerce/tests/e2e/playwright.config.ts
index ca30e656ab4..cf3e604a7b4 100644
--- a/plugins/woocommerce/tests/e2e/playwright.config.ts
+++ b/plugins/woocommerce/tests/e2e/playwright.config.ts
@@ -14,7 +14,7 @@ dotenv.config( { path: __dirname + '/.env' } );
if ( ! process.env.BASE_URL ) {
process.env.BASE_URL =
- 'http://localhost:' + ( process.env.WP_ENV_TESTS_PORT || '8086' );
+ 'http://localhost:' + ( process.env.WP_ENV_PORT || '8086' );
console.log(
'BASE_URL is not set. Using default: ' + process.env.BASE_URL
);
diff --git a/plugins/woocommerce/tests/e2e/tests/blocks/product-collection/product-collection.block_theme.spec.ts b/plugins/woocommerce/tests/e2e/tests/blocks/product-collection/product-collection.block_theme.spec.ts
index 83d73aee78f..2db05a89819 100644
--- a/plugins/woocommerce/tests/e2e/tests/blocks/product-collection/product-collection.block_theme.spec.ts
+++ b/plugins/woocommerce/tests/e2e/tests/blocks/product-collection/product-collection.block_theme.spec.ts
@@ -6,6 +6,7 @@ import {
test as base,
expect,
wpCLI,
+ BASE_URL,
BLOCK_THEME_SLUG,
} from '@woocommerce/e2e-utils';
@@ -455,9 +456,7 @@ test.describe( 'Product Collection', () => {
await page
.getByRole( 'option', {
- name: `Cap http://localhost:${
- process.env.WP_ENV_TESTS_PORT || '8086'
- }/product/cap/`,
+ name: `Cap ${ BASE_URL }/product/cap/`,
} )
.click();
await page
diff --git a/plugins/woocommerce/tests/e2e/utils/blocks/constants.ts b/plugins/woocommerce/tests/e2e/utils/blocks/constants.ts
index 927cb74d644..e9fcc2bf441 100644
--- a/plugins/woocommerce/tests/e2e/utils/blocks/constants.ts
+++ b/plugins/woocommerce/tests/e2e/utils/blocks/constants.ts
@@ -19,7 +19,7 @@ export const CLASSIC_CHILD_THEME_WITH_BLOCK_TEMPLATE_PARTS_SLUG = `${ CLASSIC_TH
export const CLASSIC_CHILD_THEME_WITH_BLOCK_TEMPLATE_PARTS_SUPPORT_SLUG = `${ CLASSIC_THEME_SLUG }-child__with-block-template-part-support`;
export const BASE_URL =
process.env.BASE_URL ||
- 'http://localhost:' + ( process.env.WP_ENV_TESTS_PORT || '8086' );
+ 'http://localhost:' + ( process.env.WP_ENV_PORT || '8086' );
export const WP_ARTIFACTS_PATH =
process.env.WP_ARTIFACTS_PATH ||
diff --git a/plugins/woocommerce/tests/metrics/playwright.config.js b/plugins/woocommerce/tests/metrics/playwright.config.js
index d56eeda85a2..2254065a989 100644
--- a/plugins/woocommerce/tests/metrics/playwright.config.js
+++ b/plugins/woocommerce/tests/metrics/playwright.config.js
@@ -12,7 +12,7 @@ process.env.STORAGE_STATE_PATH ??= path.join(
'storage-states/admin.json'
);
process.env.WP_BASE_URL ??=
- 'http://localhost:' + ( process.env.WP_ENV_TESTS_PORT || '8086' );
+ 'http://localhost:' + ( process.env.WP_ENV_PORT || '8086' );
const config = defineConfig( {
reporter: [ [ 'list' ], [ './config/performance-reporter.ts' ] ],
@@ -31,7 +31,7 @@ const config = defineConfig( {
new URL( './config/global-setup.ts', 'file:' + __filename ).href
),
use: {
- baseURL: process.env.WP_BASE_URL || 'http://localhost:8086',
+ baseURL: process.env.WP_BASE_URL,
headless: true,
viewport: {
width: 960,
diff --git a/plugins/woocommerce/tests/performance/config.js b/plugins/woocommerce/tests/performance/config.js
index a927883108e..6edaff454ce 100644
--- a/plugins/woocommerce/tests/performance/config.js
+++ b/plugins/woocommerce/tests/performance/config.js
@@ -1,8 +1,8 @@
/* eslint-disable no-undef */
export const base_url =
- __ENV.URL || 'http://localhost:' + ( __ENV.WP_ENV_TESTS_PORT || '8086' );
+ __ENV.URL || 'http://localhost:' + ( __ENV.WP_ENV_PORT || '8086' );
export const base_host =
- __ENV.HOST || 'localhost:' + ( __ENV.WP_ENV_TESTS_PORT || '8086' );
+ __ENV.HOST || 'localhost:' + ( __ENV.WP_ENV_PORT || '8086' );
export const STORE_NAME = __ENV.STORE_NAME || 'WooCommerce Core E2E Test Suite';
export const FOOTER_TEXT = 'Built with WooCommerce';