New features
The v2.4.0 release brings improved support for Component Testing, which includes:
@nightwatch/storybook
- new official plugin which integrates Nightwatch with Storybook
- adds ability to run component stories directly from Nightwatch, including:
- interaction tests using the
play()
function - run test hooks in the Nightwatch context
- run
test()
function in the Nightwatch context - run configured accessibility rules automatically using the
axe-core
suite of commands
- interaction tests using the
vite-plugin-nightwatch
- upgraded plugin to use Vite 3
@nightwatch/vue
- new dedicated Vue.js component testing plugin which includes Vite 3 and manages its own Vite dev server
@nightwatch/react
- added support for writing component tests using the Component Story Format which supports
JSX
directly
- added support for writing component tests using the Component Story Format which supports
New CLI flags
--serial
to run tests in serial mode (disable parallelism)--workers
to specify the number of test workers to be used when running tests in parallel--reuse-browser
to reuse the browser session if running in serial mode
component testing related
--debug
– automatically pause the test execution after mounting the component and open the Nightwatch debug REPL interface.--story
- allows to specify which story to run from the current file (when using Storybook or JSX written in component story format)--preview
- used to preview a component story/test; automatically pause the test execution after mounting the component.
Other Improvements
- Added support to use
--devtools
CLI flag in Edge and Safari to open the Dev Tools automatically - Added support to enable running tests in parallel by default if not set PR #3364
- Added support for using
nightwatch.conf.ts
as config file and a few other improvements for running typescript tests PR #3316