From f79cef0daa320f2d9dc6cefa9deba6ea7a2e43c2 Mon Sep 17 00:00:00 2001 From: wttwins Date: Wed, 17 Dec 2025 19:46:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3E2E=E7=94=A8=E4=BE=8Bgithub?= =?UTF-8?q?=20runner=E6=89=A7=E8=A1=8C=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- e2e/auth-flow.spec.ts | 8 ++++---- playwright.config.ts | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/e2e/auth-flow.spec.ts b/e2e/auth-flow.spec.ts index 6a3e3aa7..bab3ede0 100644 --- a/e2e/auth-flow.spec.ts +++ b/e2e/auth-flow.spec.ts @@ -47,14 +47,14 @@ test.describe('Authentication Flow', () => { if (await errorLocator.isVisible()) { console.log('Registration error visible, going to login.'); - await page.goto('http://localhost:3000/login'); + await page.goto('/login'); } } catch (e) { if (page.url().includes('/login')) { console.log('Redirected to login page automatically.'); } else { console.log('State unclear, forcing login.'); - await page.goto('http://localhost:3000/login'); + await page.goto('/login'); } } @@ -69,7 +69,7 @@ test.describe('Authentication Flow', () => { // --- Verify Success --- // Wait for redirect to home - await page.waitForURL('http://localhost:3000/', { timeout: 10000 }); + await page.waitForURL('/', { timeout: 10000 }); // Verify Content // The dashboard shows "Welcome back, wttwins". @@ -87,7 +87,7 @@ test.describe('Authentication Flow', () => { await page.locator('button[type="submit"]').click(); // Verify Admin Login and Home Page - await page.waitForURL('http://localhost:3000/'); + await page.waitForURL('/'); // --- Go to Settings > User Management --- // Open Settings (Button with gear icon, sr-only text "Settings" or "设置") diff --git a/playwright.config.ts b/playwright.config.ts index 4ee2b453..773d547e 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -12,7 +12,7 @@ export default defineConfig({ trace: 'on-first-retry', }, webServer: { - command: process.env.CI ? 'npm run start' : 'npm run dev', + command: process.env.CI ? 'node .next/standalone/server.js' : 'npm run dev', url: 'http://127.0.0.1:3000', reuseExistingServer: !process.env.CI, timeout: 120 * 1000,