What’s new in Nightwatch: April 2023
Latest updates, features and releases in the month from April 2023
Welcome to the eighth post in a monthly series that summarises the happenings in the world of Nightwatch in the previous month and helps you test better.
NEW FEATURES AND RELEASES
Nightwatch V3 Beta!
We have launched our Beta program for NightwatchJS v3! This has been a long time in the works and am proud of what all the contributors have put into this.
You can install it easily through this command: npm install nightwatch@beta
TypeScript Improvements
There have been a lot, and I mean a lot, of improvements in the TypeScript space within the Nightwatch Project. We have moved all the DefinitelyTyped files within our project while we start the long hard job of converting our 8 year old code base to TypeScript.
If you are moving to Nightwatch V3 Beta you will need to remove @types/nightwatch from your package.json.
Selenium Manager
As part of Selenium 4 there has been work by Boni Garcia to ship a Rust binary to help with the management of driver so you don’t need to. We’ve all been there trying to automate Google Chrome or Microsoft Edge and the driver complains that it won’t work with an updated browser., This is automatically taken care of with the Selenium Manager, which is now available in Nightwatch. All you need to do is update to the latest Beta, remove dependencies for ChromeDriver and GeckoDriver, and let the magic happen.
Element APIs
We’ve added new Element APIs to help you find elements on the page. This allows you to be much more granular when finding elements with all the usual flake prevention code you have become used to in Nightwatch!
Below are a few example tests from our community repository.
There are also a large number of bug fixes that have gone in.
Nightwatch v2.6.21
We have also released v2.6.21 as it has a number of cool features that we wanted people to be able to use without the fear of jumping to the beta.
I should point out that there are no breaking changes from 2.6 to 3.0!
Rerun Failed Tests
We have added a new CLI command called `--rerun-failed` that will rerun failed parts of a test suite. This is part of some of the work the team have been doing with the BrowserStack Test Observability team. Join the Webinar to see it in action.
Finally…
We have done a number of significant updates and releases across the various projects we manage. Make sure you update to the latest versions! We have a number of great features coming over the next month.
Tell us your suggestions on Github or if you want to discuss something with us or have ideas to improve this post, hit us up on Discord. P.s. If you become our 300, 400, 500, and so on, member on Discord, we’ll send you a small gift!
Check out more updates in our release notes.