|
| 1 | +// TODO: Investigate node global process usage |
| 2 | + |
| 3 | +import { fileURLToPath } from 'node:url' |
| 4 | +import { nxE2EPreset } from '@nx/playwright/preset' |
| 5 | + |
| 6 | +import { defineConfig, devices } from '@playwright/test' |
| 7 | + |
| 8 | +const __filename = fileURLToPath(import.meta.url) |
| 9 | + |
| 10 | +// // For CI, you may want to set BASE_URL to the deployed application. |
| 11 | +// const baseURL = process.env.BASE_URL || 'http://127.0.0.1:3000' |
| 12 | + |
| 13 | +/** |
| 14 | + * Read environment variables from file. |
| 15 | + * https://github.com/motdotla/dotenv |
| 16 | + */ |
| 17 | +// require('dotenv').config(); |
| 18 | + |
| 19 | +/** |
| 20 | + * See https://playwright.dev/docs/test-configuration. |
| 21 | + */ |
| 22 | +export default defineConfig({ |
| 23 | + ...nxE2EPreset(__filename, { testDir: './src' }), |
| 24 | + /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ |
| 25 | + retries: 2, |
| 26 | + use: { |
| 27 | + // baseURL, |
| 28 | + /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */ |
| 29 | + trace: 'on-first-retry', |
| 30 | + }, |
| 31 | + /* Run your local dev server before starting the tests */ |
| 32 | + // webServer: { |
| 33 | + // command: 'pnpm nx start risk-form-filler', |
| 34 | + // // url: 'http://127.0.0.1:3000', |
| 35 | + // // reuseExistingServer: !process.env.CI, |
| 36 | + // cwd: workspaceRoot, |
| 37 | + // timeout: 120 * 1000, |
| 38 | + // }, |
| 39 | + projects: [ |
| 40 | + { |
| 41 | + name: 'chromium (desktop)', |
| 42 | + use: { ...devices['Desktop Chrome'] }, |
| 43 | + }, |
| 44 | + ], |
| 45 | +}) |
0 commit comments