-
Notifications
You must be signed in to change notification settings - Fork 69
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
69 lines (63 loc) · 1.71 KB
/
playwright.config.ts
File metadata and controls
69 lines (63 loc) · 1.71 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
import {
defineConfig,
devices,
type ReporterDescription,
} from '@playwright/test';
import 'dotenv/config';
const reporters: ReporterDescription[] = [['html']];
if (!process.env.CI) {
reporters.push(['list']);
}
if (process.env.CI) {
reporters.push(['json', { outputFile: 'test-results.json' }]);
}
if (process.env.CURRENTS_PROJECT_ID && process.env.CURRENTS_RECORD_KEY) {
reporters.push(['@currents/playwright']);
}
export default defineConfig({
testDir: 'playwright',
fullyParallel: true,
workers: 4,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 1 : 0,
reporter: reporters,
globalTimeout: 89.5 * 60 * 1000, // 1h29.5m, Set because of codebuild, we want PW to timeout before CB to get the results.
timeout: 3 * 60 * 1000, // 3m
expect: { timeout: 50_000 }, // 50s
use: {
actionTimeout: 30_000, // 30s
navigationTimeout: 30_000, // 30s
headless: true,
baseURL: process.env.BASE_URL
? process.env.BASE_URL
: 'http://127.0.0.1:9090',
video: 'retain-on-failure',
trace: 'on',
ignoreHTTPSErrors: true,
},
projects: [
{ name: 'Setup', testMatch: /.*\.setup\.ts/ },
{
name: 'UI tests',
timeout: 29.5 * 60 * 1000, // 29.5m
use: {
...devices['Desktop Chrome'],
storageState: '.auth/user.json',
},
dependencies: ['Setup'],
},
{
name: 'Boot tests',
testMatch: /.*\.boot\.ts/,
// Retry 2 times because it's still cheaper than
// rerunning the whole job
retries: process.env.CI ? 2 : 0,
timeout: 89.5 * 60 * 1000, // 1h29.5m
use: {
...devices['Desktop Chrome'],
storageState: '.auth/user.json',
},
dependencies: ['Setup'],
}
],
});