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 over 2 years ago
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.
Added new integrated HTML reporter with test status, assertion logs & raw HTTP logs - #3223; Read more
Added built-in API commands for working with the Chrome Devtools Protocol - #3208:
Added --mocha
cli flag to quickly switch the test runner to use Mocha
Added --open
cli flag to open the generated HTML report automatically
Added new integrated JSON reporter
Added support for using multiple reporters - #3003; to specify more reporters just add several --reporter
arguments, e.g.: nightwatch --reporter html --reporter junit --reporter custom-reporter
selenium-webdriver
to v4.2.0 - #3215Published by beatfactor over 2 years ago
Published by beatfactor over 2 years ago
global
package to fix an issue on windowsPublished by beatfactor over 2 years ago
This release only contains a few dependency updates, such as the ejs
package and the cucumber
peer dependency version which was causing issues in newer version of NPM.
Published by beatfactor over 2 years ago
sendKeys
command (#3045)Published by beatfactor over 2 years ago
Published by beatfactor over 2 years ago
ejs
to avoid a high severity vulnerabilityPublished by beatfactor over 2 years ago
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:
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');
});
});
.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.
});
.registerBasicAuth()
command (Chrome/Edge) (#3116)browser
.registerBasicAuth('test-username', 'test-password')
.navigateTo('http://browserspy.dk/password-ok.php');
setValue
commandPublished by beatfactor over 2 years ago
Fixed an issue occurring when using the Mocha integrated test runner and a test failure was logged in an async
testcases.
Published by beatfactor over 2 years ago
Published by beatfactor over 2 years ago
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
--parallel=<number of workers>
Published by beatfactor over 2 years ago
Published by beatfactor over 2 years ago
Published by beatfactor over 2 years ago
Published by beatfactor over 2 years ago
expect.element().an()
to accept case-insensitive tag names and regular expressions (efb6f109fb6475ef032359b04fb19b49940762ae)Published by beatfactor over 2 years ago
The public NPM release of Nightwatch 2.0 is here and can be installed directly with:
npm i nightwatch --save-dev
Over the past few weeks we have worked tirelessly to finalise the apis, add a few more examples, and try and smooth over any rough edges.
nightwatch.conf.cjs
as config file for projects that use ES Modules
chai expect
to version 5 and added support for using regular chai browser.expect()
assertions; this doesn't affect the existing expect.element()
, expect.elements()
, expect.cookie()
, expect.title()
, and expect.url()
.
const infoElement = element('.info');
expect(infoElement.property('innerHTML'))
.to.be.a('string')
.and.to.include('validation code');
See examples/tests/shadowRootExample.js for the complete example.--devtools
CLI flag to open the Chrome Devtools automaticallyPublished by beatfactor almost 3 years ago
Published by beatfactor almost 3 years ago
Published by beatfactor almost 3 years ago
We're delighted to present the first beta version of Nightwatch v2.0! Upcoming beta releases will incrementally be made available in NPM under the next tag, so in order to install it you'll have to run the following:
npm i nightwatch@next
Over the coming weeks we will also finish updating the documentation website with more pages in the Guide section and documenting the new APIs.
Since the previous alpha release we have only added a few improvements and several fixes. The fixes are mainly concerning working with the new element()
api and using cucumber-js.
src_folders
, page_object_path
, custom_commands_path
, custom_assertion_path
options – #2910;webdriver.log_file_name
setting to specify the filename where webdriver server logs should be written – 127760130341328010b9001598812916ace92363.click()
, e.g.:// with async
const elements = await browser.findElements('input');
await browser.click(elements[1]);
// with callback
browser.findElements('input', function(result) {
browser.click(result.value[1]);
});
getAttribute
command to use the W3C endpoint instead of the Selenium atom script - #2926;suiteRetries
– 127760130341328010b9001598812916ace92363We've also updated the bundled examples so do make sure to check those out in order to get a better feel about the new Nightwatch 2 features.
element()
global apiYou can run any of the examples by simply referring to the examples folder like below:
npx nightwatch examples/tests/angularTest.js
The bundled config file which is auto-generated by Nightwatch on the first run (only if one is not already present in the project), contains configuration and examples for running the CucumberJS examples immediately, using the following:
npx nightwatch --env cucumber-js
Published by beatfactor about 3 years ago
enable_fail_fast
setting and --fail-fast
cli argument to abort the test runner after a failed test suiteBelow are notable changes from the previous alpha version (2.0.0-alpha.3):
creatClient()
external method for programmatic usage; the new client now contains the following methods:
.launchBrowser()
)const Nightwatch = require('nightwatch');
const client = Nightwatch.createClient({
browserName: 'firefox',
headless: true
});
client.updateCapabilities({
testCapability: 'one, two, three'
});
const browser = await client.launchBrowser();
browser
object available as a globaldisable_colors
setting