@@ -6,44 +6,66 @@ module.exports = {
66 expect : {
77 timeout : 5000 ,
88 } ,
9- fullyParallel : true ,
9+ fullyParallel : true ,
10+
11+ /* Fail the build on CI if you accidentally left test.only in the source code. */
12+ forbidOnly : ! ! process . env . CI ,
13+
14+ /* Retry on CI only */
15+ retries : process . env . CI ? 2 : 0 ,
16+
17+ /* Opt out of parallel tests on CI. */
18+ workers : process . env . CI ? 1 : undefined ,
19+
1020 reporter : [
11- [ 'dot' ] ,
12- [ 'json' , { outputFile : 'results/test-results.json' } ] ,
21+ [ 'html' , { outputFolder : 'playwright-report' } ] ,
22+ [ 'json' , { outputFile : 'test-results/results.json' } ] ,
23+ [ 'junit' , { outputFile : 'test-results/junit.xml' } ] ,
24+ [ 'list' ]
1325 ] ,
14- webServer : {
15- command : 'npm run start' ,
16- port : 3000 ,
17- timeout : 120 * 1000 ,
18- reuseExistingServer : ! process . env . CI ,
26+
27+ /* Shared settings for all the projects below */
28+ use : {
29+ /* Base URL to use in actions like await page.goto('/') */
30+ baseURL : 'https://opensource-demo.orangehrmlive.com' ,
31+
32+ /* Collect trace when retrying the failed test */
33+ trace : 'on-first-retry' ,
34+
35+ /* Screenshot on failure */
36+ screenshot : 'only-on-failure' ,
37+
38+ /* Video on failure */
39+ video : 'retain-on-failure' ,
40+
41+ /* Maximum time each action can take */
42+ actionTimeout : 30000 ,
43+
44+ /* Maximum time each navigation can take */
45+ navigationTimeout : 60000 ,
1946 } ,
47+
2048 projects : [
2149 {
22- name : 'Desktop Chrome ' ,
50+ name : 'chromium ' ,
2351 use : { ...devices [ 'Desktop Chrome' ] } ,
2452 } ,
2553 {
26- name : 'Desktop Firefox ' ,
54+ name : 'firefox ' ,
2755 use : { ...devices [ 'Desktop Firefox' ] } ,
2856 } ,
2957 {
30- name : 'Desktop Safari ' ,
58+ name : 'webkit ' ,
3159 use : { ...devices [ 'Desktop Safari' ] } ,
3260 } ,
3361 {
3462 name : 'Mobile Chrome' ,
35- use : { ...devices [ 'Google Pixel 5' ] } ,
36- } ,
37- {
38- name : 'Mobile Firefox' ,
39- use : { ...devices [ 'Google Pixel 5' ] } ,
40- } ,
63+ use : { ...devices [ 'Pixel 5' ] } ,
64+ } ,
65+ // Only run Mobile Safari locally, not in CI
4166 ...( ! process . env . CI ? [ {
4267 name : 'Mobile Safari' ,
4368 use : { ...devices [ 'iPhone 12' ] } ,
4469 } ] : [ ] ) ,
45- ] ,
46- timeout : 90000 ,
47- navigationTimeout : 60000 ,
48- actionTimeout : 30000 ,
70+ ] ,
4971} ;
0 commit comments