Gitako/playwright.config.mts
2026-01-17 22:39:40 +08:00

45 lines
1 KiB
TypeScript

import { defineConfig, devices } from '@playwright/test'
import * as dotenv from 'dotenv'
import * as path from 'path'
import { fileURLToPath } from 'url'
if (process.arch === 'arm64' && process.platform === 'darwin') {
dotenv.config()
}
const __dirname = path.dirname(fileURLToPath(import.meta.url))
const EXTENSION_PATH = path.resolve(__dirname, 'dist')
export default defineConfig({
testDir: './e2e',
fullyParallel: true,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 3 : 0,
workers: process.env.CI ? 2 : undefined,
reporter: 'html',
timeout: 60000,
expect: {
timeout: 10000,
},
use: {
trace: 'on-first-retry',
video: 'on-first-retry',
},
projects: [
{
name: 'chromium',
use: {
...devices['Desktop Chrome'],
// Load the extension
launchOptions: {
args: [
`--no-sandbox`,
`--disable-extensions-except=${EXTENSION_PATH}`,
`--load-extension=${EXTENSION_PATH}`,
],
headless: false,
},
},
},
],
})