You are on page 1of 2

How to start testing using Nightwatch.

js
(https://medium.com/front-end-weekly/e2e-testing-with-nightwatch-part-one-309c221b7a98)

INSTALLATION
Steps:
1. Go to your terminal (cmd).
2. Create an empty directory and navigate to it.
3. Type npm init -y or yarn init -y The -y flag allows you to skip through the initialization questions.
A package.json file will be created at the root of the current directory.
4. Type npm install -g nightwatch to install nightwatch
5. in order to be able to run the tests, we need to download the Selenium standalone server.
6. type npm install selenium-standalone --save-dev or yarn add -D selenium-standalone.
This command will install selenium-standalone and also save it to your package.json file created
earlier.
7. Modify your package.json file by adding this: ”e2e-setup”: “node_modules/selenium-
standalone/bin/selenium-standalone install” to the scripts property. The package.json should look
more or less like this:

8. Running npm run e2e-setup or yarn run e2e-setup on the terminal will download the latest version
of selenium server, chromedriver, and geckodriver (this will be used for running tests in Chrome or
Firefox browser).
CONFIGURATION
Steps:
1.

You might also like