-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathplaywright.config.ts
109 lines (104 loc) · 2.17 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
import "dotenv/config";
import { env } from "./env";
import { defineConfig, devices } from "@playwright/test";
import { Tag } from "./tags";
// const projectsAll = [
// {
// name: "chromium",
// use: {
// ...devices["Desktop Chrome"],
// },
// },
// {
// name: "firefox",
// use: {
// ...devices['Desktop Firefox'],
// },
// },
// {
// name: "safari",
// // grepInvert: new RegExp(Tag.NotForSafari),
// use: {
// ...devices['Desktop Safari'],
// },
// },
// ];
// const projects: any = [
// ...projectsAll.map(p => {
// p.name = `smoke-${p.name}`;
// // @ts-ignore
// p.grep = new RegExp(Tag.Smoke);
// return p;
// }),
// ...projectsAll,
// ]
// console.log(projects)
/**
* See https://playwright.dev/docs/test-configuration.
*/
export default defineConfig({
testDir: "./tests",
fullyParallel: true,
workers: "90%",
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
reporter: [
["list", {
printSteps: true,
}],
// [
// "monocart-reporter",
// {
// name: "My Test Report",
// outputFile: "./test-results/report.html",
// },
// ],
["html"]
],
use: {
baseURL: env.FRONTEND_URL,
headless: process.env.CI ? true : false,
trace: 'on',
screenshot: 'only-on-failure',
},
globalSetup: require.resolve("./globalSetup.ts"),
projects: [
{
name: "chromium",
use: {
...devices["Desktop Chrome"],
},
},
{
name: "firefox",
use: {
...devices["Desktop Firefox"],
},
},
{
name: "precondition-safari",
testDir: "precondition",
testMatch: "safari.precondition.ts",
use: {
...devices["Desktop Safari"],
},
},
{
name: "teardown-safari",
testDir: "precondition",
testMatch: "safari.precondition.ts",
use: {
...devices["Desktop Safari"],
},
},
{
dependencies: ["precondition-safari"],
teardown: "teardown-safari",
name: "safari",
grepInvert: new RegExp(Tag.NotForSafari),
use: {
...devices["Desktop Safari"],
},
},
],
});