|
1 |
| -import { defineConfig } from '@playwright/test'; |
| 1 | +import { defineConfig, devices } from '@playwright/test'; |
2 | 2 | import { nxE2EPreset } from '@nx/playwright/preset';
|
3 |
| - |
4 | 3 | import { workspaceRoot } from '@nx/devkit';
|
5 |
| - |
6 | 4 | // For CI, you may want to set BASE_URL to the deployed application.
|
7 | 5 | const baseURL = process.env['BASE_URL'] || 'http://localhost:4200';
|
8 |
| - |
9 | 6 | /**
|
10 | 7 | * Read environment variables from file.
|
11 | 8 | * https://github.com/motdotla/dotenv
|
12 | 9 | */
|
13 | 10 | // require('dotenv').config();
|
14 |
| - |
15 | 11 | /**
|
16 | 12 | * See https://playwright.dev/docs/test-configuration.
|
17 | 13 | */
|
18 |
| -export default defineConfig({ |
19 |
| - ...nxE2EPreset(__filename, { testDir: './src' }), |
20 |
| - /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ |
21 |
| - use: { |
22 |
| - baseURL, |
23 |
| - /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */ |
24 |
| - trace: 'on-first-retry', |
25 |
| - }, |
26 |
| - /* Run your local dev server before starting the tests */ |
27 |
| - webServer: { |
28 |
| - command: 'npx nx serve demo', |
29 |
| - url: 'http://localhost:4200', |
30 |
| - reuseExistingServer: !process.env.CI, |
31 |
| - cwd: workspaceRoot, |
32 |
| - }, |
33 |
| -}); |
| 14 | +export default defineConfig({ ...nxE2EPreset(__filename, { testDir: './src' }), |
| 15 | + /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ |
| 16 | + use: { |
| 17 | + baseURL, |
| 18 | + /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */ |
| 19 | + trace: 'on-first-retry', |
| 20 | + }, |
| 21 | + /* Run your local dev server before starting the tests */ |
| 22 | + webServer: { |
| 23 | + command: 'npx nx serve demo', |
| 24 | + url: 'http://localhost:4200', |
| 25 | + reuseExistingServer: !process.env.CI, |
| 26 | + cwd: workspaceRoot, |
| 27 | + }, projects: [ |
| 28 | + { name: "chromium", use: { ...devices["Desktop Chrome"] } }, |
| 29 | + { name: "firefox", use: { ...devices["Desktop Firefox"] } }, |
| 30 | + { name: "webkit", use: { ...devices["Desktop Safari"] } } |
| 31 | + ] }); |
0 commit comments