blob: 7875954db6acd7591e25b90ec1bb3df323f4606b [file] [log] [blame]
Pokey Rulea4ad8af2025-05-08 15:05:27 +01001import {
2 defineConfig,
3 devices,
4 PlaywrightTestConfig,
5} from "@sand4rt/experimental-ct-web";
Sean McCulloughb29f8912025-04-20 15:39:11 -07006
7/**
8 * See https://playwright.dev/docs/test-configuration.
9 */
10export default defineConfig({
Sean McCullougha0f68fa2025-04-22 09:57:54 -070011 testDir: "./src",
Sean McCulloughb29f8912025-04-20 15:39:11 -070012 /* The base directory, relative to the config file, for snapshot files created with toMatchSnapshot and toHaveScreenshot. */
Sean McCullougha0f68fa2025-04-22 09:57:54 -070013 snapshotDir: "./__snapshots__",
Sean McCulloughb29f8912025-04-20 15:39:11 -070014 /* Maximum time one test can run for. */
15 timeout: 10 * 1000,
16 /* Run tests in files in parallel */
17 fullyParallel: true,
18 /* Fail the build on CI if you accidentally left test.only in the source code. */
19 forbidOnly: !!process.env.CI,
20 /* Retry on CI only */
21 retries: process.env.CI ? 2 : 0,
22 /* Opt out of parallel tests on CI. */
23 workers: process.env.CI ? 1 : undefined,
24 /* Reporter to use. See https://playwright.dev/docs/test-reporters */
Pokey Rulea4ad8af2025-05-08 15:05:27 +010025 reporter: getReporterConfig(),
Sean McCulloughb29f8912025-04-20 15:39:11 -070026 /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
27 use: {
28 /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
Sean McCullougha0f68fa2025-04-22 09:57:54 -070029 trace: "on-first-retry",
Sean McCulloughb29f8912025-04-20 15:39:11 -070030
31 /* Port to use for Playwright component endpoint. */
32 ctPort: 3100,
33 },
34
35 /* Configure projects for major browsers */
36 projects: [
37 {
Sean McCullougha0f68fa2025-04-22 09:57:54 -070038 name: "chromium",
39 use: { ...devices["Desktop Chrome"] },
Sean McCulloughb29f8912025-04-20 15:39:11 -070040 },
41 // {
42 // name: 'firefox',
43 // use: { ...devices['Desktop Firefox'] },
44 // },
45 // {
46 // name: 'webkit',
47 // use: { ...devices['Desktop Safari'] },
48 // },
49 ],
50});
Pokey Rulea4ad8af2025-05-08 15:05:27 +010051
52function getReporterConfig(): PlaywrightTestConfig["reporter"] {
Philip Zeyliger8bdf6272025-05-16 13:36:21 -070053 // Sketch does not understand the junit failure reporting very well.
Autoformatter8c463622025-05-16 21:54:17 +000054
Pokey Rulea4ad8af2025-05-08 15:05:27 +010055 return [["html", { open: "never" }]];
56}