API status: In Development
This article explains the test system of the frontend. It is aimed at developers that want to work with the frontend, be it creating new plugins or applications or modifying existing code using BDD. Bringing a BDD testing infrastructure to the frontend is still a work in progress and subject to (breaking) changes. Please contribute to the stability by reporting any issues or ideas to me.
- Jasmine - JS BDD framework
- Karma Runner - test runner
- Chai.js - Assertion framework
Setting up your system
Before starting: Mac only
brew install phantomjs
...or link it in path and set executable bit on phantomjs binary yourself. After this follow the rest of the guide.
You need at least node version 0.8 to use the latest version of karma, which we need. Karma will be installed with all other development dependencies. So just make sure you ran
within your ui directory in the appsuite repository.
Running the tests
The recommended way to start testing is to run:
This will start a connect server, the karma test server and a watcher for changes. Optionally, it is possible to connect multiple browsers to the host running the karma server (port 9876). Tests will run in those browsers, too. You can trigger a test run manually by running:
in another terminal. This will be done automatically by the grunt watch task, after any source file of your project has been changed.