File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ async function captureScreenshotsForConfig(
2121 let beforeSnapshotScript = execute ?. beforeSnapshot ;
2222 let waitUntilEvent = pageEvent || process . env . SMARTUI_PAGE_WAIT_UNTIL_EVENT || 'load' ;
2323
24- let pageOptions = { waitUntil : waitUntilEvent , timeout : ctx . config . waitForPageRender || constants . DEFAULT_PAGE_LOAD_TIMEOUT , userAgent : ctx . config . userAgent } ;
24+ let pageOptions = { waitUntil : waitUntilEvent , timeout : ctx . config . waitForPageRender || constants . DEFAULT_PAGE_LOAD_TIMEOUT } ;
2525 ctx . log . debug ( `url: ${ url } pageOptions: ${ JSON . stringify ( pageOptions ) } ` ) ;
2626 let ssId = name . toLowerCase ( ) . replace ( / \s / g, '_' ) ;
2727 let context : BrowserContext ;
@@ -31,10 +31,10 @@ async function captureScreenshotsForConfig(
3131 else if ( browserName == constants . FIREFOX ) contextOptions . userAgent = constants . FIREFOX_USER_AGENT ;
3232 else if ( browserName == constants . SAFARI ) contextOptions . userAgent = constants . SAFARI_USER_AGENT ;
3333 else if ( browserName == constants . EDGE ) contextOptions . userAgent = constants . EDGE_USER_AGENT ;
34- else {
35- contextOptions . userAgent = pageOptions . userAgent ;
36- if ( pageOptions . userAgent = == null ) {
37- contextOptions . userAgent = userAgent ;
34+ else if ( ctx . config . userAgent || urlConfig . userAgent ) {
35+ contextOptions . userAgent = ctx . config . userAgent ;
36+ if ( urlConfig . userAgent ! == null ) {
37+ contextOptions . userAgent = urlConfig . userAgent ;
3838 }
3939 }
4040
You can’t perform that action at this time.
0 commit comments