test(visual): allow playwright port override and rebaseline connections-mobile

Add PLAYWRIGHT_PORT env var to playwright.config.js so a worktree can run
its own dev server on a different port without disrupting the main dev
server. Rebaseline connections-mobile-auth which had drifted from the
suggestions data state captured during Phase 1.
This commit is contained in:
Jennie Robinson Faber 2026-04-08 16:03:48 +01:00
parent 127d2974c8
commit e260ed5b37
2 changed files with 6 additions and 3 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 129 KiB

After

Width:  |  Height:  |  Size: 135 KiB

Before After
Before After

View file

@ -1,5 +1,8 @@
import { defineConfig } from "@playwright/test";
const PORT = process.env.PLAYWRIGHT_PORT || "3000";
const BASE_URL = `http://localhost:${PORT}`;
export default defineConfig({
testDir: "./e2e",
outputDir: "e2e/test-results",
@ -11,7 +14,7 @@ export default defineConfig({
reporter: "html",
timeout: 60000,
use: {
baseURL: "http://localhost:3000",
baseURL: BASE_URL,
trace: "on-first-retry",
navigationTimeout: 45000,
},
@ -22,8 +25,8 @@ export default defineConfig({
},
],
webServer: {
command: "npm run build && NODE_ENV=development npm run preview",
url: "http://localhost:3000",
command: `PORT=${PORT} npm run build && PORT=${PORT} NODE_ENV=development npm run preview`,
url: BASE_URL,
reuseExistingServer: !process.env.CI,
env: {
NUXT_PUBLIC_COMING_SOON: "false",