Skip to content

DEFRA/trade-imports-frontend-tests

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

92 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

trade-imports-frontend-tests

This repository runs frontend tests against the btms-portal-frontend service.

Local Development

Requirements

Node.js

Please install Node.js >= v20 and npm >= v9. You will find it easier to use the Node Version Manager nvm

To use the correct version of Node.js for this application, via nvm:

nvm use

Setup

Install application dependencies:

npm install

Copy .env.example to .env and fill out the configuration.

Running local tests

To run the tests locally, you will first need to clone btms-local-environment and run the following command:

docker compose up -d

Next, in this repository you will need to add/update your local .env file with the following values:

ENVIRONMENT=local
ServiceBus__Notifications__ConnectionString=<get_this_from_imports_process_terminal_via_cdp>

And lastly, run the following command and this should run the tests locally

npm run test:local

Debugging local tests

npm run test:local:debug

Running BrowserStack tests

npm run test:browserstack

Production

Running the tests

Tests are run from the CDP-Portal under the Test Suites section. Before any changes can be run, a new docker image must be built, this will happen automatically when a pull request is merged into the main branch. You can check the progress of the build under the actions section of this repository. Builds typically take around 1-2 minutes.

The results of the test run are made available in the portal.

Requirements of CDP Environment Tests

  1. Your service builds as a docker container using the .github/workflows/publish.yml The workflow tags the docker images allowing the CDP Portal to identify how the container should be run on the platform. It also ensures its published to the correct docker repository.

  2. The Dockerfile's entrypoint script should return exit code of 0 if the test suite passes or 1/>0 if it fails

  3. Test reports should be published to S3 using the script in ./bin/publish-tests.sh

Licence

THIS INFORMATION IS LICENSED UNDER THE CONDITIONS OF THE OPEN GOVERNMENT LICENCE found at:

http://www.nationalarchives.gov.uk/doc/open-government-licence/version/3

The following attribution statement MUST be cited in your products and applications when using this information.

Contains public sector information licensed under the Open Government licence v3

About the licence

The Open Government Licence (OGL) was developed by the Controller of Her Majesty's Stationery Office (HMSO) to enable information providers in the public sector to license the use and re-use of their information under a common open licence.

It is designed to encourage use and re-use of information freely and flexibly, with only a few conditions.

About

Git repository for service trade-imports-frontend-tests

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages