2024-05-21 20:48:35 +02:00
|
|
|
import { defineConfig, devices } from '@playwright/test';
|
|
|
|
|
|
|
|
|
|
export default defineConfig({
|
|
|
|
|
testDir: './tests',
|
2024-12-05 17:30:21 +01:00
|
|
|
fullyParallel: !!process.env.CI,
|
2024-05-21 20:48:35 +02:00
|
|
|
forbidOnly: !!process.env.CI,
|
2025-04-16 21:56:52 +02:00
|
|
|
retries: process.env.CI ? 3 : 0,
|
2025-05-05 22:35:05 +02:00
|
|
|
workers: process.env.CI ? 6 : undefined,
|
2024-05-21 20:48:35 +02:00
|
|
|
snapshotPathTemplate: './tests/screenshots{/projectName}/{testFilePath}/{arg}{ext}',
|
|
|
|
|
outputDir: './tests/test-results',
|
2024-07-09 17:13:07 +02:00
|
|
|
reporter: [[process.env.CI ? 'blob' : 'html', { outputFolder: './tests/playwright-report' }]],
|
2024-12-05 17:30:21 +01:00
|
|
|
globalTimeout: 800_000,
|
|
|
|
|
timeout: 800_000,
|
2024-05-21 20:48:35 +02:00
|
|
|
use: {
|
2025-05-05 22:35:05 +02:00
|
|
|
baseURL: 'http://localhost:3335',
|
2024-05-21 20:48:35 +02:00
|
|
|
trace: 'on-first-retry',
|
|
|
|
|
video: 'on',
|
|
|
|
|
testIdAttribute: 'data-cy',
|
2024-12-05 17:30:21 +01:00
|
|
|
actionTimeout: 10_000,
|
2024-05-21 20:48:35 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
projects: [
|
|
|
|
|
{
|
|
|
|
|
name: 'chromium',
|
|
|
|
|
use: { ...devices['Desktop Chrome'], deviceScaleFactor: 1 },
|
|
|
|
|
},
|
|
|
|
|
// TODO: Fix firefox tests
|
|
|
|
|
// {
|
|
|
|
|
// name: 'firefox',
|
|
|
|
|
// use: { ...devices['Desktop Firefox'], deviceScaleFactor: 1 },
|
|
|
|
|
// },
|
|
|
|
|
// This is commented out until SharedArrayBuffer is enabled in WebKit
|
|
|
|
|
// See: https://github.com/microsoft/playwright/issues/14043
|
|
|
|
|
|
|
|
|
|
//{
|
|
|
|
|
// name: 'webkit',
|
|
|
|
|
// use: { ...devices['Desktop Safari'], deviceScaleFactor: 1 },
|
|
|
|
|
//},
|
|
|
|
|
],
|
|
|
|
|
webServer: {
|
2025-05-05 22:35:05 +02:00
|
|
|
command: 'cross-env APP_CONFIG=config/e2e.js COVERAGE=true OHIF_PORT=3335 nyc yarn start',
|
|
|
|
|
url: 'http://localhost:3335',
|
2024-05-21 20:48:35 +02:00
|
|
|
reuseExistingServer: !process.env.CI,
|
2024-12-05 17:30:21 +01:00
|
|
|
timeout: 360_000,
|
2024-05-21 20:48:35 +02:00
|
|
|
},
|
|
|
|
|
});
|