/* Copyright (C) 2025 QuantumNous This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . For commercial licensing, please contact support@quantumnous.com */ import { defineConfig, devices } from '@playwright/test'; const baseURL = process.env.PLAYWRIGHT_BASE_URL || 'http://127.0.0.1:4175'; export default defineConfig({ testDir: './e2e', testMatch: '**/*.spec.js', fullyParallel: false, forbidOnly: Boolean(process.env.CI), retries: 0, workers: 1, timeout: 45000, expect: { timeout: 10000 }, reporter: [ ['list'], ['html', { outputFolder: 'playwright-report', open: 'never' }], ], outputDir: 'test-results', use: { baseURL, locale: 'zh-CN', timezoneId: 'Asia/Shanghai', trace: 'retain-on-failure', screenshot: 'only-on-failure', video: 'off', serviceWorkers: 'block', }, projects: [ { name: 'chrome', use: { ...devices['Desktop Chrome'], channel: 'chrome' }, }, { name: 'mobile-chrome', use: { ...devices['Pixel 5'], channel: 'chrome' }, }, ], webServer: process.env.PLAYWRIGHT_BASE_URL ? undefined : { command: 'npm run dev -- --host 127.0.0.1 --port 4175 --strictPort', url: baseURL, reuseExistingServer: !process.env.CI, timeout: 120000, env: { VITE_REACT_APP_SERVER_URL: '' }, }, });