-
Notifications
You must be signed in to change notification settings - Fork 30
Expand file tree
/
Copy pathplaywright.config.base.ts
More file actions
48 lines (46 loc) · 1.3 KB
/
playwright.config.base.ts
File metadata and controls
48 lines (46 loc) · 1.3 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
import { defineConfig, devices } from "@playwright/test";
const baseUse = {
...devices["Desktop Chrome"],
viewport: { width: 1280, height: 720 },
};
export default defineConfig({
use: {
baseURL:
process.env["PLAYWRIGHT_TEST_BASE_URL"] ?? "http://localhost:4200",
headless: true,
trace: "on-first-retry",
screenshot: "only-on-failure",
video: "retain-on-failure",
},
workers: process.env["CI"] ? 1 : undefined,
fullyParallel: true,
forbidOnly: !!process.env["CI"],
retries: process.env["CI"] ? 2 : 0,
projects: [
{
name: "e2e",
testMatch: /.*\.e2e\.spec\.ts/,
use: baseUse,
},
{
name: "a11y",
testMatch: /.*\.a11y\.spec\.ts/,
use: baseUse,
},
{
name: "visual",
testMatch: /.*\.visual\.spec\.ts/,
use: { ...baseUse, screenshot: "on" },
},
],
testDir: "./e2e",
outputDir: "test-results/",
reporter: process.env.CI
? [["blob"], ["junit", { outputFile: "test-results/results.xml" }]]
: [["html"]],
webServer: {
command: "yarn run serve-examples:prod",
url: "http://localhost:4200",
reuseExistingServer: !process.env["CI"],
},
});