-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplaywright.config.ts
43 lines (42 loc) · 1.38 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
import { defineConfig } from "@sand4rt/experimental-ct-web";
export default defineConfig({
testDir: "src",
// we should aim to support fully parallel tests
// however, it is possible that this breaks some tests down the line
// (if we do not code good, isolated and independent tests)
fullyParallel: true,
// by enabling retries, playwright will automatically detect flaky tests
retries: 3,
// we start the vite server so that we can access the public/ directory
// that contains audio files used in testing
webServer: {
command: "pnpm dev --port 3000",
},
// Fail in CI if there is a focused test.only
forbidOnly: !!process.env.CI,
use: {
bypassCSP: true,
ctViteConfig: {
configFile: "vite.config.ts",
},
screenshot: "only-on-failure",
trace: "on-first-retry",
},
reporter: [
// create a HTML report of the test results
// this is the best way to debug why tests are failing locally
[
"html",
{
outputFolder: "test-report",
open: "never",
},
],
// print the test results out to the console.
// this can be useful for seeing why a test has failed in CI
process.env.CI ? ["github"] : ["list"],
],
snapshotPathTemplate: "./src/tests/__snapshots__/{testName}/{arg}{ext}",
testMatch: "**/*.spec.ts",
projects: [{ name: "chromium" }, { name: "firefox" }, { name: "webkit" }],
});