This directory contains End-to-end Automation Tests for the Immunisation FHIR API.
-
Follow the instructions in the root level README.md to setup the dependencies and create a virtual environment for this folder (
e2e_automation). -
Add values to the .env file.
For an example of a template .env file, see .env.example.
The following values should be added:
aws_token_refresh=True baseUrl=https://internal-qa.api.service.nhs.uk/immunisation-fhir-api/FHIR/R4 auth_url=https://internal-qa.api.service.nhs.uk/oauth2-mock/authorize token_url=https://internal-qa.api.service.nhs.uk/oauth2-mock/token callback_url=https://oauth.pstmn.io/v1/callback S3_env=internal-qa aws_profile_name={your-profile} -
Add login and secret values to the .env file.
Please contact the Imms FHIR API Test team to get these values.
The following values should be added:
username scope STATUS_API_KEY AWS_DOMAIN_NAME Postman_Auth_client_Id Postman_Auth_client_Secret RAVS_client_Id RAVS_client_Secret MAVIS_client_Id MAVIS_client_Secret EMIS_client_Id EMIS_client_Secret SONAR_client_Id SONAR_client_Secret TPP_client_Id TPP_client_Secret MEDICUS_client_Id MEDICUS_client_Secret -
Run
poetry install --no-rootto install dependencies. -
The
Makefilein this directory provides the following commands:
make test- run all tests (may take some time)make test-api-full- run API testsmake test-api-smoke- run API smoke tests only (quicker)make test-batch-full- run Batch testsmake test-batch-smoke- run Batch smoke tests only (quicker)make collect-only- check that all tests are discovered
The environment variables define a client ID and client secret for each of the Apigee test apps we use in static
environments such as internal-dev, internal-qa and so on.
However, creating pull requests will spin up a dynamic Apigee proxy and AWS backend which lives for the duration of the PR. To minimise admin overhead, the automation tests create dynamic applications for the duration of a test run rather than us having to manually create new apps each time we produce a pull request.
These tests are run seamlessly in the pipeline. But if you are doing some local changes and want to test against your PR environment, please follow these pre-requisites to get it working:
- Install and run the Apigee get_token tool to obtain an access token.
- Set this value against the
APIGEE_ACCESS_TOKENin your .env file. - Finally, use the .env.example.pr as your baseline for your .env file and fill all of the required values.
Note: the get_token tool is only supported in Linux environments, so if you are using a Windows environment, you will
at least need to run the operation in WSL to obtain the access token.