Skip to content

Commit 0341547

Browse files
authored
fix(puppeteer): hide deprecation info (#4075)
1 parent 51f7eb2 commit 0341547

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

lib/helper/Puppeteer.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,7 @@ class Puppeteer extends Helper {
259259
headless: !this.options.show,
260260
...this._getOptions(config),
261261
};
262+
if (this.puppeteerOptions.headless) this.puppeteerOptions.headless = 'new';
262263
this.isRemoteBrowser = !!this.puppeteerOptions.browserWSEndpoint;
263264
popupStore.defaultAction = this.options.defaultPopupAction;
264265
}
@@ -742,7 +743,8 @@ class Puppeteer extends Helper {
742743
assertElementExists(els, locator, 'Element to focus');
743744
const el = els[0];
744745

745-
await focusElement(el, this.page);
746+
await el.click();
747+
await el.focus();
746748
return this._waitForAction();
747749
}
748750

test/helper/Puppeteer_test.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,12 @@ describe('Puppeteer', function () {
137137
});
138138

139139
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+
}
142146
});
143147
});
144148

0 commit comments

Comments
 (0)