Run web server and the selenium server with Gulp + nightwatch.js - selenium

I'm trying to run some nightwatch.js e2e tests using Gulp.
At the moment I have to do the following:
Run the selenium server manually
Set the path of selenium-server-standalone-2.47.1.jar and phantomjs.exe
Run the web server manually
My gulp task looks as follows:
gulp.task("run-e2e-tests", function () {
return gulp.src('')
.pipe(nightwatch({
configFile: "nightwatch.json",
cliArgs: {
env: "phantomjs"
}
}));
});
My nightwatch.js configuration looks as follows:
{
"src_folders" : [
"bundle/e2e_test/"
],
"output_folder": false,
"selenium" : {
"start_process" : false,
"server_path" : "./selenium-binaries/selenium-server-standalone-2.47.1.jar"
},
"test_settings" : {
"default" : {
"silent": true,
"screenshots" : {
"enabled" : false
},
"desiredCapabilities": {
"browserName": "phantomjs",
"javascriptEnabled" : true,
"acceptSslCerts" : false
}
},
"phantomjs" : {
"desiredCapabilities": {
"browserName": "phantomjs",
"javascriptEnabled" : true,
"acceptSslCerts" : false,
"phantomjs.binary.path" : "phantomjs.exe"
}
},
"chrome" : {
"desiredCapabilities": {
"browserName": "chrome",
"javascriptEnabled": true,
"acceptSslCerts": false
}
}
}
}
If I change "start_process" to true I get the following error:
[17:10:04] Using gulpfile ~\Desktop\CPIC.UI.Web\gulpfile.js
[17:10:04] Starting 'run-e2e-tests'...
[17:10:04] log file
[17:10:04] Starting nightwatch...
[CPIC E2e Test] Test Suite
==========================
Running: CPIC integration
Error retrieving a new session from the selenium server
Error: connect ECONNREFUSED 127.0.0.1:4444
at Object.exports._errnoException (util.js:874:11)
at exports._exceptionWithHostPort (util.js:897:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1063:14)
Connection refused! Is selenium server started?
[17:10:06] 'run-e2e-tests' errored after 1.5 s
[17:10:06] Error in plugin 'gulp-nightwatch'
Message:
nightwatch exited with code 1
The e2e test run as expected but I would like to run both the web server and the selenium server from Gulp automatically as part of my CI process.

I got it to work! Basically if you install selenium and phantomjs via npm something is wrong so you have to manually download them and set the paths int the nightwatch.js configuration file:
{
"src_folders" : [
"bundle/e2e_test/"
],
"output_folder": false,
"selenium" : {
"start_process" : true,
"server_path" : "./selenium-binaries/selenium-server-standalone-2.47.1.jar"
},
"test_settings" : {
"default" : {
"silent": true,
"screenshots" : {
"enabled" : false
},
"desiredCapabilities": {
"browserName": "phantomjs",
"javascriptEnabled" : true,
"acceptSslCerts" : false
}
},
"phantomjs" : {
"desiredCapabilities": {
"browserName": "phantomjs",
"javascriptEnabled" : true,
"acceptSslCerts" : false,
"phantomjs.binary.path" : "./selenium-binaries/phantomjs.exe"
}
}
}
}
To run the web server and kill it I used 3 tasks ans run-sequence:
gulp.task("run-e2e-tests", function (cb) {
runSequence(
"run-http-server",
"run-nightwatch",
"kill-http-server",
cb);
});
gulp.task("run-nightwatch", function () {
return gulp.src('')
.pipe(nightwatch({
configFile: "nightwatch.json",
cliArgs: {
env: "phantomjs"
}
}));
});
gulp.task("run-http-server", function () {
return connect.server({
port: 8888
});
});
gulp.task("kill-http-server", function () {
return connect.serverClose();
});

Related

Is There a Problem with my Nightwatch.conf.js file?

