Skip to main content

Authentication with NightWatchJS

Authentication can be done either with a username and password or with an accessKey.

The username and password or accessKey can be passed as part of the capabilities.

Capabilities authentication ​

For username and password, use the following convention:

nightwatch.conf.js

exports.config = {
......
test_settings : {
default : {
......
desiredCapabilities : {
username : <cloudUsername>,
password : <cloudPassword>,
projectName : <cloudProject>,
.....
}
}
}
...
}

For accessKey, use the following convention:

nightwatch.conf.js

exports.config = {
......
test_settings : {
default : {
......
desiredCapabilities : {
.....
accessKey: <accessKey>,
.....
}
}
}
...
}