From 11aed6042ba4c35ee4bcd244af2992993cbe5664 Mon Sep 17 00:00:00 2001 From: Filip Ilic Date: Thu, 26 Nov 2026 14:45:43 +0100 Subject: [PATCH] Use 127.0.0.1 for the Playground E2E base URL so the login doesn't wait 30 seconds WordPress inside Playground uses 127.0.0.1:8080 as its address. The tests used localhost:8080, so when the first wp-admin request wasn't auto-logged in yet, WordPress redirected to wp-login.php on 127.0.0.1, the password login landed on 127.0.0.1/wp-admin, and global-setup waited the full 30 s for a localhost URL before retrying. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_0171WwmmGiPVRHC4CaxL76gc --- playwright.config.ts | 4 ++-- tests/e2e/api/tasks.api.ts | 2 +- tests/e2e/global-setup.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/playwright.config.ts b/playwright.config.ts index a85d66106..798c1e454 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -4,7 +4,7 @@ import dotenv from 'dotenv'; // Load environment variables dotenv.config(); -const baseURL = process.env.WORDPRESS_URL || 'http://localhost:8080'; +const baseURL = process.env.WORDPRESS_URL || 'http://127.0.0.1:8080'; export default defineConfig({ testDir: './tests/e2e/specs', @@ -98,7 +98,7 @@ export default defineConfig({ // Run WP Playground server before starting the tests webServer: { command: 'npx @wp-playground/cli server --mount=.:/wordpress/wp-content/plugins/progress-planner --blueprint=tests/e2e/blueprint.json --port=8080', - url: 'http://localhost:8080', + url: 'http://127.0.0.1:8080', // Always reuse if server is already running (needed for Yoast tests which use Docker WordPress) reuseExistingServer: true, timeout: 120 * 1000, diff --git a/tests/e2e/api/tasks.api.ts b/tests/e2e/api/tasks.api.ts index 08d06440e..760440358 100644 --- a/tests/e2e/api/tasks.api.ts +++ b/tests/e2e/api/tasks.api.ts @@ -20,7 +20,7 @@ export class TasksApi { constructor( page: Page, request: APIRequestContext ) { this.page = page; this.request = request; - this.baseUrl = process.env.WORDPRESS_URL || 'http://localhost:8080'; + this.baseUrl = process.env.WORDPRESS_URL || 'http://127.0.0.1:8080'; } /** diff --git a/tests/e2e/global-setup.ts b/tests/e2e/global-setup.ts index 0542b1c7d..784e5ce07 100644 --- a/tests/e2e/global-setup.ts +++ b/tests/e2e/global-setup.ts @@ -24,7 +24,7 @@ async function globalSetup(config: FullConfig): Promise { console.log('Generating fresh auth.json...'); - const baseURL = process.env.WORDPRESS_URL || 'http://localhost:8080'; + const baseURL = process.env.WORDPRESS_URL || 'http://127.0.0.1:8080'; const browser = await chromium.launch(); const context = await browser.newContext({ ignoreHTTPSErrors: true,