@@ -2,62 +2,36 @@ import { defineConfig, devices } from '@playwright/test';
22import { nxE2EPreset } from '@nx/playwright/preset' ;
33import { workspaceRoot } from '@nx/devkit' ;
44
5- // For CI, you may want to set BASE_URL to the deployed application.
65const baseURL = process . env [ 'BASE_URL' ] || 'http://localhost:4300' ;
76
8- /**
9- * Read environment variables from file.
10- * https://github.com/motdotla/dotenv
11- */
12- // require('dotenv').config();
13-
14- /**
15- * See https://playwright.dev/docs/test-configuration.
16- */
177export default defineConfig ( {
188 ...nxE2EPreset ( __filename , { testDir : './src' } ) ,
19- /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
9+ retries : process . env . CI ? 1 : 0 ,
10+ fullyParallel : ! process . env . CI ,
11+
2012 use : {
2113 baseURL,
22- /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
2314 trace : 'on-first-retry' ,
2415 } ,
25- /* Run your local dev server before starting the tests */
26- webServer : {
27- command : 'pnpm exec nx run server-ui:preview' ,
28- url : 'http://localhost:4300' ,
29- reuseExistingServer : ! process . env . CI ,
30- cwd : workspaceRoot ,
31- } ,
32- projects : [
3316
17+ webServer : [
3418 {
35- name : "chromium" ,
36- //channel: "chromium" -> https://github.com/microsoft/playwright/issues/33682
37- use : { ...devices [ "Desktop Chrome" ] , channel : "chromium" } ,
19+ command : 'pnpm exec nx run server-ui:preview' ,
20+ url : 'http://localhost:4300' ,
21+ reuseExistingServer : ! process . env . CI ,
22+ cwd : workspaceRoot ,
3823 } ,
24+ ] ,
25+
26+ projects : [
3927 {
40- name : 'Microsoft Edge' ,
41- use : { ...devices [ 'Desktop Edge' ] , channel : 'msedge' } ,
42- } ,
43- // Uncomment for mobile browsers support
44- /* {
45- name: 'Mobile Chrome',
46- use: { ...devices['Pixel 5'] },
28+ name : 'chromium' ,
29+ // https://github.com/microsoft/playwright/issues/33682
30+ use : { ...devices [ 'Desktop Chrome' ] , channel : 'chromium' } ,
4731 } ,
4832 {
49- name: 'Mobile Safari',
50- use: { ...devices['iPhone 12'] },
51- }, */
52-
53- // Uncomment for branded browsers
54- /* {
5533 name : 'Microsoft Edge' ,
5634 use : { ...devices [ 'Desktop Edge' ] , channel : 'msedge' } ,
5735 } ,
58- {
59- name: 'Google Chrome',
60- use: { ...devices['Desktop Chrome'], channel: 'chrome' },
61- } */
6236 ] ,
6337} ) ;
0 commit comments