New features
BDD describe Interface
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
assert.not Assertions
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://');
// ...
}
}
New APIs
Commands:
Assertions:
Expect:
Improvements
New CLI options:
--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 Runner
- Auto-generated configuration: if no existing config file is found in the current folder, Nightwatch will generate a
nightwatch.conf.js
config file, based on the operation system and existing driver packages. More details - Added support for http keepAlive which should be enabled when using remote testing services. See Configuration for details.
- Added several improvements for running tests against cloud testing provider Browserstack; see also an example configuration for using Browserstack.