Skip to content

Update dependency nightwatch to v2

renovate-bot requested to merge renovate/nightwatch-2.x into develop

This MR contains the following updates:

Package Type Update Change
nightwatch (source) devDependencies major 0.9.21 -> 2.3.3

Release Notes

nightwatchjs/nightwatch

v2.3.3

Compare Source

Improvements

  • Added support for using native mobile drivers (#​3335)
  • Added new cli flag --list-files (#​3246)
  • Added support to retain the html report between test runs (#​3309)

Fixes

  • Fixed #​3304 - added buildname to settings when running on Browserstack
  • Fixed #​3301 - awaited asserts used inside custom commands were hanging the test run
  • Fixed #​3257 - expect.elements(..).count should be 0 if element not found

v2.3.0

Compare Source

New feature

Improvements & Fixes

v2.2.3

Compare Source

  • Fixed #​3183 – setting chromeOptions in older format didn't work
  • Fixed #​3130 – an issue with setting the driver service port number in case of parallel runs with test workers
  • Fixed #​3096 – an issue with session request redirection when using SauceLabs
  • Fixed #​3264 – HTML reporter raw http logs were failing to escape html
  • Added support for .mockNetworkResponse() to accept relative urls (to launch_url setting)
  • Other – Upgraded selenium-webdriver version to 4.3.1 (#​3278)

v2.2.2

Compare Source

Important fixes
  • Fixed #​2975expect.element().to.not.be.present throws error when the element is not present
  • Fixed – an issue with persisting http data for the HTML reporter
New features

The new Nightwatch init CLI tool is now available to use in order to kick-start a new Nightwatch test project in under 60 seconds.

Simply run:

npm init nightwatch
Nightwatch CLI tool preview

Release notes for create-nightwatch: https://github.com/nightwatchjs/create-nightwatch/releases/tag/v1.0.0

Other
  • Downgraded selenium to 4.1.1 to mitigate a chromedriver startup issue

v2.2.1

Compare Source

The latest release introduces a new built-in HTML reporter and several new API commands based on the Chrome Devtools Protocol for mocking network responses, capturing logs, and more.

Improvements

Other

  • Added support to find frame when passing argument as id or name - #​3205
  • Upgraded selenium-webdriver to v4.2.0 - #​3215

v2.1.8

Compare Source

  • Added - platform methods in case of Appium client (#​3166)
  • Fixed - an issue with generating XML output for when running tests in parallel (#​3163)

v2.1.7

Compare Source

  • Upgraded the global package to fix an issue on windows

v2.1.5

Compare Source

  • Fixed #​3127 -- skipped count was incorrect in global reporter results
  • Fixed #​3163 -- a circular reference issue occurring sometimes when running tests in parallel
  • Added support to throw an error when passing undefined args in sendKeys command (#​3045)
  • Added support to find frame when passing argument as id or name (#​3097)
  • Added update to browserstack transport and built-in config (#​3148)
  • Added support for marking test scenarios passed/failed and send reason to Browserstack while using Cucumber as a test-runner (#​3132)

v2.1.4

Compare Source

  • Fixed #​3033 – global element() was ignoring the global locate strategy
  • Fixed #​3138 -- Unhandled rejection while using expect assertions in an async test step

v2.1.3

Compare Source

  • Fixed #​3159 - updated ejs to avoid a high severity vulnerability
  • Fixed #​3154 - updated peer dependency version of chromedriver

v2.1.2

Compare Source

v2.1.1

Compare Source

v2.1.0

Compare Source

The Nightwatch 2.1 release adds a few important fixes and several improvements, including upgrade to Selenium 4.1.1. Here's the full list:

Improvements

describe('sample with relative locators', function () {
  before(browser => browser.navigateTo('https://archive.org/account/login'));
  
  it('locates password input', function (browser) {
    const passwordElement = locateWith(By.tagName('input')).below(By.css('input[type=email]'));

    browser
      .waitForElementVisible(passwordElement)
      .expect.element(passwordElement).to.be.an('input');

    browser.expect.element(passwordElement).attribute('type').equal('password');
  });
});

  • New error stack trace output which parses and highlights the source code line – #​3071

image

  • Set network emulation settings in Chrome/Edge with the .setNetworkConditions() command (#​2996)

browser.setNetworkConditions({ 
  offline: false, 
  latency: 5, // Additional latency (ms). 
  download_throughput: 500 * 1024, // Maximal aggregated download throughput. 
  upload_throughput: 500 * 1024 // Maximal aggregated upload throughput. 
});

  • Automate the input of basic auth credentials with the .registerBasicAuth() command (Chrome/Edge) (#​3116)

browser
     .registerBasicAuth('test-username', 'test-password')
     .navigateTo('http://browserspy.dk/password-ok.php');

Important Fixes

  • Fixed #​3079 – unable to clear element in setValue command
  • Fixed #​3085 – failing waitFor commands did not failed the test when using the cucumber built-in runner
  • Fixed #​3124 - multiple terminal windows opening when running in Chrome on Windows
  • Fixed #​3086 - 'RangeError: Maximum call stack size exceeded' when requiring unknown modules

v2.0.10

Compare Source

Fixed an issue occurring when using the Mocha integrated test runner and a test failure was logged in an async testcases.

v2.0.9

Compare Source

  • Fixed #​3077 - an issue with page navigate where the url was defined as a function

v2.0.8

Compare Source

This releases adds a few important fixes and improvements. We have made sure that Nightwatch works very well when using the Selenium 4 server in standalone mode and we've added several improvements and fixes for when using Mocha as a test runner.

Users of Selenium Server can now install our own jar download library from NPM and then use it in Nightwatch with no other config necessary. Make sure that chromedriver or geckodriver are also installed from NPM. You can install the Selenium Server with:

npm i @​nightwatch/selenium-server
Fixes
  • Fixed #​3054 – default port was not updated for some commands when running in parallel mode
  • Fixed #​3052 – Running Nightwatch with Selenium Server 4 in standalone mode
  • Fixed #​3055 – Missing error message in case of overwriting an existing command
  • Fixed #​3050 – required definition of package.json in current directory
  • Fixed #​3075 - an unhandledRejection was occurring when assertion fails while in async mode and if followed by other chained assertions
  • Fixed #​3074 - chrome CDP commands loading was throwing an error
Improvements

v2.0.7

Compare Source

  • Fixed #​3031 - unable to start selenium server from nightwatch on windows

v2.0.6

Compare Source

v2.0.5

Compare Source

  • Added several improvements to better support component testing (d8dec00)
  • Added added an improvement for external globals to be persisted properly (af54791)

v2.0.4

Compare Source

  • Fixed an issue with expect not rejecting the promise correctly and causing an unhandledRejection (a17a7ac)
  • Added support for expect.element().an() to accept case-insensitive tag names and regular expressions (efb6f10)

v2.0.2

Compare Source

v2.0.1

Compare Source

v1.7.13

Compare Source

v1.7.12

Compare Source

v1.7.11

Compare Source

  • This version is only updating the proxy-agent dependency package to the latest version.

v1.7.10

Compare Source

  • Fixed #​2899 – an issue with setValue/sendKeys commands
  • Added new updateValue command

v1.7.9

Compare Source

  • Fixed an issue where selenium_host config property wasn't set (#​2892 )
  • Added support to set browserName to null in order to accommodate Appium (#​2882)

v1.7.8

Compare Source

  • Fixed #​2777 – an issue with using Chrome and Edge in parallel (#​2790)
  • Fixed #​2794 – using .verify asserts with await or waitFor commands with abortOnFailure=false didn't work in case of test failure (#​2802, #​2797)
  • Fixed #​2817 – inconsistent response format when using findElements command (#​2820)
  • Added support to send last error as failure reason in Browserstack transport (#​2778)

v1.7.7

Compare Source

  • Fixed #​2748 - tests not running in parallel when source folder is specified as cli argument

v1.7.6

Compare Source

  • Fixed #​2755 – npm postinstall issue on windows

v1.7.5

Compare Source

  • Fixed an issue with parallel running where the number of available workers wasn't set correctly in some cases - 7754054
  • Fixed xml output generation when running tests with multiple environments in parallel (#​2734)

v1.7.3

Compare Source

Nightwatch v1.7

New features

Nightwatch v1.7.0 introduces a few major new features and improvements for the test runner and also regarding the test syntax, such as:

Fluent API

It is now possible to use ES6 async/await syntax and also chain api commands together in the same test case; e.g.:

it('find elements example', async function(browser) {
    const resultElements = await browser
      .url('https://nightwatchjs.org')
      .findElements('.features-container li');

    resultElements.forEach(item => console.log('Element Id:', item.getId()))
});
Integrated support for Microsoft Edge

You can now use the newer (Chromium-based) Microsoft Edge browser to run your Nightwatch tests. The auto-generated nightwatch.conf.js already includes configuration, so you can just run by passing the edge environment:

$ nightwatch --env edge
Parallelism for Firefox, Chrome, Safari, and Edge

You can now run tests in parallel via workers in any browser. Not only that, but now you can also run via test workers across multiple browsers in parallel.

Example:

$ nightwatch --env edge,firefox,chrome --parallel

New API commands

  • .findElement() / .findElements() - these commands provide improved support for locating single/multiple elements on the page; the response contains the web element id and a .getId() convenience method.

Example:

const resultElements = await browser.findElements('.features-container li');
resultElements.forEach(item => console.log('Element Id:', item.getId()))

const resultElement = await browser.findElement('.features-container li:first-child');
console.log('Element Id:', resultElement.getId());
  • .setPassword - support to redact params in logs (#​2672)
  • .isSelected() element command and assert.selected() assertion
  • .isEnabled() element command and assert.enabled() assertion

Fixes & Improvements

  • Added support to recursively append properties from super-env in test-settings (#​2718)
  • Fixed #​2695 - use locate strategy from args when valid strategy is found for waitFor element commands (#​2716)
  • Fixed #​2677 - add option to disable loading of typescript tests
  • Fixed an issue where test status wasn't reported for parallel runs (#​2733)

v1.7.2

Compare Source

Minor update to the auto-generated nightwatch config.

v1.7.1

Compare Source

This is a minor update to increase the default timeout option for browserstack in the auto-generated nightwatch config.

v1.7.0

Compare Source

This is a pre-release version for v1.7.3

v1.6.4

Compare Source

  • Fixed #​2402 - screenshots are not captured in some cases when failure occurs
  • Fixed #​2508 - add timestamp in currentTest result
  • Fixed #​2001 - add stackTrace for no element found errors

v1.6.3

Compare Source

  • Fixed #​2532 - passing a custom message with only time(%d) placeholder
  • Fixed #​2627 - an issue with custom commands written in Typescript
  • Fixed an issue where passing timeout and retryInterval as element properties in assertions didn't work (#​2637)

v1.6.2

Compare Source

  • Added filename_format config option for setting the filename format of the screenshots -- #​2023 (see docs

v1.6.1

Compare Source

  • Fixed #​2624 - use locate strategy from config as default for page object elements

v1.6.0

Compare Source

  • Added #​2559 – support for using TypeScript (.ts) for test files
  • Added #​2616 – support for using config locate strategy as default for page object element selectors
  • Fixed #​2573 – an issue where result of element() and elements() commands where inconsistent when used on section elements
  • Fixed #​2522 – an issue where element results where incorrect for Safari in BrowserStack
  • Fixed #​2582 – making sure the test results are not discarded when an uncaught exception occurs.

v1.5.1

Compare Source

  • Fixed #​2529 - false warnings about settings being defined in globals

v1.5.0

Compare Source

Nightwatch v1.5 introduces support for using third-party automation libraries directly into Nightwatch tests, thus providing significantly more flexibility in writing custom commands/assertions and also the test itself. This functionality also aims to eliminate some of the burden in choosing between various frameworks, by providing the possibility to combine the functionality offered by other libraries, such as selenium-webdriver or WebdriverIO, with Nightwatch.

Other fixes and improvements:
  • Fixed #​2245 - test_settings is undefined in global before hook
  • Added --parallel cli flag for easier running of tests with test workers – 5cfc278
  • Added a config setting to display timestamps in iso format – 1dad022

v1.4.3

Compare Source

  • Fixed #​2489 - api commands throwing TypeError when called inside page section custom commands
  • Fixed #​1969 - element selectors from page sections not working when used in custom commands

v1.4.2

Compare Source

  • Fixed #​2488 - 'element not found' errors thrown by JsonWire protocol for /element requests were not ignored
  • Fixed an issue where the WebElement ID is not retrieved correctly when using chrome with selenium server and jsonwire transport

v1.4.1

Compare Source

  • Fixed #​2486 - mocha test runner was unavailable.

v1.4.0

Compare Source

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.

Changelog:
  • Added improved http request retry mechanism and better error reporting for api commands – a04162c
  • Added enhancements to assist in writing of custom commands – c977b16
  • Added 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) – #​2459
  • Fixed an issue with merging the config settings when passed programmatically – #​2483
  • Fixed an issue where transport was set incorrectly for Chrome when using chromeOptions.w3c:trued56a9db
  • Fixed an issue where the locator strategy was not taken into account when specifying first argument in a waitFor* command – #​2446
  • Fixed #​2458 - implemented proper handling of 5xx server errors sometimes encountered during element commands, usually when using cloud testing services or selenium grid

v1.3.7

Compare Source

Added new setting test_workers.node_options to enable passing node options to individual test worker processes. Usage:

  • This will pass all of 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',
},
  • This will pass only the specified cli options:
test_workers: {
    enabled: true,
    workers: 'auto',
    // selectively pass node arguments to individual worker processes
    node_options: ['--inspect']
},

v1.3.6

Compare Source

  • Fixed #​2417 - --filter argument was ignored if both --filter and --skiptags are set
  • Fixed - an issue occurring when using --filter argument and an empty src_folders setting - b2c2daa
  • Added - improved jUnit reporting for assertions in before/after test hooks - 0cc3627
  • Added - stripping of ansi control characters in jUnit xml reports and improved currentTest api property - 0cc3627
  • Fixed - an issue with running tests using the describe interface more than once in the same test run - cb1221d
  • Fixed - a problem with using the global --timeout argument in some cases - 1b3abcd
  • Fixed - an issue where a failed assertion inside the after test hook would have blocked the test run - 1e11032
  • Fixed - displaying the correct error message in case of using an unknown api assertion (e.g. due to a typo) - abaaaf8
  • Fixed - remove the isVisible workaround for Safari lower than v12 - c8e34b2

v1.3.5

Compare Source

  • Fixed #​2365 - Removed deprecated optimist package and updated implementation of cli help display;
  • Fixed an issue with specifying a non-default port to geckodriver and chromedriver;
  • Fixed a potential issue when not specifying a callback to some element protocol actions;
  • Fixed #​2375 - remove incorrect cli args from safaridriver.

v1.3.4

Compare Source

  • Fixed #​2294: ES6 async/awaits does not work with browser.elements()

v1.3.3

Compare Source

  • Fixed #​2286 - es6 await commands not working on page objects
  • Fixed #​2269 - negate (".not") assertions not working with page objects
  • Added - cli option for showing timestamp in logs - #​2268
  • Added error messages in JUnit xml report - #​2131

v1.3.2

Compare Source

  • Fixed #​2263 - custom commands when called on sections without element ids
  • Fixed #​2262 - keys() command stopped working due to a regression

v1.3.1

Compare Source

  • Fixed #​2255 - callback not being called when errors occurred during an element command;
  • Added improvements for the auto-generated nightwatch.conf.js file

v1.3.0

Compare Source

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.

More details

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.

Fixes

  • Fixed #​2219 - an issue with locating elements from page object sections using non @​-based element identifiers
  • Fixed getElementSize and getLocation commands for w3c webdriver clients - #fd10c9b

v1.2.4

Compare Source

  • Added the module path of the testsuite in the test results object - #​2207

v1.2.3

Compare Source

Fixed #​2190 - test error/failure stack traces weren't showing correctly

v1.2.2

Compare Source

  • Added - new configuration settings to for fine tuning the Webdriver server process:
  • status_poll_interval - Interval (in ms) to use between status ping checks when checking if the Webdriver server is up and running
  • max_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 status

More details

v1.2.1

Compare Source

New commands

Added several new commands in-line with the W3C Webdriver API:

Improvements

  • waitForElementVisible doesn't throw an error anymore if the element cannot be found - #​2148
  • Added W3C Webdriver API compatibility support for .timeouts() command;
  • Added suppressNotFoundErrors option for element selector properties to enable suppressing NoSuchElement errors when element is not found for commands such as .click() or .getText() etc.

Fixes

  • Fixed #​2155 - an issue with page object element selectors
  • Fixed #​2165 - an issue with page object relative urls
  • Fixed #​1301 - an issue with using .perform() with async callback
  • Fixed #​2168 - setWindowSize for geckodriver

v1.1.13

Compare Source

  • Fixed #​2141 - .verify assertions not working correctly

v1.1.12

Compare Source

  • Fixed #​2123 - the .init() command was broken starting with v1.1.8
  • Fixed #​2118 - Set default POST body to be empty JSON in order to use chromedriver 75 If using Chromedriver 75 you need to set the following capabilities in your config:
desiredCapabilities : {
  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
  }
}

v1.1.11

Compare Source

  • Fixed element commands (e.g. getText) not being able to be used with ES6 async/await
  • Fixed an issue with using assert.elementPresent/elementNotPresent with W3C Webdriver
  • Fixed #​2104 - an issue with waitForElement commands being called with a custom message
  • Fixed #​2101 - a problem with loading custom commands located in sub-folders of the initial source folder(s)
  • Fixed #​2099 - an issue with creating custom commands by extending built-in waitForElement commands

v1.1.10

Compare Source

  • Fixed #​2087 - an exception occured when creating screenshots in some cases
  • Added support for Firefox to be used in parallel environment runs (i.e. multiple browsers)

v1.1.9

Compare Source

  • Fixed #​2091 - an issue with waitForElementNotPresent causing the test to fail immediately if the element is found, without retrying;
  • Added support for Safari to use W3C Webdriver protocol by default;
  • Added support for using protocol element commands directly on the page object sections:
const homepage = client.page.home();
const navigation = homepage.section.navigation;
navigation.api
  .elementIdElements('@​versionDropdown', 'css selector', 'option', function(result) {
    console.log('result', result);
  });

Checkout the nightwatch-website-tests example tests also for more usage details.

v1.1.8

Compare Source

  • Added support for ES6 async/await custom commands (such as this example); previously async/await support was limited to testcases;
  • Fixed error handling for some cases when session was not created in Chrome and the error wasn't reported, unless you were in verbose mode;
  • Fixed #​2079 - a regression which was causing waitForElementNotPresent command to not mark the assertion as failed when the element was still present after the timeout;
  • Fixed #​2018 - calling custom commands on page objects would fail if first argument is an array (e.g. when using execute).

v1.1.7

Compare Source

  • Fixed #​2077 - an issue with nested page objects

v1.1.6

Compare Source

  • Fixed #​1990 - loading of page objects from nested folders
  • Added - support for relative urls in page objects

v1.1.5

Compare Source

v1.1.3

Compare Source

  • Fixed #​2047 - .frame() or .frame(null) does not switch to top-level default context
  • Fixed an issue which was preventing latest geckodriver to start in standalone mode

v1.1.2

Compare Source

  • Fixed #​2066 waitForElementNotPresent always waits until the timeout value.

v1.1.1

Compare Source

  • Fixed #​2069 - waitForElementVisible issue when the element is not found

v1.1.0

Compare Source

This version brings several performance enhancements for interacting with elements and some new features.

Improved element interaction stability

We have improved the mechanism used to interact with elements when using commands like click or setValue by adding automatic retries in case the element is not found or if the element reference has become stale. This will improve the overall stability of tests.

Support for ES6 Async functions

You can now use await operator for retrieving the result of commands such as isVisible or getValue. Please see Using ES6 Async/Await for more details.

New expect Apis
Page Objects Improvements

v1.0.19

Compare Source

Fixes
  • Fixed #​2004 - failing test generates invalid XML report file;
  • Fixed #​1993 - External globals are not merged with existing globals
  • Fixed #​1991 - No tests are run if --skiptags is used in a package.json script
  • Fixed #​1987 - can't start tests when directories in src_folders contain empty subfolders
  • Fixed #​1861 - global reporter in parallel running mode
  • Fixed #​1989 - an issue with elementIdValue()
  • Fixed #​1976 - an issue with using frame(0)
  • Fixed #​1955 - screenshots attachment path not being added for failed assertions and errors in the JUnit XML report file
Improvements
Added support for passing multiple comma-separated tags as --tag argument which will act as an AND selection #​955


Usage:

  • AND tags: --tag this,and,that
  • OR tags: --tag this --tag that
  • AND and OR tags combined: --tag this,and,that --tag something,else

v1.0.18

Compare Source

  • Fixed #​1965 - a problem with the test runner hanging when after a failure inside a custom command;
  • Fixed #​1962 - selenium_port setting being ignored;
  • Fixed a problem with incorrectly reporting errors after a passed assertion.

v1.0.17

Compare Source

  • Fixed #​1948 - disable test_workers mode when used together with multiple environments
  • Fixed #​1947 - a problem with testsuite before/after hooks when called without the callback

v1.0.16

Compare Source

Public release of Nightwatch v1.0

v1.0.15

Compare Source

  • Fixed #​1938 - an issue with the queue causing an uncaught exception.
  • Added improved support for running tests using Safari driver

v1.0.14

Compare Source

  • Fixed #​1874 - failing to create a new session on a selenium grid with firefox
  • Added support for page object commands to be defined as an object instead of an array of objects

v1.0.13

Compare Source

v1.0.12

Compare Source

  • Fixed #​1906 - a problem with setting abortOnFailure
  • Fixed #​1864 - using Edge with external selenium cloud services
  • Fixed #​1881 - .click() and .clearValue() when using geckodriver directly
  • Added support to load all commands onto page objects
  • Added support for proper expanding of page object elements when used on custom commands or custom assertions

v1.0.11

Compare Source

  • Added error handling for unknown expect properties.
  • Added titleContains assertion
  • Fixed #​1863 - a problem with saveScreenshot command
  • Fixed #​1864 - an issue with parsing the element JSONWire response

v1.0.10

Compare Source

  • Added compatibility support for execute() and alert specific commands with W3C WebDriver
  • Fixed #​1865 - an issue with using exclude filters
  • Added switchWindow command support for GeckoDriver - #​1869

v1.0.9

Compare Source

  • Fixed an issue with incorrectly passing the context to callbacks of elements protocol actions
  • Fixed #​1862 - an issue with saving junit xml reports on windows
  • Added argument validation for element protocol actions which receive a web element ID
  • Fixed #​1858 - using --reporter option throws error
  • Fixed #​1835 - issue with loading non js custom assertion files

v1.0.8

Compare Source

  • Fixed #​1808 - loading custom commands on page objects.

v1.0.7

Compare Source

  • Fixed an issue which was causing problems with starting chromedriver
  • Fixed some webdriver compatibility issues (setvalue and switchWindow)
  • Fixed a regression issue regarding the log_screenshot_data option when taking screenshots
  • Added support for managing the safaridriver service.

v1.0.6

Compare Source

  • Fixed #​1786 - an issue with the transport protocol when connecting to an external Selenium service

v1.0.5

Compare Source

  • Fixed #​1779 - unable to set output folder
  • Fixed #​1793 - optimist module missing

v1.0.4

Compare Source

  • Slightly improved error handling and fixed a problem with passing the correct context to callbacks.

v1.0.3

Compare Source

v1.0.2

Compare Source

v1.0.1

Compare Source

A significant update from previous 0.x versions featuring a complete rewrite of the entire codebase and also including some new features. The main focus has been on improving the underlying architecture, therefore this release includes mostly fixes and improvements, but also a few brand new features. Please see the upgrade guide for details on breaking changes and how to migrate from v0.9.

WebDriver Integration
  • ChromeDriver and GeckoDriver Integration - Nightwatch now manages ChromeDriver and GeckoDriver processes directly, similarly to the Selenium Server is managed. The webdriver configuration settings may be used to control this behaviour, e.g.:
"webdriver" : {
  "start_process": true,
  "server_path": "./path/to/chromedriver"
}

For a complete list of available config settings (until the docs get updated on the website), refer to the default settings.

It's important to note that, while the Selenium Server was required with older Nightwatch versions (v0.9 and prior) and continues to work with v1.0, starting with version 1.0 Selenium is completely optional and only required in a Selenium Grid environment.

Page Objects Improvements
  • object-based element selectors optional, object-based selector values in commands - see #​1156
  • index property to element objects - allows the option of specifying an index property in element objects for pages or element commands - see #​1115
New Mocha Implementation

For cases when Mocha is used as a test runner, a new adapter has been introduced in place of the mocha-nightwatch package. This is however in experimental stages.

New programatic API

There has been some demand for a proper programatic API, through which Nightwatch may be used without a configuration file. Nightwatch exports now a new runTests() public method which may be used for such purposes.

The settings object inherits from the default settings mentioned above.

const Nightwatch = require('nightwatch');

Nightwatch.runTests('/path/to/tests_folder', {
  // various settings
}).then(function() {
  // Tests finished
}).catch(function(err) {
  // An error occurred
});

The programatic API is being used extensively in the unit/integration tests, e.g. in test/src/runner/testRunTestsuite.js

Other Fixes and Improvements:
  • concurrency - improved support for running tests in parallel using test workers and test environements;
  • test hooks - fixed a number of bugs related to test and global hooks;
  • retries - better support for test case and test suite retries;
  • error handling - improved error handling support which should help with identifying problems inside tests.
  • filters - improved support for using filter and exclude properties.

This release also paves the way for our own upcoming, Nightwatch dedicated, cloud testing service - NightCloud.io.

Known Issues and Limitations
  • running in parallel (e.g. with test workers) is not yet available when using GeckoDriver directly, however it is OK for when using Selenium and GeckoDriver combined;
  • socket hang up error while running ChromeDriver, managed by Nightwatch - occasionally ChromeDriver will abort the connection with this error and the process might be left hanging. A possible workaround might be specifying the --no-sandbox cli argument to ChromeDriver, like so:
"desiredCapabilities" : {
  "browserName" : "chrome",
  "chromeOptions": {
    "args" : ["--no-sandbox"]
   }
}
  • GeckoDriver is not yet feature complete regarding WebDriver API support and thus may not be on par with ChromeDriver regarding commands support;
  • Other driver implementations, such as Safari or Edge, have not yet been properly tested, nor integration with cloud testing providers, like BrowserStack or SauceLabs.

Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this MR and you won't be reminded about this update again.


  • If you want to rebase/retry this MR, click this checkbox.

This MR has been generated by Renovate Bot.

Merge request reports