// @ts-check import { defineConfig, devices } from '@playwright/test'; import config from './env.config'; /** * @see https://playwright.nodejs.cn/docs/test-configuration // 中文 */ export default defineConfig({ testDir: './files', // 测试文件目录 testMatch: config.testMatch, // 测试文件匹配模式 fullyParallel: true, forbidOnly: !!process.env.CI, retries: process.env.CI ? 2 : 0, // 重试次数 workers: process.env.CI ? 1 : undefined, reporter: 'html', use: { baseURL: process.env.BASE_URL, trace: 'on-first-retry', }, projects: [ { name: 'chromium', use: { ...devices['Desktop Chrome'] }, }, // { // name: 'firefox', // use: { ...devices['Desktop Firefox'] }, // }, // { // name: 'webkit', // use: { ...devices['Desktop Safari'] }, // }, ], });