-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
52 lines (50 loc) · 1.7 KB
/
Copy pathplaywright.config.ts
File metadata and controls
52 lines (50 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import { defineConfig, devices } from '@playwright/test';
import * as settings from './config/settings';
/**
* Environment (stage1/stage2/stage3/stage4/test/test4/prod) is selected via the
* TEST_ENV env var and resolved in config/settings.ts. Browser is selected via the
* `--project` CLI flag (chromium | firefox | edge), e.g.:
*
* TEST_ENV=test4 npx playwright test --project=firefox
*/
export default defineConfig({
testDir: './tests',
fullyParallel: true,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
workers: process.env.CI ? 2 : 4,
reporter: [['list'], ['html', { open: 'never' }]],
// Must stay comfortably above the largest individual wait below (navigationTimeout,
// 45s) - otherwise a single slow-but-legitimate navigation/assertion can exhaust the
// whole test budget before its own, more specific timeout gets a chance to fire,
// so failures surface as an opaque global timeout (plus a cascading
// "Target page, context or browser has been closed" from the mid-flight kill)
// instead of a clear "element X never appeared" error.
timeout: settings.LONG_TIMEOUT_MS,
expect: {
timeout: settings.TIMEOUT_MS,
},
use: {
baseURL: settings.OSF_HOME,
headless: settings.HEADLESS,
trace: 'retain-on-failure',
screenshot: 'only-on-failure',
video: 'retain-on-failure',
actionTimeout: settings.TIMEOUT_MS,
navigationTimeout: settings.LONG_TIMEOUT_MS,
},
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
},
{
name: 'firefox',
use: { ...devices['Desktop Firefox'] },
},
{
name: 'edge',
use: { ...devices['Desktop Edge'], channel: 'msedge' },
},
],
});