I have been attempting to setup an automated testing framework for my job, and nodejs testing has seemed to be the best option for future scalability. Plus, I am attempting to stretch myself into new areas of QA.
I have setup my Nightwatch framework with npm install commands and manually installed the most up-to-date chrome drivers, and selenium standalone executables. I have attempted to ensure that my nightwatch.conf.js file is completely setup to run my first test with google chrome, but I get this error:
⚠ Error connecting to localhost on port 4444.
_________________________________________________
TEST FAILURE: 1 error during execution; 0 tests failed, 0 passed (249ms)
✖ GoogleTest
An error occurred while retrieving a new session
Error: An error occurred while retrieving a new session
at endReadableNT (internal/streams/readable.js:1327:12)
at processTicksAndRejections (internal/process/task_queues.js:80:21)
Error: An error occurred while retrieving a new session
at endReadableNT (internal/streams/readable.js:1327:12)
at processTicksAndRejections (internal/process/task_queues.js:80:21)
SKIPPED:
- Basic Google search
Which seems to be pretty generic. As per normal Nightwatch setup, I created a root folder called 'Automation' where I stuck my bin folder for the drivers and selenium framework. Inside of the 'Automation' folder I also have my nightwatch.conf.js file that I've setup (Let me know if its more helpful if I paste its code in here). In order to run my test, I use the npx nightwatch command, but I continue to get this error.
From what I can tell it may be due to me trying to run the tests locally, but I can't think of a way that I would configure the selenium service to accept local ports other than how it's been setup.
I don't know if this is a well formatted description of the problem, so I apologize in advance if this is super vague. If there's anything else I can do to help clear it up let me know.
Thank you!
Update Conf.js File
// Autogenerated by Nightwatch
// Refer to the online docs for more details: https://nightwatchjs.org/gettingstarted/configuration/
const Services = {}; loadServices();
module.exports = {
// An array of folders (excluding subfolders) where your tests are located;
// if this is not specified, the test source must be passed as the second argument to the test runner.
src_folders: ["tests"],
// See https://nightwatchjs.org/guide/working-with-page-objects/
page_objects_path: '',
// See https://nightwatchjs.org/guide/extending-nightwatch/#writing-custom-commands
custom_commands_path: '',
// See https://nightwatchjs.org/guide/extending-nightwatch/#writing-custom-assertions
custom_assertions_path: '',
// See https://nightwatchjs.org/guide/#external-globals
globals_path : '',
webdriver: {},
test_settings: {
default: {
disable_error_log: false,
launch_url: 'https://nightwatchjs.org',
screenshots: {
enabled: false,
path: 'screens',
on_failure: true
},
desiredCapabilities: {
browserName : 'chrome'
},
webdriver: {
start_process: true,
server_path: (Services.chromedriver ? Services.chromedriver.path : '.Automation/bin/chromedriver.exe')
}
},
safari: {
desiredCapabilities : {
browserName : 'safari',
alwaysMatch: {
acceptInsecureCerts: false
}
},
webdriver: {
port: 4444,
start_process: true,
server_path: '/usr/bin/safaridriver'
}
},
firefox: {
desiredCapabilities : {
browserName : 'firefox',
alwaysMatch: {
// Enable this if you encounter unexpected SSL certificate errors in Firefox
// acceptInsecureCerts: true,
'moz:firefoxOptions': {
args: [
// '-headless',
// '-verbose'
],
}
}
},
webdriver: {
start_process: true,
port: 4444,
server_path: (Services.geckodriver ? Services.geckodriver.path : './Automation/bin/geckodriver.exe'),
cli_args: [
// very verbose geckodriver logs
// '-vv'
]
}
},
chrome: {
desiredCapabilities : {
browserName : 'chrome',
chromeOptions : {
// This tells Chromedriver to run using the legacy JSONWire protocol (not required in Chrome 78)
w3c: true,
//More info on Chromedriver: https://sites.google.com/a/chromium.org/chromedriver/
args: ['disable-gpu', 'no-sandbox', 'headless']
}
},
webdriver: {
start_process: true,
port: 9515,
server_path: (Services.chromedriver ? Services.chromedriver.path : './Automation/bin/chromedriver.exe'),
cli_args: [
// --verbose
]
}
},
//////////////////////////////////////////////////////////////////////////////////
// Configuration for when using the browserstack.com cloud service |
// |
// Please set the username and access key by setting the environment variables: |
// - BROWSERSTACK_USER |
// - BROWSERSTACK_KEY |
// .env files are supported |
//////////////////////////////////////////////////////////////////////////////////
browserstack: {
selenium: {
host: 'hub-cloud.browserstack.com',
port: 443
},
// More info on configuring capabilities can be found on:
// https://www.browserstack.com/automate/capabilities?tag=selenium-4
desiredCapabilities: {
'bstack:options' : {
local: 'false',
userName: '${BROWSERSTACK_USER}',
accessKey: '${BROWSERSTACK_KEY}',
}
},
disable_error_log: true,
webdriver: {
keep_alive: true,
start_process: false
}
},
'browserstack.chrome': {
extends: 'browserstack',
desiredCapabilities: {
browserName: 'chrome',
chromeOptions : {
// This tells Chromedriver to run using the legacy JSONWire protocol
// More info on Chromedriver: https://sites.google.com/a/chromium.org/chromedriver/
w3c: true,
args: ['disable-gpu', 'no-sandbox', 'headless']
}
}
},
'browserstack.firefox': {
extends: 'browserstack',
desiredCapabilities: {
browserName: 'firefox'
}
},
'browserstack.ie': {
extends: 'browserstack',
desiredCapabilities: {
browserName: 'IE',
browserVersion: '11.0',
'bstack:options' : {
os: 'Windows',
osVersion: '10',
local: 'false',
seleniumVersion: '3.5.2',
resolution: '1366x768'
}
}
},
//////////////////////////////////////////////////////////////////////////////////
// Configuration for when using the Selenium service, either locally or remote, |
// like Selenium Grid |
//////////////////////////////////////////////////////////////////////////////////
selenium: {
// Selenium Server is running locally and is managed by Nightwatch
selenium: {
start_process: true,
port: 4444,
server_path: (Services.seleniumServer ? Services.seleniumServer.path : './Automation/bin/selenium-server-standalone-3.141.59.jar'),
cli_args: {
'webdriver.gecko.driver': (Services.geckodriver ? Services.geckodriver.path : './Automation/bin/geckodriver.exe'),
'webdriver.chrome.driver': (Services.chromedriver ? Services.chromedriver.path : './Automation/bin/chromedriver.exe')
}
}
},
'selenium.chrome': {
extends: 'selenium',
desiredCapabilities: {
browserName: 'chrome',
chromeOptions : {
w3c: true,
args: ['disable-gpu', 'no-sandbox', 'headless']
}
}
},
'selenium.firefox': {
extends: 'selenium',
desiredCapabilities: {
browserName: 'firefox',
'moz:firefoxOptions': {
args: [
// '-headless',
// '-verbose'
]
}
}
}
}
};
function loadServices() {
try {
Services.seleniumServer = require('selenium-server');
} catch (err) {}
try {
Services.chromedriver = require('chromedriver');
} catch (err) {}
try {
Services.geckodriver = require('geckodriver');
} catch (err) {}
}
What I will suggest is to create a create a new file for Nightwatch.conf.js and then start adding rest of the configuration from there. Below is an example which works for me:
module.exports = {
src_folders: ["tests"],
skip_testcases_on_fail: false,
page_objects_path: "pageObjects",
custom_commands_path: "./commands",
screenshots: {
enabled: true,
path: "./screenshots",
on_failure: true,
on_error: true
},
test_settings: {
default: {
desiredCapabilities: {
browserName: 'chrome',
chromeOptions: {
prefs: {
download: {
default_directory: require('path').resolve(__dirname + '/download')
}
}
},
},
webdriver: {
start_process: true,
port: 4444,
server_path: require('chromedriver').path,
}
},
test_workers: {
enabled: true,
workers: 'auto'
},
safari: {
desiredCapabilities: {
browserName: 'safari',
alwaysMatch: {
acceptInsecureCerts: false
}
},
webdriver: {
port: 4445,
start_process: true,
server_path: '/usr/bin/safaridriver'
}
},
firefox: {
desiredCapabilities: {
browserName: 'firefox'
},
webdriver: {
start_process: true,
port: 4446,
server_path: require('geckodriver').path
}
}
}
}
The Nightwatch JS, chromedriver, geckodriver are installed using the npm commands. Since I am using a mac I just needed to enable the safari webdriver.
npm install nightwatch --save-dev
npm install geckodriver --save-dev
npm install chromedriver --save-dev
safaridriver --enable
This is the full repo if you want to have a look: https://github.com/alapanme/NightwatchJS
Also if you need the detailed steps how I setup Nightwatch on my machine you can refer: https://testersdock.com/nightwatch-js-installation/

