File tree 2 files changed +9
-3
lines changed
2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -259,6 +259,7 @@ class Puppeteer extends Helper {
259
259
headless : ! this . options . show ,
260
260
...this . _getOptions ( config ) ,
261
261
} ;
262
+ if ( this . puppeteerOptions . headless ) this . puppeteerOptions . headless = 'new' ;
262
263
this . isRemoteBrowser = ! ! this . puppeteerOptions . browserWSEndpoint ;
263
264
popupStore . defaultAction = this . options . defaultPopupAction ;
264
265
}
@@ -742,7 +743,8 @@ class Puppeteer extends Helper {
742
743
assertElementExists ( els , locator , 'Element to focus' ) ;
743
744
const el = els [ 0 ] ;
744
745
745
- await focusElement ( el , this . page ) ;
746
+ await el . click ( ) ;
747
+ await el . focus ( ) ;
746
748
return this . _waitForAction ( ) ;
747
749
}
748
750
Original file line number Diff line number Diff line change @@ -137,8 +137,12 @@ describe('Puppeteer', function () {
137
137
} ) ;
138
138
139
139
it ( 'should be unauthenticated ' , async ( ) => {
140
- await I . amOnPage ( '/basic_auth' ) ;
141
- await I . dontSee ( 'You entered admin as your password.' ) ;
140
+ try {
141
+ await I . amOnPage ( '/basic_auth' ) ;
142
+ await I . dontSee ( 'You entered admin as your password.' ) ;
143
+ } catch ( e ) {
144
+ expect ( e . message ) . to . eq ( 'net::ERR_INVALID_AUTH_CREDENTIALS at http://localhost:8000/basic_auth' ) ;
145
+ }
142
146
} ) ;
143
147
} ) ;
144
148
You can’t perform that action at this time.
0 commit comments