diff --git a/.github/workflows/tests-cypress.yml b/.github/workflows/tests-cypress.yml index eaaa1f222c..ee8bfb7bad 100644 --- a/.github/workflows/tests-cypress.yml +++ b/.github/workflows/tests-cypress.yml @@ -16,7 +16,8 @@ jobs: - name: Start app run: | cp .env.sample .env - docker compose up --detach client server + docker compose up --detach server + docker compose run --detach --service-ports client bin/test_start.sh - name: Run Cypress tests uses: cypress-io/github-action@v6 diff --git a/bin/test_start.sh b/bin/test_start.sh new file mode 100755 index 0000000000..12c0ebeef5 --- /dev/null +++ b/bin/test_start.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash +set -eux + +# container startup script specifically for running Cypress tests +# needs to reset the DB with sample data and then start the app normally + +bin/reset_db.sh + +bin/start.sh diff --git a/docs/tests/automated-tests.md b/docs/tests/automated-tests.md index f8062b93d6..1b4e6e8947 100644 --- a/docs/tests/automated-tests.md +++ b/docs/tests/automated-tests.md @@ -21,25 +21,31 @@ will install `cypress` and its dependencies on your machine. Make sure to run th If not, [install Node.js](https://nodejs.org/en/download/) locally. -2. Start the the application container: +1. Start the local eligibility verification server: ```bash - docker compose up -d client + docker compose up --detach server ``` -3. Change into the `cypress` directory: +1. Start the the application: + + ```bash + docker compose run --detach --service-ports client bin/test_start.sh + ``` + +1. Change into the `cypress` directory: ```bash cd tests/cypress ``` -4. Install all packages and `cypress`. Verify `cypress` installation succeeds: +1. Install all packages and `cypress`. Verify `cypress` installation succeeds: ```bash npm install ``` -5. Run `cypress` with test environment variables and configuration variables: +1. Run `cypress` with test environment variables and configuration variables: ```bash CYPRESS_baseUrl=http://localhost:8000 npm run cypress:open