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, }, }, }, ], })