Run nightwatch in jessie through headless chrome

I have started a jessie clean vps and then I installed node.js. After that I installed nightwatch and chromedriver through npm. I made 3 files, they are nightwatch.js, nightwatch.json, and js sample testing.
Here is my nightwatch.json:
{
"src_folders" : [""],
"custom_commands_path" : "",
"custom_assertions_path" : "",
"page_objects_path" : "",
"globals_path" : "",
"selenium" : {
"start_process" : true,
"server_path" : "./selenium-server-standalone-3.0.1.jar",
"log_path" : "",
"host": "127.0.0.1",
"port" : 4444,
"cli_args" : {
"webdriver.chrome.driver" :
"./node_modules/chromedriver/lib/chromedriver/chromedriver"
}
},
"test_settings" : {
"default" : {
"launch_url" : "http://localhost",
"selenium_port" : 4444,
"selenium_host" : "localhost",
"silent": true,
"screenshots" : {
"enabled" : false,
"path" : ""
},
"desiredCapabilities": {
"browserName": "chrome",
"chromeOptions" : {
"args" : ["headless", "--no-sandbox"]
}
}
}
}
}
And for sample testing, it's just a simple testing like this:
var chromedriver = require('chromedriver');
module.exports = {
before : function(done) {
chromedriver.start();
},
after : function(done) {
chromedriver.stop();
},
'Trial' : function (browser) {
browser
.url('http://www.google.com')
.waitForElementVisible('body', 1000)
.setValue('input[type=text]', 'nightwatch')
.waitForElementVisible('button[name=btnG]', 1000)
.click('button[name=btnG]')
.pause(1000)
.assert.containsText('#main', 'Night Watch')
.end();
}
};
Here is what I got:
And everytime I run the test, it seems like the headless browser doesn't work properly. Nightwatch cannot recognize every element. When I do .assert.title('Google'), it returns 'Object not found'. I have tested it on windows and it worked smoothly. Is there something that I miss? Is it necessary to use chrome binary when I run it headlessly?

