cerberus-service
Cerberus frontend service for cerberus-api
Requirements
- npm 6.9.0
- node v8.10.0
Index
- Getting started
- Native development
- Development with docker
- Tests in native development
- Linter in native development
- E2E tests in native development
Getting started
1. Clone this repo
Native development
2. Install dependencies
$ npm install
3. Add environment variables (you don't need to use export
on OSX)
$ export KEYCLOAK_AUTH_URL=https://your.sso.com/auth
$ export KEYCLOAK_CLIENT_ID=your-client-id
$ export KEYCLOAK_REALM=realm
$ export FORM_API_URL=https://form-api.example.com/
$ export REFDATA_API_URL=https://refdata-api.example.com/
$ export CERBERUS_API_URL=https://cerberus-api.example.com/
4. Build development bundle (optional)
$ npm run build:dev
5. Start the application (optional)
$ npm start
Development with docker
2. Build the application Docker container
docker build -t cerberus-service .
3. Run the resulting Docker container
docker run --name cerberus-service -p 8080:8080 \
--env KEYCLOAK_AUTH_URL=https://your.sso.com/auth \
--env KEYCLOAK_CLIENT_ID=your-client-id \
--env KEYCLOAK_REALM=realm \
--env FORM_API_URL=https://form-api.example.com \
--env REFDATA_API_URL=https://refdata-api.example.com \
--env CERBERUS_API_URL=https://cerberus-api.example.com \
cerberus-service
Tests in native development
Setup your environment as described in Native development
3. Running jest tests
npm test
Linter in native development
Setup your environment as described in Native development
3. Running linter
npm run lint -- <directory>
E2E tests in native development
Setup your environment as described in Native development
There are two ways to run cypress tests, using the cypress test runner or running cypress tests using the command line.
By default tests run against local environment.
NOTE: You will need, the cerberus-service application, to be running before triggering Cypress.
Running cypress test runner
Running all tests
npm run cypress:runner
Running all tests using environment settings from a configuration file
npm run cypress:runner -- --env configFile=dev
Once TestRunner launched, click on the interested spec inside folder cypress/integration/cerberus
Running cypress tests using the command line
Running all tests on local Environment, (It executes tests headless mode on Electron Browser)
npm run cypress:test:local
Running all tests on Development Environment, (It executes tests headless mode on Electron Browser)
npm run cypress:test:dev
Running a specific test
npm run cypress:test:local -- --spec cypress/integration/cerberus/tasks.spec.js
Running specific test with chrome browser
npm run cypress:test:local -- --browser chrome --spec cypress/integration/cerberus/task-management.spec.js