Integrated end-to-end testing framework written in Node.js and using W3C Webdriver API. Developed at @browserstack
MIT License
Bot releases are visible (Hide)
Published by beatfactor about 4 years ago
Published by beatfactor about 4 years ago
Published by beatfactor about 4 years ago
Published by beatfactor about 4 years ago
This version significantly improves the network stability and performance of the test runner, by improving the underlying http retry mechanism and error detection and reporting of API commands – a particularly important update for when using cloud testing services.
Additionally, we have added better support for writing advanced custom commands to make it easier to extend Nightwatch, and improved support for using Nightwatch programmatically. See writing custom commands docs page.
The Developer Guide docs also have been updated.
abortOnElementLocateError
global property to control if the testcase in progress should continue in the event of an element locate error (as a result of a click, getText, etc. command) – #2459chromeOptions.w3c:true
– d56a9db9e0a5a764bd96232ac859a40b7f69bf11Published by beatfactor about 4 years ago
Published by beatfactor about 4 years ago
Added new setting test_workers.node_options
to enable passing node options to individual test worker processes.
Usage:
process.execArgv
:test_workers: {
enabled: true,
// automatically compute the number of workers based on CPU cores
workers: 'auto',
// pass node arguments to individual workers (all of the process.execArgv)
node_options: 'inherit',
},
test_workers: {
enabled: true,
workers: 'auto',
// selectively pass node arguments to individual worker processes
node_options: ['--inspect']
},
Published by beatfactor over 4 years ago
--filter
argument was ignored if both --filter
and --skiptags
are set--filter
argument and an empty src_folders
setting - b2c2daa363c77f2e99c718e1cabdcd87c8f2c13ecurrentTest
api property - 0cc36278b07f3d1df95d5e5e27c2a8a9109e61c4describe
interface more than once in the same test run - cb1221de53e8e14dd88b409dd4a8d23ff69ecac1--timeout
argument in some cases - 1b3abcdf6474e8d56ba4c9900819b134e0dcf7bcafter
test hook would have blocked the test run - 1e1103282b7657a627fdb123453754e243940b24isVisible
workaround for Safari lower than v12 - c8e34b2f8e983e68c1cda89fb636c5b0f96c41e1Published by beatfactor over 4 years ago
optimist
package and updated implementation of cli help display;Published by beatfactor over 4 years ago
Published by beatfactor over 4 years ago
Published by beatfactor almost 5 years ago
keys()
command stopped working due to a regressionPublished by beatfactor almost 5 years ago
nightwatch.conf.js
filePublished by beatfactor almost 5 years ago
Added BDD describe interface for writing tests. No further configuration is necessary and both exports and bdd interfaces can be mixed together (though not in the same file).
More details
You can use .not assertions for every existing and custom assertion. Custom assertions will require to be updated to the new interface in order to make use of .not
. Refer to the Custom assertions docs for details.
module.exports = {
demoTest(browser) {
browser
.assert.not.elementPresent('.not_present') // previously .assert.elementNotPresent()
.assert.not.visible('.non_visible'); // previously .assert.hidden()
.assert.not.urlContains('http://');
// ...
}
}
--headless
- Launch the browser (Chrome or Firefox) in headless mode.--timeout
- Set the global timeout for assertion retries before an assertion fails. The various timeout values are defined in the Globals section.nightwatch
Test Runnernightwatch.conf.js
config file, based on the operation system and existing driver packages. More details
getElementSize
and getLocation
commands for w3c webdriver clients - #fd10c9b
Published by beatfactor about 5 years ago
Published by beatfactor about 5 years ago
Fixed #2190 - test error/failure stack traces weren't showing correctly
Published by beatfactor about 5 years ago
status_poll_interval
- Interval (in ms) to use between status ping checks when checking if the Webdriver server is up and runningmax_status_poll_tries
- Maximum number of ping status check attempts when checking if the Webdriver server is up and running before returning a timeout error.process_create_timeout
- The entire time (in ms) to wait for the Node.js process to be created and running (default is 2 min), including spawning the child process and checking the statusPublished by beatfactor about 5 years ago
Added several new commands in-line with the W3C Webdriver API:
waitForElementVisible
doesn't throw an error anymore if the element cannot be found - #2148.timeouts()
command;suppressNotFoundErrors
option for element selector properties to enable suppressing NoSuchElement
errors when element is not found for commands such as .click()
or .getText()
etc..perform()
with async callbacksetWindowSize
for geckodriverPublished by beatfactor over 5 years ago
.verify
assertions not working correctlyPublished by beatfactor over 5 years ago
.init()
command was broken starting with v1.1.8desiredCapabilities : {
browserName : 'chrome',
chromeOptions: {
w3c: false
}
}
Chromedriver 75 has W3C Webdriver protocol enabled by default, however we recommend sticking to the JSONWire for now as some endpoints aren't implemented yet (e.g. /displayed
). If using the default w3c webdriver mode, make sure to adjust the config like so:
{
capabilities: {
browserName : 'chrome',
},
webdriver: {
use_legacy_jsonwire: false
}
}
Published by beatfactor over 5 years ago
assert.elementPresent/elementNotPresent
with W3C Webdriver