Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: .registerBasicAuth() not working in Edge browser #3848 #3857

Merged
merged 4 commits into from
Aug 9, 2023
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
10 changes: 8 additions & 2 deletions lib/core/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,13 @@ class NightwatchAPI {
const browserNames = [this.browserName, lowerCaseBrowserName];

if (alternateName) {
return [browser, alternateName].some(name => browserNames.includes(name));
alternateName = Array.isArray(alternateName)
? alternateName
: [alternateName];

return [browser, ...alternateName].some(name =>
browserNames.includes(name)
);
}

return browserNames.includes(browser);
Expand Down Expand Up @@ -107,7 +113,7 @@ class NightwatchAPI {
}

isEdge() {
return this.__isBrowserName(Browser.EDGE, 'edge');
return this.__isBrowserName(Browser.EDGE, ['edge', 'msedge']);
}

isInternetExplorer() {
Expand Down
12 changes: 12 additions & 0 deletions test/src/index/transport/testEdgeOptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,5 +130,17 @@ describe('Test edge option', function(){
});
});

it('msedge as browserName', function () {
const client = Nightwatch.createClient({
desiredCapabilities: {
browserName: 'msedge'
}
});
const options = client.transport.createSessionOptions();

assert.strictEqual(options instanceof EdgeOptions, true);
assert.strictEqual(client.api.isEdge(), true);
assert.strictEqual(client.api.browserName, 'msedge');
});

});
Loading