We’re super excited to announce the release of Nightwatch v3. It that has been built around these three pillars:
-
Developer Experience: The entire experience from getting started, to writing and debugging tests, has been redesigned for speed, stability, and consistent non-flaky results.
-
Mobile first: Test your web or native, iOS and Android, mobile applications on simulators, real mobile devices or a cloud grid like BrowserStack.
-
One test automation framework: Run all types of tests from unit, component, and E2E to API, visual, and accessibility with a single framework.
New features
New element APIs
With Nightwatch v3, we have revamped the element API to make test authoring simpler and more concise. Learn more
More rich & powerful selectors
New selectors are introduced as part of this latest versions
.findByText()
.findByPlaceholderText()
.findByAltText()
.findByRole()
You can also chain selectors to find elements that are more complex to find
For E.g.
browser.element.find('CSS Selector').findByText('text').click();
Performance improvements
Nightwatch v3 has implemented worker threads for parallel runs and we have observed improvements of up to 25% between Nightwatch v2 & v3. Try it now
Nightwatch inspector
Nightwatch v3 introduces a point and click tool that can help you easily find selectors. It will improve your productivity of authoring tests & help you find durable selectors for lower long term maintenance. Learn more
Angular component testing
With Nightwatch v3 you can test Angular components in isolation by mounting them in the browser. Try it now
Test doubles
The unit testing with Nightwatch got an upgrade as v3 introduced test doubles. You can use mocks, stubs & spies in your Nightwatch tests.
Fixes
-
Fix: incorrect build duration in HTML Report by @vaibhavsingh97 in #3658
-
Fix #3484 Added elementId only param in moveTo command by @harshit-bs in #3517
-
Fix xPath selectors to locate within elements. by @garg3133 in #3672
Other Improvements
-
Upgrade selenium to 4.10.0 by @AutomatedTester in #3705
-
Types migration from definitely typed to Nightwatch project by @beatfactor in #3714
-
Remove dependency on driver binaries, fallback to selenium-manager by @swrdfish in #3717
-
Add the ability to rerun failed tests by @prudhvi22 in #3703
Breaking changes
We have tried to ensure that there are no breaking changes while upgrading to v3. However, in case you need migration assistance please reach out to us on our new Nightwatch v3 channel on Discord