nightwatchjs / nightwatch

Integrated end-to-end testing framework written in Node.js and using W3C Webdriver API. Developed at @browserstack
https://nightwatchjs.org
MIT License
11.78k stars 1.31k forks source link

Please add support for Edge (chromium based) #2307

Closed RafalSkorka closed 4 years ago

RafalSkorka commented 4 years ago

Currently when trying to run Nightwatch 1.3.2 with the newest Edge based on Chromium I get this error:

Error: An error occurred while trying to start the Nightwatch Runner: Unsupported browser: microsoftedge. There is no available driver.

Since the browser is now based on Chromium, it should support the same set of webdriver commands as Chrome.

pawlakmaly commented 4 years ago

I've workaround the issue with downloading the new Edge driver and adding to config for Edge only webdriver options with path to the driver .EXE file. However it works only on Windows system. Try also change MicrosoftEdge to Edge.

RafalSkorka commented 4 years ago

thanks @pawlakmaly! I have worked around this for now by setting the browser name to 'chrome' and providing the path to new ms edge driver like this:

const msedgedriver = require('msedgedriver');
const edgeChromium = fs.existsSync('c:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe');
const EDGE = {
    desiredCapabilities: {
        alwaysMatch: { 'ms:edgeOptions': { args: ['--headless'] } },
        browserName: edgeChromium ? 'chrome' : 'MicrosoftEdge'
    },
    selenium: {
        'start_process': !edgeChromium
    },
    webdriver: {
        'default_path_prefix': '',
        'server_path': edgeChromium ? msedgedriver.path : "c:\\Windows\\System32\\MicrosoftWebDriver.exe",
        'start_process': edgeChromium,
        'use_legacy_jsonwire': false
    }
};
stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had any recent activity. If possible, please retry using the latest Nightwatch version and update the issue with any relevant details. If no further activity occurs, it will be closed. Thank you for your contribution.