# Testing

# E2E Installation

A number of E2E tests have been added to this codebase which allow for rapid testing of the production codebase after deployments to Luminate. The testing architecture is CodeceptJS (opens new window) which leverages Selenium Server. To run these tests, do the following:

.env - Some of the tests require sensitive information like login credentials. In order to keep this info out of version control, you need to create a .env file in the root of this directory. You can then create environment variables in this file to reference in your test files. The .env has already been added to .gitignore. Here is an example of how to create vars inside of your .env file:

LOGIN_USER=username@example.com
LOGIN_PASSWORD=password123

At the top of your test file add this line require('dotenv').load();. You can then reference these variables inside of your tests like so process.env.LOGIN_USER. see login_test.js for examples.

  • Ensure latest dependencies have been installed (npm install).
  • Ensure selenium-standalone server globally (npm install -g selenium-standalone);
  • Run Selenium server's installation script (selenium-standalone install). Requires Java SDK to be installed on host.
  • Start Selenium server: selenium-standalone start
  • Execute test suite: npm run tests
  • If you want to run a single test, CodeceptJS Commands (opens new window). You will also need to install codecept globally to do this, or at least it will make things much easier npm install -g codeceptjs-webdriverio
  • if you are seeing this error regularly java.net.SocketException: Connection reset by peer (connect failed), try and install a different version of selenium. As of 1/17/18 these 2 commands solved this issue. selenium-standalone install --version=3.4.0 and selenium-standalone start --version=3.4.0