CMC feature toggle importing
500K+
This is the integration tests for CMC.
Relevant environment variables that will be pulled from your environment:
GOV_NOTIFY_API_KEY: a notify api key, you can generate your own once you get a notify account, or ask for one to be setup for youGOV_PAY_AUTH_KEY_CMC: payments sandbox API key, also ask around for itFirst step is to start the environment for the tests to execute against:
$ ./bin/start-local-environment.sh
If you see the command exit with messages like "service unhealthy" it may mean that docker has exceeded the container health check verifications limit. You can try re-running the command in that case, but if those messages persist then the problem is probably elsewhere.
After that you can run the tests:
$ ./bin/run-local-tests.sh
To run specific tests you can pass an argument to the run script:
$ ./bin/run-local-tests.sh 'CCJ'
You can use anything in the 'Scenario' or 'Feature' functions to target which tests to run.
If you want to shut down the environment use:
$ docker-compose down
This environment will not persist data between restarts, so when you start again you'll get a fresh environment.
To watch the tests executing there's a debug selenium server setup which has a VNC server on it
On mac run $ open vnc://localhost the password is: secret
For more information see: https://github.com/SeleniumHQ/docker-selenium#debugging
To open an interactive terminal for working with the claimstore containerised database:
docker-compose exec shared-database psql -U postgres -d claimstore
The first time you will need to create a user to login with Run:
$ ./bin/create-user.sh [optional-email] [optional-firstname] [optional-lastname] [optional-usergroup]
To use the compose files defined in the project to start a local development environment, use:
$ ./bin/start-local-environment.sh
This will:
citizen-frontend, you'll need to start that one on it's own,docker ps or read the compose file to see how the ports are mapped.To stop the environment use the same script, just make sure to pass the local parameter:
$ ./bin/stop-local-environment.sh
If you want to delete the volumes as well pass the -v flag:
$ ./bin/stop-local-environment.sh -v
If docker's local environments are already running, then execute following
$ ./bin/start-local-ccd-web.sh
else
$ ./bin/start-local-environment.sh
$ ./bin/start-local-ccd-web.sh
create caseworker user
$ ./bin/create-case-worker.sh
Open management web page http://localhost:3451 and login with user created above
To generate the CCD definition file from its JSON counterpart located under docker/ccd-definition-import/data/sheets and upload locally to the Dockerised CCD instance:
$ ./bin/update-ccd-definition-locally.sh
The newly generated CCD definition will be found under 'docker/ccd-definition-import/data/ccd-definition.xlsx'
To upload the CCD definition file found under 'docker/ccd-definition-import/data/ccd-definition.xlsx' to the designated environment:
Note: uploading to an environment requires azure-cli, jq and python3 to be installed.
$ ./bin/upload-ccd-definition-to-env.sh aat
If an error occurs try running the script with a -v flag after the script name
$ ./bin/upload-ccd-definition-to-env.sh -v aat
Update add-toggles.sh
$ ./bin/upload-feature-toggles-locally.sh
Note: uploading to an environment requires azure-cli to be installed.
All environments except production are currently set with a weight of 1.0 or 100% which means that all users who opt-in to new features will receive the feature.
Choose the weight you want for production and run the following:
./bin/upload-feature-toggle-to-all-envs.sh cmc_<feature-name> 'CMC <feature-description>' 0.2
To update a feature run the above script with new parameters
If an error occurs try running the script with a -v flag after the script name
$ ./bin/upload-feature-toggles-locally.sh -v
In order to run tests against different browsers in Saucelabs you'll need a slightly modified environment:
$ ./bin/cross-browser/start-environment.sh
Then to run tests:
$ ./bin/cross-browser/run-tests.sh
You'll need additional environment variables to be able to access Saucelabs, please refer to docker-compose.cross-browser.yml file for details.
We use TSLint and StandardJS.
Running the checks:
$ yarn lint
We use SemVer for versioning.
This project is licensed under the MIT License - see the LICENSE file for details.
docker pull hmcts/cmc-feature-toggle-importer:latest