Skip to content

Commit

Permalink
fix(tests): container startup script specifically for Cypress
Browse files Browse the repository at this point in the history
  • Loading branch information
thekaveman committed Feb 14, 2024
1 parent fac24a8 commit f20faf3
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 6 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/tests-cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions bin/test_start.sh
Original file line number Diff line number Diff line change
@@ -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
16 changes: 11 additions & 5 deletions docs/tests/automated-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f20faf3

Please sign in to comment.