@@ -25,7 +25,7 @@ import {isLocalRun} from './configurator';
25
25
26
26
import type { FullPackConfig , Mutable , UserlandPack } from './types/internal' ;
27
27
28
- import { defineConfig } from '@playwright/test' ;
28
+ import { defineConfig , type PlaywrightTestConfig } from '@playwright/test' ;
29
29
30
30
const maxTimeoutInMs = 3600_000 ;
31
31
@@ -91,6 +91,23 @@ if (isDebug) {
91
91
setReadonlyProperty ( userlandPack , 'testTimeout' , maxTimeoutInMs ) ;
92
92
}
93
93
94
+ const useOptions : PlaywrightTestConfig [ 'use' ] = {
95
+ actionTimeout : userlandPack . testIdleTimeout ,
96
+ browserName : userlandPack . browserName ,
97
+ // eslint-disable-next-line @typescript-eslint/naming-convention
98
+ bypassCSP : true ,
99
+ deviceScaleFactor : userlandPack . deviceScaleFactor ,
100
+ hasTouch : userlandPack . enableTouchEventEmulation ,
101
+ headless : isLocalRun ? userlandPack . enableHeadlessMode : true ,
102
+ isMobile : userlandPack . enableMobileDeviceMode ,
103
+ launchOptions : { args : [ ...userlandPack . browserFlags ] } ,
104
+ navigationTimeout : userlandPack . pageRequestTimeout ,
105
+ trace : 'retain-on-failure' ,
106
+ userAgent : userlandPack . userAgent ,
107
+ viewport : { height : userlandPack . viewportHeight , width : userlandPack . viewportWidth } ,
108
+ ...userlandPack . overriddenConfigFields ?. use ,
109
+ } ;
110
+
94
111
const playwrightConfig = defineConfig ( {
95
112
expect : { timeout : userlandPack . assertionTimeout } ,
96
113
@@ -100,19 +117,7 @@ const playwrightConfig = defineConfig({
100
117
101
118
outputDir : join ( relativePathFromInstalledE2edToRoot , INTERNAL_REPORTS_DIRECTORY_PATH ) ,
102
119
103
- projects : [
104
- {
105
- name : userlandPack . browserName ,
106
- use : {
107
- browserName : userlandPack . browserName ,
108
- deviceScaleFactor : userlandPack . deviceScaleFactor ,
109
- hasTouch : userlandPack . enableTouchEventEmulation ,
110
- isMobile : userlandPack . enableMobileDeviceMode ,
111
- userAgent : userlandPack . userAgent ,
112
- viewport : { height : userlandPack . viewportHeight , width : userlandPack . viewportWidth } ,
113
- } ,
114
- } ,
115
- ] ,
120
+ projects : [ { name : userlandPack . browserName , use : useOptions } ] ,
116
121
117
122
retries : isLocalRun ? 0 : userlandPack . maxRetriesCountInDocker - 1 ,
118
123
@@ -126,32 +131,7 @@ const playwrightConfig = defineConfig({
126
131
127
132
...userlandPack . overriddenConfigFields ,
128
133
129
- use : {
130
- actionTimeout : userlandPack . testIdleTimeout ,
131
-
132
- browserName : userlandPack . browserName ,
133
-
134
- // eslint-disable-next-line @typescript-eslint/naming-convention
135
- bypassCSP : true ,
136
-
137
- deviceScaleFactor : userlandPack . deviceScaleFactor ,
138
-
139
- hasTouch : userlandPack . enableTouchEventEmulation ,
140
-
141
- headless : isLocalRun ? userlandPack . enableHeadlessMode : true ,
142
-
143
- isMobile : userlandPack . enableMobileDeviceMode ,
144
-
145
- navigationTimeout : userlandPack . pageRequestTimeout ,
146
-
147
- trace : 'retain-on-failure' ,
148
-
149
- userAgent : userlandPack . userAgent ,
150
-
151
- viewport : { height : userlandPack . viewportHeight , width : userlandPack . viewportWidth } ,
152
-
153
- ...userlandPack . overriddenConfigFields ?. use ,
154
- } ,
134
+ use : useOptions ,
155
135
} ) ;
156
136
157
137
const config : FullPackConfig = Object . assign ( playwrightConfig , userlandPack ) ;
0 commit comments