{"id":24164467,"url":"https://github.com/defra/cdp-node-journey-test-suite-template","last_synced_at":"2025-08-10T22:48:03.942Z","repository":{"id":219111568,"uuid":"747740064","full_name":"DEFRA/cdp-node-journey-test-suite-template","owner":"DEFRA","description":"Git repository for cdp-node-env-test-suite-template","archived":false,"fork":false,"pushed_at":"2025-02-14T13:15:55.000Z","size":372,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-02-14T14:23:06.368Z","etag":null,"topics":["cdp","journey","template","test-suite"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DEFRA.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-24T14:49:52.000Z","updated_at":"2025-02-14T13:15:58.000Z","dependencies_parsed_at":"2024-02-19T10:27:57.634Z","dependency_job_id":"1b59aa54-30f4-45a4-b2d3-6564d5c8f883","html_url":"https://github.com/DEFRA/cdp-node-journey-test-suite-template","commit_stats":null,"previous_names":["defra/cdp-node-env-test-suite-template","defra/cdp-node-journey-test-suite-template"],"tags_count":4,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DEFRA%2Fcdp-node-journey-test-suite-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DEFRA%2Fcdp-node-journey-test-suite-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DEFRA%2Fcdp-node-journey-test-suite-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DEFRA%2Fcdp-node-journey-test-suite-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DEFRA","download_url":"https://codeload.github.com/DEFRA/cdp-node-journey-test-suite-template/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241469335,"owners_count":19968034,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cdp","journey","template","test-suite"],"created_at":"2025-01-12T19:09:18.662Z","updated_at":"2025-03-02T06:26:43.282Z","avatar_url":"https://github.com/DEFRA.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CDP Node.js Environment Test Suite Template\n\nThe template to create a service that runs WDIO tests against an environment.\n\n- [Local](#local)\n  - [Requirements](#requirements)\n    - [Node.js](#nodejs)\n  - [Setup](#setup)\n  - [Running local tests](#running-local-tests)\n  - [Debugging local tests](#debugging-local-tests)\n- [Production](#production)\n  - [Debugging tests](#debugging-tests)\n- [Licence](#licence)\n  - [About the licence](#about-the-licence)\n\n## Local Development\n\n### Requirements\n\n#### Node.js\n\nPlease install [Node.js](http://nodejs.org/) `\u003e= v20` and [npm](https://nodejs.org/) `\u003e= v9`. You will find it\neasier to use the Node Version Manager [nvm](https://github.com/creationix/nvm)\n\nTo use the correct version of Node.js for this application, via nvm:\n\n```bash\nnvm use\n```\n\n### Setup\n\nInstall application dependencies:\n\n```bash\nnpm install\n```\n\n### Running local tests\n\nStart application you are testing on the url specified in `baseUrl` [wdio.local.conf.js](wdio.local.conf.js)\n\n```bash\nnpm run test:local\n```\n\n### Debugging local tests\n\n```bash\nnpm run test:local:debug\n```\n\n## Production\n\n### Running the tests\n\nTests 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.\nYou can check the progress of the build under the actions section of this repository. Builds typically take around 1-2 minutes.\n\nThe results of the test run are made available in the portal.\n\n## Requirements of CDP Environment Tests\n\n1. Your service builds as a docker container using the `.github/workflows/publish.yml`\n   The workflow tags the docker images allowing the CDP Portal to identify how the container should be run on the platform.\n   It also ensures its published to the correct docker repository.\n\n2. The Dockerfile's entrypoint script should return exit code of 0 if the test suite passes or 1/\u003e0 if it fails\n\n3. Test reports should be published to S3 using the script in `./bin/publish-tests.sh`\n\n## Running on GitHub\n\nAlternatively you can run the test suite as a GitHub workflow.\nTest runs on GitHub are not able to connect to the CDP Test environments. Instead, they run the tests agains a version of the services running in docker.\nA docker compose `compose.yml` is included as a starting point, which includes the databases (mongodb, redis) and infrastructure (localstack) pre-setup.\n\nSteps:\n\n1. Edit the compose.yml to include your services.\n2. Modify the scripts in docker/scripts to pre-populate the database, if required and create any localstack resources.\n3. Test the setup locally with `docker compose up` and `npm run test:github`\n4. Set up the workflow trigger in `.github/workflows/journey-tests`.\n\nBy default, the provided workflow will run when triggered manually from GitHub or when triggered by another workflow.\n\nIf you want to use the repository exclusively for running docker composed based test suites consider displaying the publish.yml workflow.\n\n## BrowserStack\n\nTwo wdio configuration files are provided to help run the tests using BrowserStack in both a GitHub workflow (`wdio.github.browserstack.conf.js`) and from the CDP Portal (`wdio.browserstack.conf.js`).\nThey can be run from npm using the `npm run test:browserstack` (for running via portal) and `npm run test:github:browserstack` (from GitHib runner).\nSee the CDP Documentation for more details.\n\n## Licence\n\nTHIS INFORMATION IS LICENSED UNDER THE CONDITIONS OF THE OPEN GOVERNMENT LICENCE found at:\n\n\u003chttp://www.nationalarchives.gov.uk/doc/open-government-licence/version/3\u003e\n\nThe following attribution statement MUST be cited in your products and applications when using this information.\n\n\u003e Contains public sector information licensed under the Open Government licence v3\n\n### About the licence\n\nThe Open Government Licence (OGL) was developed by the Controller of Her Majesty's Stationery Office (HMSO) to enable\ninformation providers in the public sector to license the use and re-use of their information under a common open\nlicence.\n\nIt is designed to encourage use and re-use of information freely and flexibly, with only a few conditions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdefra%2Fcdp-node-journey-test-suite-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdefra%2Fcdp-node-journey-test-suite-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdefra%2Fcdp-node-journey-test-suite-template/lists"}