Skip to content
This repository has been archived by the owner on Sep 2, 2023. It is now read-only.

Testing the Client

vhpoet edited this page Nov 6, 2014 · 5 revisions

Karma the Test Runner (unit testing)

Karma is used to run a web server that automates the testing process for the client app. By running the server and visiting it using a web browser the app can be tested on all supported desktop and mobile browsers.

Setting up Karma

Karma reads its configuration and pulls in all its dependencies from karma.conf.js, the file used to start the karma server. Run karma start with the path to the karma config file.

karma start test/karma.conf.js

Starting the Karma server should open a page in your default browser and run the test suite.

Protractor (e2e testing)

Protractor is an end-to-end test framework for AngularJS applications. Protractor is a Node.js program built on top of WebDriverJS. Protractor runs tests against applications running in a real browser, interacting with it as a user would.

Setting up Protractor

Protractor requires a webdriver (selenium) server to function.

sudo webdriver-manager update
webdriver-manager start

Copy the protractor.conf-example.js to protractor.conf.js assign your testing variables, and run protractor test/e2e/protractor.conf.js to start the test.