Repository navigation
Expand file tree
/
Copy pathplaywright.config.js
More file actions
81 lines (74 loc) · 1.78 KB
/
Copy pathplaywright.config.js
File metadata and controls
81 lines (74 loc) · 1.78 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
70
71
72
73
74
75
76
77
78
79
80
81
import { defineConfig, devices } from '@playwright/test';
import 'dotenv/config';
const isCI = !!process.env.CI;
const setupProject = {
name: 'setup',
testMatch: /auth\.setup\.ts/,
};
const adminProject = {
name: 'chromium',
testIgnore: /\/rbac\//,
use: {
...devices['Desktop Chrome'],
storageState: '.auth/admin_user.json',
},
dependencies: ['setup'],
};
const viewerCredsPresent = !!(
(process.env.PLAYWRIGHT_VIEWER_USER ||
process.env.RBAC_VIEWER_ROLE_ACCESS_USER) &&
(process.env.PLAYWRIGHT_VIEWER_PASSWORD || process.env.RBAC_PASSWORD_STAGE)
);
const projects = [setupProject, adminProject];
if (viewerCredsPresent) {
projects.push({
name: 'chromium-viewer',
testMatch: /\/rbac\//,
use: {
...devices['Desktop Chrome'],
storageState: '.auth/viewer_user.json',
},
dependencies: ['setup'],
});
}
export default defineConfig({
testDir: './_playwright-tests/',
fullyParallel: false,
forbidOnly: isCI,
retries: isCI ? 2 : 0,
workers: 1,
reporter: isCI
? [
['line'],
['html', { outputFolder: 'playwright-report' }],
['json', { outputFile: 'playwright-report/results.json' }],
]
: 'list',
globalTimeout: 30 * 60 * 1000, // 30 min
timeout: 90_000,
expect: {
timeout: 30_000,
},
use: {
actionTimeout: 30_000,
navigationTimeout: 60_000,
headless: true,
baseURL: process.env.BASE_URL,
video: 'retain-on-failure',
trace: 'retain-on-failure',
ignoreHTTPSErrors: true,
viewport: null,
launchOptions: {
args: ['--disable-http-cache'],
},
...(process.env.PROXY
? {
proxy: {
server: process.env.PROXY,
bypass: 'stage.foo.redhat.com,localhost,127.0.0.1',
},
}
: {}),
},
projects,
});