-
Notifications
You must be signed in to change notification settings - Fork 1
Testing the front end
Tests are written in Jasmine and run with the Karma test runner.
To avoid Google Analytics errors while running Karma tests the value of analyticsKey
in the tracking-service.conf.json
file should be the string false
.
To run the tests:
npm test
To have karma watch for changes:
$ karma start
e2e tests use Protractor. To run them, make sure you are on node version 6. Then install dependencies:
$ npm node 6 (if you need to update it)
$ npm install
$ npm install gulp -g
$ npm install protractor -g
$ webdriver-manager update
To run the tests:
$ webdriver-manager start
Now open another terminal window. Make sure you gulp first before running e2e the first time.
$ gulp
Then you can run the e2e tests from gulp:
$ gulp e2e
To run the tests against a different server backend:
-
Edit bash_profile setting CEDAR_FRONTEND_TARGET to "local" or "staging":
export CEDAR_FRONTEND_TARGET="local" export CEDAR_FRONTEND_TARGET="staging"
-
Edit app/keycloak.json setting auth-server-url to local server or staging server:
"auth-server-url": "https://auth.metadatacenter.orgx/auth" "auth-server-url": "https://auth.staging.metadatacenter.org/auth"
Take a look at the following links for more information about writing tests for Protractor: