Test

Unit Tests

There is a quite extensive suite of Unit Tests that are provided along with the code to help your development.

These tests are defined using Karma as test runner and Jasmine as assertion library. Test are defied along with the code, you can look for any .spec.ts file in the source tree.

You can execute them in two flavors:

  • Single run (this is the same flavor that is used on Jenkins): npm test
  • Watch mode: npm run test:auto

While developing the GUI we'll suggest you to run the test in watch mode, and they'll be executed anytime a file changes. It will help you in catchings bugs immediately. It also provide more information on which tests are executed.

End to End Tests

There is a suite of basic end to test that are defined using protractor, an AngularJs oriented version of Selenium.

These tests can be found in the e2e folder.

NOTE: Require protractor to be installed as a global module.

Setup

webdriver-manager update
webdriver-manager start

Run the tests

NOTE: These tests are designed to work with the Mock R-CORD config

protractor conf/protractor.conf.js

Other paramenters you can pass are:

Variable NameDescription
UI_URLAddress of the GUI (deaults to http://192.168.46.100/spa/#
UI_PWDPassword to login (needed only for remote connections)
TIMEOUTTime allowed for each test

Test suites

If you need to run test for only a particural suite you can use:

protractor conf/protractor.conf.js --suite login

Suites are defined in cong/protractor.conf.js