|
| 1 | +import { defineConfig, devices } from "@playwright/test"; |
| 2 | + |
| 3 | +/** |
| 4 | + * See https://playwright.dev/docs/test-configuration. |
| 5 | + */ |
| 6 | +export default defineConfig({ |
| 7 | + testDir: "./tests", |
| 8 | + /* Run tests in files in parallel */ |
| 9 | + fullyParallel: true, |
| 10 | + /* Fail the build on CI if you accidentally left test.only in the source code. */ |
| 11 | + forbidOnly: !!process.env.CI, |
| 12 | + /* Retry on CI only */ |
| 13 | + retries: process.env.CI ? 2 : 0, |
| 14 | + /* Opt out of parallel tests on CI. */ |
| 15 | + workers: process.env.CI ? 1 : undefined, |
| 16 | + /* Reporter to use. See https://playwright.dev/docs/test-reporters */ |
| 17 | + reporter: "list", |
| 18 | + /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ |
| 19 | + use: { |
| 20 | + /* Base URL to use in actions like `await page.goto('/')`. */ |
| 21 | + baseURL: "http://localhost:3000", |
| 22 | + |
| 23 | + /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */ |
| 24 | + trace: "on-first-retry", |
| 25 | + |
| 26 | + /* If you want to debug what's happening in the browser during the tests, set this to false. */ |
| 27 | + headless: true, |
| 28 | + }, |
| 29 | + |
| 30 | + /* Configure projects for major browsers */ |
| 31 | + projects: [ |
| 32 | + { |
| 33 | + name: "chromium", |
| 34 | + use: { ...devices["Desktop Chrome"] }, |
| 35 | + }, |
| 36 | + // { |
| 37 | + // name: "firefox", |
| 38 | + // use: { ...devices["Desktop Firefox"] }, |
| 39 | + // }, |
| 40 | + // { |
| 41 | + // name: "webkit", |
| 42 | + // use: { ...devices["Desktop Safari"] }, |
| 43 | + // }, |
| 44 | + ], |
| 45 | + |
| 46 | + /* Run your local dev server before starting the tests */ |
| 47 | + webServer: { |
| 48 | + command: `run-wasp-app ${process.env.WASP_RUN_MODE} --path-to-app=${process.env.WASP_APP_PATH} --wasp-cli-cmd=${process.env.WASP_CLI_CMD}`, |
| 49 | + // Wait for the backend to start |
| 50 | + url: "http://localhost:3001", |
| 51 | + reuseExistingServer: false, |
| 52 | + timeout: 240 * 1000, |
| 53 | + gracefulShutdown: { signal: "SIGTERM", timeout: 2000 }, |
| 54 | + }, |
| 55 | +}); |
0 commit comments