-
Notifications
You must be signed in to change notification settings - Fork 83
/
Copy pathplaywright-ct.config.ts
55 lines (42 loc) · 1.3 KB
/
playwright-ct.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
import { defineConfig, devices } from "@playwright/experimental-ct-react17";
import { resolve } from "path";
const playwrightDir = resolve(__dirname, "./playwright");
/**
* See https://playwright.dev/docs/test-configuration.
*/
export default defineConfig({
testDir: resolve(__dirname, "./src/components"),
snapshotDir: resolve(playwrightDir, "./__snapshots__"),
outputDir: resolve(playwrightDir, "./test-results"),
timeout: 30 * 1000,
fullyParallel: true,
retries: 3,
maxFailures: process.env.CI ? 10 : undefined,
reporter: process.env.CI
? "blob"
: [["html", { outputFolder: resolve(playwrightDir, "./test-report") }]],
use: {
trace: "retain-on-failure",
ctPort: 3100,
/* Custom config for internal bundler Playwright uses for component tests. See https://playwright.dev/docs/test-components#under-the-hood */
ctViteConfig: {
resolve: {
alias: {
// Required to load font assets correctly from @sage/design-tokens package
"~@sage": resolve(__dirname, "./node_modules/@sage/"),
},
},
},
},
testMatch: /.*\.pw\.tsx/,
projects: [
{
name: "chromium",
use: {
...devices["Desktop Chrome"],
testIdAttribute: "data-role",
viewport: { width: 1366, height: 768 },
},
},
],
});