Skip to content

Testing

Kevin Hannigan edited this page Mar 29, 2017 · 2 revisions

Protractor

Protractor is used for running our end to end tests

Setup

  1. Install protractor globally via npm install -g protractor
  2. Run webdriver-manager update. webdriver-manager is installed alongside protractor. It manages the selenium instance that protractor needs to connect to in order to run the tests.
  3. Run webdriver-manager start in a separate command window. This starts a selenium server, which will need to be running any time you want to run protractor
  4. Run protractor protractor.conf.js while in the base directory of our project. This will execute the protractor tests. You will see a browser window pop up and change as the tests are being run. Yes, it looks very cool, I agree.

Adding tests

Add a file or add to an existing file in /test/e2e/. Protractor runs all files in this folder. The existing tests, protractor documentation, and google should be enough for you to figure it out after looking around a bit. If you can't figure out how to add a test, consider doing a protractor tutorial elsewhere, or just do trial and error until you get it to work.

Karma

Karma is used for running our unit tests

Setup

Get npm dependencies

npm install

Get Karma CI

npm install -g karma-cli

Tests

Run Tests

karma start

Add Tests

Go to test/ folder.

Add a js file like so nameOfFileSpec.js. Always have Spec at the end of the file.

Clone this wiki locally