mirror of
https://github.com/margrop/wrong-notebook.git
synced 2026-12-02 07:50:00 +08:00
修正E2E用例github runner执行失败
This commit is contained in:
@@ -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 "设置")
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user