Issues running nightwatch + selenium on local docker pipelines

I am having issues when running a simple nightwatch test file on my local Docker image. I am trying to figure out why selenium does not want to run the local tests. If anyone has figured this out, any help would be much appreciated. Thanks!
Here is my test file:
nw-example.test.js
module.exports = {
'End-to-end all browsers' : function (browser) {
browser
.init('http://localhost:3000/')
.setValue('#loginForm-username', '')
.setValue('#loginForm-password', '')
.pause(2000)
.click('#loginForm-submit')
.perform(function(done){
console.log('Done testing')
done()
})
.pause(3000)
.assert.containsText('#app','Welcome,');
}
};
Here is my nightwatch.json file:
{
"src_folders" : ["tests"],
"output_folder" : "reports",
"custom_commands_path" : "",
"custom_assertions_path" : "",
"page_objects_path" : "",
"globals_path" : "",
"selenium" : {
"start_process" : true,
"server_path" : "",
"log_path" : "",
"port" : 4444,
"cli_args" : {
"webdriver.chrome.driver" : "./usr/local/bin/chromedriver",
"webdriver.gecko.driver" : "./usr/local/bin/geckodriver",
"webdriver.edge.driver" : "",
"webdriver.safari.driver" : ""
}
},
"test_settings" : {
"default" : {
"launch_url" : "http://localhost:3000",
"selenium_port" : 4444,
"selenium_host" : "localhost",
"silent": true,
"screenshots" : {
"enabled" : false,
"path" : ""
},
"desiredCapabilities": {
"browserName" : "chrome",
"javascriptEnabled" : true,
"marionette" : true,
"acceptSslCerts" : true
}
},
"chrome" : {
"desiredCapabilities": {
"browserName": "chrome",
"chromeOptions" : {
"args" : ["headless", "--no-sandbox"]
}
}
},
"firefox" : {
"desiredCapabilities": {
"browserName": "firefox"
}
},
"edge" : {
"desiredCapabilities": {
"browserName": "MicrosoftEdge"
}
},
"safari" : {
"desiredCapabilities": {
"browserName": "safari",
"javascriptEnabled": true
}
}
}
}
And the errors I am getting:
root#2b755e5a6174:/vital-webapp/src/__tests__# nightwatch nw-example.test.js
[Nw Example Test] Test Suite
================================
Running: End-to-end all browsers
20:13:49.642 INFO - Found handler: org.openqa.selenium.remote.server.commandhandler.BeginSession#2465e6e1
20:13:49.643 INFO - /session: Executing POST on /session (handler: BeginSession)
20:13:49.646 INFO - Capabilities are: Capabilities {acceptSslCerts: true, browserName: chrome, javascriptEnabled: true, marionette: true, name: Nw Example Test}
20:13:49.646 INFO - Capabilities {acceptSslCerts: true, browserName: chrome, javascriptEnabled: true, marionette: true, name: Nw Example Test} matched class org.openqa.selenium.remote.server.ServicedSession$Factory (provider: org.openqa.selenium.chrome.ChromeDriverService)
Starting ChromeDriver 2.35.528139 (47ead77cb35ad2a9a83248b292151462a66cd881) on port 4516
Only local connections are allowed.
20:13:59.737 WARN - timeout
java.net.SocketTimeoutException: timeout
The error says it all :
20:13:49.646 INFO - Capabilities are: Capabilities {acceptSslCerts: true, browserName: chrome, javascriptEnabled: true, marionette: true, name: Nw Example Test}
20:13:49.646 INFO - Capabilities {acceptSslCerts: true, browserName: chrome, javascriptEnabled: true, marionette: true, name: Nw Example Test} matched class org.openqa.selenium.remote.server.ServicedSession$Factory (provider: org.openqa.selenium.chrome.ChromeDriverService)
Starting ChromeDriver 2.35.528139 (47ead77cb35ad2a9a83248b292151462a66cd881) on port 4516
Only local connections are allowed.
20:13:59.737 WARN - timeout
java.net.SocketTimeoutException: timeout
While you configured ChromeDriver you have suplied the following desiredCapabilities :
"desiredCapabilities": {
"browserName" : "chrome",
"javascriptEnabled" : true,
"marionette" : true,
"acceptSslCerts" : true
}
ChromeDriver have no such capability as "marionette" which is set to true.
Remove the capability "marionette" : true and execute your #Test

