Skip to content

Commit

Permalink
fix(puppeteer): hide deprecation info (#4075)
Browse files Browse the repository at this point in the history
  • Loading branch information
kobenguyent authored Dec 21, 2023
1 parent 51f7eb2 commit 0341547
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion lib/helper/Puppeteer.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ class Puppeteer extends Helper {
headless: !this.options.show,
...this._getOptions(config),
};
if (this.puppeteerOptions.headless) this.puppeteerOptions.headless = 'new';
this.isRemoteBrowser = !!this.puppeteerOptions.browserWSEndpoint;
popupStore.defaultAction = this.options.defaultPopupAction;
}
Expand Down Expand Up @@ -742,7 +743,8 @@ class Puppeteer extends Helper {
assertElementExists(els, locator, 'Element to focus');
const el = els[0];

await focusElement(el, this.page);
await el.click();
await el.focus();
return this._waitForAction();
}

Expand Down
8 changes: 6 additions & 2 deletions test/helper/Puppeteer_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,12 @@ describe('Puppeteer', function () {
});

it('should be unauthenticated ', async () => {
await I.amOnPage('/basic_auth');
await I.dontSee('You entered admin as your password.');
try {
await I.amOnPage('/basic_auth');
await I.dontSee('You entered admin as your password.');
} catch (e) {
expect(e.message).to.eq('net::ERR_INVALID_AUTH_CREDENTIALS at http://localhost:8000/basic_auth');
}
});
});

Expand Down

0 comments on commit 0341547

Please sign in to comment.