-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
82 lines (77 loc) · 2.71 KB
/
playwright.config.ts
File metadata and controls
82 lines (77 loc) · 2.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
70
71
72
73
74
75
76
77
78
79
80
81
82
import { defineConfig, devices } from "@playwright/test";
export default defineConfig({
testDir: "./tests", // directory where the tests are located
retries: process.env.CI ? 2 : 0, // retry failed tests on CI
// Configure projects for different test suites
projects: [
{
name: 'anu-tests',
testMatch: /.*\.spec\.ts/,
testIgnore: /docs-examples\.spec\.ts/,
use: {
baseURL: "http://localhost:3443",
browserName: "chromium",
headless: true,
launchOptions: {
args: [
"--no-sandbox",
"--disable-dev-shm-usage",
"--use-gl=swiftshader"
]
},
viewport: { width: 1280, height: 720 }
},
},
{
name: 'docs-examples',
testMatch: /docs-examples\.spec\.ts/,
use: {
baseURL: "http://localhost:5173/anu/",
browserName: "chromium",
headless: true,
launchOptions: {
args: [
"--no-sandbox",
"--disable-dev-shm-usage",
"--use-gl=swiftshader"
]
},
viewport: { width: 1280, height: 720 }
},
},
],
use: {
baseURL: "http://localhost:3443", // base URL where the game is served
browserName: "chromium", // We are testing on chromium
headless: true, // do not show the browser window
launchOptions: {
args: [
"--no-sandbox",
"--disable-dev-shm-usage",
"--use-gl=swiftshader" // software WebGL (no need for a GPU)
]
},
viewport: { width: 1280, height: 720 } // HD resolution is good enough
},
fullyParallel: true, // Run tests in files in parallel
expect: {
toHaveScreenshot: {
maxDiffPixelRatio: 0.03, // ~3 % pixels may differ (aliasing can change the color of some pixels)
threshold: 0.01 // pixels are considered different if they differ by more than 1% (aliasing can change the color of some pixels)
}
},
webServer: [
{
command: "cd anu-tests && npm run dev",
url: "http://localhost:3443",
timeout: 120 * 1000,
reuseExistingServer: !process.env.CI
},
{
command: "cd docs && npm run docs:dev",
url: "http://localhost:5173/anu/",
timeout: 120 * 1000,
reuseExistingServer: !process.env.CI
}
]
});