-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
89 lines (88 loc) · 2.28 KB
/
Copy pathplaywright.config.ts
File metadata and controls
89 lines (88 loc) · 2.28 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
82
83
84
85
86
87
88
89
import { defineConfig, devices } from "@playwright/test";
import { E2E_PORTAL_SECRET, E2E_PORTAL_LOGIN_URL } from "./e2e/auth-constants";
export default defineConfig({
testDir: "./e2e",
fullyParallel: true,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
workers: process.env.CI ? 1 : undefined,
reporter: "html",
timeout: 30000,
expect: { timeout: 5000 },
use: {
baseURL: "http://localhost:3000",
trace: "on-first-retry",
},
projects: [
{
name: "chromium",
use: { ...devices["Desktop Chrome"] },
testMatch: /home\.spec\.ts/,
},
{ name: "setup", testMatch: /.*\.setup\.ts/ },
{
name: "groups-admin",
use: {
...devices["Desktop Chrome"],
storageState: "playwright/.auth/admin.json",
},
testMatch: /.*groups.*\.spec\.ts/,
dependencies: ["setup"],
},
{
name: "groups-member",
use: {
...devices["Desktop Chrome"],
storageState: "playwright/.auth/member.json",
},
testMatch: /.*groups.*\.spec\.ts/,
dependencies: ["setup"],
},
{
name: "home-admin",
use: {
...devices["Desktop Chrome"],
storageState: "playwright/.auth/admin.json",
},
testMatch: /home-dashboard\.spec\.ts/,
dependencies: ["setup"],
},
{
name: "home-member",
use: {
...devices["Desktop Chrome"],
storageState: "playwright/.auth/member.json",
},
testMatch: /home-dashboard-member\.spec\.ts/,
dependencies: ["setup"],
},
{
name: "authenticated-admin",
use: {
...devices["Desktop Chrome"],
storageState: "playwright/.auth/admin.json",
},
testMatch: /user-menu|sidebar|navigation|search/,
dependencies: ["setup"],
},
{
name: "authenticated-member",
use: {
...devices["Desktop Chrome"],
storageState: "playwright/.auth/member.json",
},
testMatch: /user-menu|sidebar|navigation|search/,
dependencies: ["setup"],
},
],
webServer: {
command: "npm run dev",
url: "http://localhost:3000",
reuseExistingServer: !process.env.CI,
timeout: 120000,
env: {
PRFC_PORTAL_SECRET: E2E_PORTAL_SECRET,
PRFC_PORTAL_LOGIN_URL: E2E_PORTAL_LOGIN_URL,
},
},
});