File tree Expand file tree Collapse file tree 3 files changed +10
-7
lines changed Expand file tree Collapse file tree 3 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -486,7 +486,7 @@ class Puppeteer extends Helper {
486
486
if ( ! page ) return ;
487
487
page . setDefaultNavigationTimeout ( this . options . getPageTimeout ) ;
488
488
this . context = await this . page . $ ( 'body' ) ;
489
- if ( this . config . browser === 'chrome' ) {
489
+ if ( this . options . browser === 'chrome' ) {
490
490
await page . bringToFront ( ) ;
491
491
}
492
492
}
@@ -658,9 +658,9 @@ class Puppeteer extends Helper {
658
658
url = this . options . url + url ;
659
659
}
660
660
661
- if ( this . config . basicAuth && ( this . isAuthenticated !== true ) ) {
661
+ if ( this . options . basicAuth && ( this . isAuthenticated !== true ) ) {
662
662
if ( url . includes ( this . options . url ) ) {
663
- await this . page . authenticate ( this . config . basicAuth ) ;
663
+ await this . page . authenticate ( this . options . basicAuth ) ;
664
664
this . isAuthenticated = true ;
665
665
}
666
666
}
Original file line number Diff line number Diff line change @@ -72,9 +72,12 @@ class REST extends Helper {
72
72
this . options . maxBodyLength = maxContentLength ;
73
73
}
74
74
75
- this . options = { ...this . options , ...config } ;
75
+ // override defaults with config
76
+ this . _setConfig ( config ) ;
77
+
76
78
this . headers = { ...this . options . defaultHeaders } ;
77
79
this . axios = axios . create ( ) ;
80
+ // @ts -ignore
78
81
this . axios . defaults . headers = this . options . defaultHeaders ;
79
82
}
80
83
Original file line number Diff line number Diff line change @@ -977,12 +977,12 @@ class WebDriver extends Helper {
977
977
*/
978
978
amOnPage ( url ) {
979
979
let split_url ;
980
- if ( this . config . basicAuth ) {
980
+ if ( this . options . basicAuth ) {
981
981
if ( url . startsWith ( '/' ) ) {
982
- url = this . config . url + url ;
982
+ url = this . options . url + url ;
983
983
}
984
984
split_url = url . split ( '//' ) ;
985
- url = `${ split_url [ 0 ] } //${ this . config . basicAuth . username } :${ this . config . basicAuth . password } @${ split_url [ 1 ] } ` ;
985
+ url = `${ split_url [ 0 ] } //${ this . options . basicAuth . username } :${ this . options . basicAuth . password } @${ split_url [ 1 ] } ` ;
986
986
}
987
987
return this . browser . url ( url ) ;
988
988
}
You can’t perform that action at this time.
0 commit comments