From 61f0c980cc5c0bc9d1168141905c4bc5d6cf031c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E7=BF=94?= Date: Fri, 20 Mar 2026 07:55:29 +0800 Subject: [PATCH] fix: optimize playwright config with increased timeouts and retries --- novalon-manage-web/playwright.config.ts | 30 ++++++++++++++++++------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/novalon-manage-web/playwright.config.ts b/novalon-manage-web/playwright.config.ts index f1eab10..7cf7b99 100644 --- a/novalon-manage-web/playwright.config.ts +++ b/novalon-manage-web/playwright.config.ts @@ -2,21 +2,28 @@ import { defineConfig, devices } from '@playwright/test'; export default defineConfig({ testDir: './e2e', - fullyParallel: true, + fullyParallel: false, forbidOnly: !!process.env.CI, - retries: process.env.CI ? 2 : 0, - workers: process.env.CI ? 1 : undefined, + retries: process.env.CI ? 2 : 1, + workers: process.env.CI ? 1 : 1, reporter: [ - ['html'], - ['junit', { outputFile: 'test-results/junit.xml' }], + ['html', { outputFolder: 'playwright-report' }], + ['json', { outputFile: 'test-results/results.json' }], ['list'] ], + + timeout: 60000, + expect: { + timeout: 10000 + }, + use: { - baseURL: 'http://localhost:4173', + baseURL: 'http://localhost:5173', trace: 'on-first-retry', screenshot: 'only-on-failure', video: 'retain-on-failure', - headless: true, + actionTimeout: 15000, + navigationTimeout: 30000, }, projects: [ @@ -25,4 +32,11 @@ export default defineConfig({ use: { ...devices['Desktop Chrome'] }, }, ], -}); \ No newline at end of file + + webServer: { + command: 'npm run dev', + url: 'http://localhost:5173', + reuseExistingServer: !process.env.CI, + timeout: 120000, + }, +});