Nightwatch : Error retrieving a new session from the selenium server

I have a simple test to open the launch_url in chrome. But I am getting error as cannot retrieve any new session.
Also I would like to know how can I use nightwatch without running in grid. Just a standalone instance.
Below is the configuration I have used.
{
"src_folders" : ["tests"],
"output_folder" : "reports",
"custom_commands_path" : "",
"custom_assertions_path" : "",
"page_objects_path" : "",
"globals_path" : "",
"selenium" : {
"start_process" : false,
"server_path" : "./bin/selenium-server-standalone-3.4.0.jar",
"log_path" : "",
"port" : 4444,
"cli_args" : {
"webdriver.chrome.driver" : "./bin/chromedriver.exe",
"webdriver.gecko.driver" : "",
"webdriver.edge.driver" : ""
}
},
"test_settings" : {
"default" : {
"launch_url" : "http://127.0.0.1",
"selenium_port" : 4444,
"selenium_host" : "127.0.0.1",
"silent": true,
"screenshots" : {
"enabled" : false,
"path" : ""
},
"desiredCapabilities": {
"browserName": "firefox",
"marionette": true
}
},
"chrome" : {
"desiredCapabilities": {
"browserName": "chrome",
"javascriptEnabled": true,
"acceptSslCerts": true
}
},
"edge" : {
"desiredCapabilities": {
"browserName": "MicrosoftEdge"
}
}
}
}
When I run nightwatch using the command nightwatch --env chrome or simply nightwatch, it gives me the below error
[Test1] Test Suite
======================
Running: Demo test
http://127.0.0.1
Error retrieving a new session from the selenium server
Connection refused! Is selenium server started?
{ status: 13,
value:
{ message: 'Error forwarding the new session Empty pool of VM for setup Capabilities [{acceptSslCerts=true, marionette=true, name=Test1, browserName=chrome, javascriptEnabled=true, platform=ANY}]',
class: 'org.openqa.grid.common.exception.GridException' } }
My Test looks something like
module.exports = {
'Demo test' : function (browser) {
console.log(browser.launchUrl);
browser
.url(browser.launchUrl)
.end();
}
};
I can see that the launch url is been logged into the console, but the browser is not starting. I am using the latest jar file and the chromedriver binary.
I just now gave this a try and here's what I have figured out
In your selenium configuration section I am seeing that you have set start_process as false.
"selenium" : {
"start_process" : false,
"server_path" : "./bin/selenium-server-standalone-3.4.0.jar",
"log_path" : "",
"port" : 4444,
"cli_args" : {
"webdriver.chrome.driver" : "./bin/chromedriver.exe",
"webdriver.gecko.driver" : "",
"webdriver.edge.driver" : ""
}
},
When you have the value as false, you can essentially get rid of this section itself (because its not going to be used at all per your configuration)
You are essentially telling nightwatch that it shouldn't try and start a selenium-server by itself but it should just connect to the selenium server running on port 4444 (These values are obtained from default section of your test_settings section
"default" : {
"launch_url" : "http://www.google.com",
"selenium_port" : 4444,
"selenium_host" : "127.0.0.1",
"silent": false,
"screenshots" : {
"enabled" : false,
"path" : ""
},
"desiredCapabilities": {
"browserName": "firefox",
"marionette": true
}
},
So far we are good. So before you ran nightwatch command am guessing you started the selenium server but in the incorrect mode.
I think you started the server using the below command
java -jar selenium-server-standalone-3.4.0.jar -role hub
This causes a Hub to be started. A Hub is like a manager. It cannot do the work (of launching browsers, opening urls, typing texts, clicking links etc) on its own. It needs a node to be available so that it can route all of its work to the node.
The error Error forwarding the new session Empty pool of VM for setup Capabilities [{acceptSslCerts=true, marionette=true, name=Nightwatchtest, browserName=firefox, javascriptEnabled=true, platform=ANY}]' is essentially the Selenium Grid's way of telling you, that you haven't wired in any nodes for it to route the traffic to.
So in order to fix your issue, you can do one of the following:
Start the selenium server in the standalone mode [neither as a Hub or as a node], using the command java -jar selenium-server-standalone-3.4.0.jar (or)
Flip the flag start_process to true in your configuration file, which will cause nightwatch to start and stop the server on its own.

