Skip to content
Daniel Durante edited this page Feb 10, 2014 · 2 revisions

At Clevertech we believe in testing our code as we develop, then if something breaks we know exactly where to start looking. Spending more time on developing the features we love.

Running Unit Tests

To run the unit tests for your app and modules, from the front-end/back-end root directory run:

$: clever test unit # or 'clever test' as an alias

Running E2E Tests

To setup your environment for e2e testing with Protractor run the following command. This will install Selenium Server (WebDriver), ChromeDriver & PhantomJS based on your OS. If you wish to run selenium server in a separate terminal then use Webdriver Manager (see below).

$: cd frontend
$: npm run-script setup-protractor

Using Webdriver Manager

Webdriver Manager comes shipped with protractor and installs selenium server & chrome driver for you. Selenium server can then run in a seperate terminal so when you run your e2e tests it doesn't need to boot up (saving heaps of time when running your e2e tests!). To set this up do the following:

$: npm install -g protractor
$: webdriver-manager update
$: webdriver-manager start

Your selenium server should be running in this terminal. Finally update your e2e test config file located: my-app/frontend/test-e2e.conf.js

// uncomment this line:
seleniumAddress: 'http://localhost:4444/wd/hub',

// comment these lines:
seleniumServerJar: ''
seleniumPort: ''
chromeDriver: ''

To run the end-to-end tests for your app and modules, from the front-end/back-end root directory run:

$: clever test e2e

Code Coverage Reports

To generate a code coverage report for your unit tests, from the front-end directory run:

$: clever test coverage

Your browser should open the following URL:

$: http://localhost:5555

Then select your report from the list.

Prev: Modules | Next: Deployment

Clone this wiki locally