36 lines
1.2 KiB
JavaScript
36 lines
1.2 KiB
JavaScript
import { defineConfig, devices } from '@playwright/test';
|
|
import fs from 'node:fs';
|
|
|
|
const baseURL = process.env.OIKOS_E2E_BASE_URL || 'https://home.friborg.uk';
|
|
const keepArtifacts = process.env.OIKOS_E2E_ARTIFACTS === '1';
|
|
const systemChromium = process.env.PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH
|
|
|| (fs.existsSync('/usr/bin/chromium-browser') ? '/usr/bin/chromium-browser' : undefined)
|
|
|| (fs.existsSync('/snap/bin/chromium') ? '/snap/bin/chromium' : undefined);
|
|
|
|
export default defineConfig({
|
|
testDir: './tests/e2e',
|
|
timeout: 90_000,
|
|
expect: { timeout: 15_000 },
|
|
fullyParallel: false,
|
|
retries: process.env.CI ? 1 : 0,
|
|
reporter: [['list'], ['html', { outputFolder: 'playwright-report', open: 'never' }]],
|
|
use: {
|
|
baseURL,
|
|
trace: keepArtifacts ? 'retain-on-failure' : 'off',
|
|
screenshot: keepArtifacts ? 'only-on-failure' : 'off',
|
|
video: keepArtifacts ? 'retain-on-failure' : 'off',
|
|
ignoreHTTPSErrors: true,
|
|
actionTimeout: 15_000,
|
|
navigationTimeout: 30_000,
|
|
},
|
|
projects: [
|
|
{
|
|
name: 'chromium-desktop',
|
|
use: {
|
|
...devices['Desktop Chrome'],
|
|
launchOptions: systemChromium ? { executablePath: systemChromium } : undefined,
|
|
},
|
|
},
|
|
],
|
|
});
|