import { defineConfig, devices } from '@playwright/test'; export default defineConfig({ testDir: './playwright/tests', /* Run tests in files in parallel */ fullyParallel: true, /* Fail the build on CI if you accidentally left test.only in the source code. */ forbidOnly: !!process.env.CI, /* Retry on CI only */ retries: process.env.CI ? 2 : 1, /* Opt out of parallel tests on CI. */ workers: process.env.CI ? 1 : undefined, /* Reporter to use. See https://playwright.dev/docs/test-reporters */ reporter: 'html', use: { video: 'retain-on-failure', screenshot: 'only-on-failure', navigationTimeout: 300000, baseURL: 'http://127.0.0.1:8080', testIdAttribute: 'data-component-name', trace: 'on-first-retry', }, /* Configure projects for major browsers */ projects: [ { name: 'chromium', use: { ...devices['Desktop Chrome'] }, }, ], /* Run your local dev server before starting the tests */ webServer: { command: 'npx http-server ./playwright --port 8080 -c-1', port: 8080, reuseExistingServer: !process.env.CI, }, });