microsoft edge and nightwatch

for some reason, I have not been able to get tests working in Microsoft Edge Windows 10.
Here's my nightwatch config
"edge": {
"use_ssl": false,
"silent": true,
"output": true,
"desiredCapabilities": {
"browserName": "MicrosoftEdge",
"platform": "Windows 10",
"version": "13.10586",
"screenResolution": "1280x1024",
"avoidProxy": true
}
}
Has anyone been able to get their tests working in Microsoft Edge?
If so, what version of selenium do you use? I use 2.52
What version of the edge driver do you use?
First of all you need Microsoft Edge Webdriver. You may download it from here: https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/
Then in nigthwatch.js config you need to specify path to you edge webdriver (webdriver.edge.driver arg). This is how my config looks like:
"selenium": {
"start_process": true,
"server_path": "./node_modules/file_dependencies/selenium-server-standalone.jar",
"log_path": "",
"host": "127.0.0.1",
"port": seleniumPort,
"cli_args": {
"webdriver.chrome.driver": "./node_modules/file_dependencies/chromedriver.exe",
"webdriver.ie.driver": "./node_modules/file_dependencies/IEDriverServer.exe",
"webdriver.edge.driver": "C:/Program Files (x86)/Microsoft Web Driver/MicrosoftWebDriver.exe",
"webdriver.gecko.driver": "./node_modules/file_dependencies/geckodriver.exe",
"webdriver.firefox.profile": ""
}
}
Rest of your config looks fine
I had issues getting edge to work using Selenium 3.9.1 where Selenium was attempting to use the geckodriver to run tests against Edge.
My configuration looked as follows (snippet to keep to the point):
"selenium" : {
"cli_args" : {
"webdriver.chrome.driver" : "bin\\chromedriver.exe",
"webdriver.edge.driver" : "bin\\MicrosoftWebDriver.exe",
"webdriver.gecko.driver" : "bin\\geckodriver.exe",
"webdriver.firefox.profile": ""
}
},
"test_settings" : {
"default" : {
"desiredCapabilities": {
"browserName": "edge",
"marionette": true
}
}
}
I was able to get around this by changing "edge" to "ie" and the browser name to "internet explorer" - see the updated configuration:
"selenium" : {
"cli_args" : {
"webdriver.chrome.driver" : "bin\\chromedriver.exe",
"webdriver.ie.driver" : "bin\\MicrosoftWebDriver.exe",
"webdriver.gecko.driver" : "bin\\geckodriver.exe",
"webdriver.firefox.profile": ""
}
},
"test_settings" : {
"default" : {
"launch_url" : "http://localhost",
"selenium_port" : 4444,
"selenium_host" : "localhost",
"silent": true,
"screenshots" : {
"enabled" : false,
"path" : ""
},
"desiredCapabilities": {
"browserName": "internet explorer",
"marionette": true
}
}
}
The auto-generated nightwatch.conf.js already includes configuration for Edge browser, so you can just run by flagging the edge environment:
nightwatch --env edge