What’s new in Nightwatch: November 2022
Latest updates, features and releases in the month from November 2022
Welcome to the fifth post in a monthly series that summarises the happenings in the world of Nightwatch and helps you test better.
NEW FEATURES AND RELEASES
In November we released Nightwatch 2.4. You can see the walk-through video below.
We also worked on the following!
Mobile Helper: A new way to test on mobile!
You can now run tests on Nightwatch-installed simulators or your own mobile device with the new mobile helper. You can use it as part of `npm init nightwatch@latest` as shown below
Or if you have an existing project you can run `npm i @nightwatch/mobile-helper` and then `npx @nightwatch/mobile-helper android` or `npx @nightwatch/mobile-helper ios`. It will ask you some questions and update your `nightwatch.conf.js` with some new environments.
Support for Nx
The Nightwatch project now has built-in support for monorepos, starting with Nx. If you’re using Nx you will need run the generator to create a new E2E application once you have installed `@nightwatch/nx` package.
To generate the project you will run `nx g @nightwatch/nx:nightwatch-project --name=toodoo-e2e` and it will add some template tests and get everything in place for you to run your tests!
Introducing API testing with Nightwatch
Testing APIs with NightwatchJS hasn’t always been obvious. We have introduced a new plugin that makes your life easier when doing API testing using Supertest. The new plugin has a built-in mock server with support for Sinon assertions on mocked HTTP requests. Below is an example of a test.
We would love to hear from you on our Discord once you start using it!
Advent of Testing
We know we normally only share items that have happened in the past but this one we hope to have you join in as it’s happening. #AdventOfTesting is a twitter series sharing some of our favourite things in NightwatchJS! If you’re on Twitter quote tweet your favourite one. We will be looking for our favourites and will send the winner a small gift!
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.