1
import { defineConfig, devices } from '@playwright/test';
2
import { nxE2EPreset } from '@nx/playwright/preset';
4
import { workspaceRoot } from '@nx/devkit';
6
// For CI, you may want to set BASE_URL to the deployed application.
7
const baseURL = process.env['BASE_URL'] || 'http://localhost:4200';
10
* Read environment variables from file.
11
* https://github.com/motdotla/dotenv
13
// require('dotenv').config();
16
* See https://playwright.dev/docs/test-configuration.
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. */
23
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
24
trace: 'on-first-retry',
26
/* Run your local dev server before starting the tests */
28
command: 'npx nx serve org',
29
url: 'http://localhost:4200',
30
reuseExistingServer: !process.env.CI,
36
use: { ...devices['Desktop Chrome'] },
41
use: { ...devices['Desktop Firefox'] },
46
use: { ...devices['Desktop Safari'] },
49
// Uncomment for mobile browsers support
51
name: 'Mobile Chrome',
52
use: { ...devices['Pixel 5'] },
55
name: 'Mobile Safari',
56
use: { ...devices['iPhone 12'] },
59
// Uncomment for branded browsers
61
name: 'Microsoft Edge',
62
use: { ...devices['Desktop Edge'], channel: 'msedge' },
65
name: 'Google Chrome',
66
use: { ...devices['Desktop Chrome'], channel: 'chrome' },