Working nightwatch browser automated testing example using TypeScript.
yarn install
the first time to install dependencies (or usenpm install
etc).yarn start
to run the tests (automatically downloads selenium and chromedriver if missing).yarn prettier
to automatically format your code (done automatically before commit).
- Uses TypeScript & includes type definitions (based on npm-nightwatch) for nightwatch.js for nice auto-completion and it's harder to shoot oneself in the leg.
- Uses prettier to enforce common formatting between developers.
- Use VSCode with prettier plugin for best experience.
- Prettier is automatically run before each commit so the styles are enforced even if not using VSCode/Atom etc with the appropriate plugins.
- Uses selenium-download to automatically download selenium binary and chrome driver if does not already exist.
- Uses node-config for powerful configuration management.
- The configuration typings are defined in
src/config/config.dt.ts
, edit this file to reflect the needed structure. - The default configuration is in
src/config/default.ts
. This should be checked into the repository. - Developers can create a
src/config/local.ts
with similar structure and only define the properties that are different than the default configuration to override them. This file should not be checked in.