-
Notifications
You must be signed in to change notification settings - Fork 0
/
playwright.config.ts
85 lines (75 loc) · 1.53 KB
/
playwright.config.ts
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
82
83
84
85
import type { PlaywrightTestConfig } from "@playwright/test";
import { devices } from "@playwright/test";
/**
* See https://playwright.dev/docs/test-configuration.
*/
const devConfig: PlaywrightTestConfig = {
testDir: "./e2e",
timeout: 20 * 1000,
expect: {
timeout: 5000,
},
fullyParallel: true,
forbidOnly: false,
retries: 0,
reporter: [
["html", { outputFolder: "report/playwright-html" }],
["json", { outputFile: "report/playwright-test-results.json" }],
],
use: {
actionTimeout: 0,
trace: "retain-on-failure",
headless: false
},
projects: [
{
name: "chromium",
use: {
...devices["Desktop Chrome"],
},
},
],
outputDir: "report/playwright-trace/",
};
const ciConfig: PlaywrightTestConfig = {
testDir: "./e2e",
timeout: 20 * 1000,
expect: {
timeout: 5000,
},
fullyParallel: true,
forbidOnly: true,
retries: 2,
workers: 1,
reporter: [
["json", { outputFile: "report/playwright-test-results.json" }],
],
use: {
actionTimeout: 0,
trace: "retain-on-failure",
headless: true
},
projects: [
{
name: "chromium",
use: {
...devices["Desktop Chrome"],
},
},
{
name: "firefox",
use: {
...devices["Desktop Firefox"],
},
},
{
name: "webkit",
use: {
...devices["Desktop Safari"],
},
},
],
outputDir: "report/playwright-trace/",
};
const config: PlaywrightTestConfig = !!process.env.CI ? ciConfig : devConfig;
export default config;