Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -740,7 +741,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