Skip to content

Latest commit

 

History

History
49 lines (33 loc) · 1.28 KB

README.md

File metadata and controls

49 lines (33 loc) · 1.28 KB

Selenium JS Example Project

This is a base project using the selenium-webdriver for JavaScript and Mocha to handle the tests and reporting.

Run Locally

  1. Install Mocha globally
$ npm install -g mocha
  1. Install cross-env to make sure Environment Variables are set correctly in each OS:
$ npm install -g cross-env
  1. Run all project dependencies:
$ npm install
  1. Run the following command to run the test:
$ npm run test

Configuration Overrides

All variables can be modified by changing the .env file with the appropiate files. The available environment variables to override are:

  • MOCHA_BROWSER: specifies the webdriver to use. Options are:

    • phantomjs
    • chrome
    • headlessChrome
    • firefox
    • opera
    • safari
    • ie
    • edge
  • TEST_BASE_URL: specifies which url the tests should run on.

CI Override

To change the variable during the CI process a special .env file can be found on the helpers folder, this has the same variables but the values are changed to keys so it can easily be replaced by any value.