-
Notifications
You must be signed in to change notification settings - Fork 32
Running Tests
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.
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 aliasTo 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-protractorWebdriver 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 startYour 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 e2eTo generate a code coverage report for your unit tests, from the front-end directory run:
$: clever test coverageYour browser should open the following URL:
$: http://localhost:5555Then select your report from the list.
Prev: Modules | Next: Deployment