2026-10-04 23:24:48 +00:00
|
|
|
import { defineConfig, devices } from '@playwright/test';
|
2026-10-14 17:28:33 -07:00
|
|
|
// By default the spec runs against the built app on vite preview. ORGCHAIN_URL points it at a deployed copy instead;
|
|
|
|
|
// PW_CHANNEL=chrome uses the installed Chrome; PW_ARGS passes extra browser flags as a JSON array.
|
|
|
|
|
const url = process.env.ORGCHAIN_URL, channel = process.env.PW_CHANNEL ? { channel: process.env.PW_CHANNEL } : {};
|
|
|
|
|
const launchOptions = { args: JSON.parse(process.env.PW_ARGS || '[]') };
|
2026-10-04 23:24:48 +00:00
|
|
|
export default defineConfig({
|
2026-10-14 17:28:33 -07:00
|
|
|
testDir: './tests', testMatch: '**/*.spec.js', fullyParallel: false, workers: 1, timeout: 60_000,
|
|
|
|
|
use: { baseURL: url ?? 'http://127.0.0.1:4178/', trace: 'retain-on-failure' },
|
|
|
|
|
projects: [
|
|
|
|
|
{ name: 'desktop', use: { ...devices['Desktop Chrome'], ...channel, launchOptions } },
|
|
|
|
|
{ name: 'mobile', use: { ...devices['Pixel 7'], ...channel, launchOptions } },
|
|
|
|
|
],
|
|
|
|
|
webServer: url ? undefined : { command: 'npx vite preview --host 127.0.0.1 --port 4178 --strictPort', url: 'http://127.0.0.1:4178/', reuseExistingServer: false },
|
2026-10-04 23:24:48 +00:00
|
|
|
});
|