Skip to content

Commit

Permalink
Update testing.md (#4157)
Browse files Browse the repository at this point in the history
- Slight language tweaks.
- Added additional parameters to the npx cypress command which allowed me to run successful tests.
- Adjusted language for how to input API versioning parameters in the npx cypress command.
- Fixed a deprecated link.
  • Loading branch information
rnovak338 authored Aug 12, 2024
1 parent 2f71f7d commit 59c31a3
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions docs/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,18 +139,19 @@ Like with Bandit, new code will need to pass all of these to be merged into the

We use Cypress to do end-to-end testing of the application. Tests are defined
in files in [backend/cypress/e2e/](/backend/cypress/e2e). To run these tests:
- Run the app. Then, from the `FAC/backend` directory:
- Run the app. Then, in a separate shell from the `FAC/backend` directory:
- `npm ci`
- [Create a testing login.gov account](https://github.com/GSA-TTS/FAC/blob/main/docs/testing.md#testing-behind-logingov)
- [Set up the fac() alias](https://github.com/GSA-TTS/FAC/blob/main/docs/development.md?plain=1#L125)
- [Generate a new JWT](https://github.com/GSA-TTS/FAC/blob/main/backend/dissemination/README.md#creating-a-jwt-secret)
- `CYPRESS_LOGIN_TEST_EMAIL='<your email>' CYPRESS_LOGIN_TEST_PASSWORD='<your password>' CYPRESS_LOGIN_TEST_OTP_SECRET='<your otp>' CYPRESS_LOGIN_TEST_EMAIL_AUDITEE='<auditee email*>' CYPRESS_LOGIN_TEST_PASSWORD_AUDITEE='<auditee password*>' CYPRESS_LOGIN_TEST_OTP_SECRET_AUDITEE='<auditee otp*>' CYPRESS_API_GOV_JWT='<your jwt>' CYPRESS_API_GOV_URL='localhost:3000' CYPRESS_API_GOV_USER_ID_ADMIN='<admin user uuid**>' CYPRESS_ADMIN_API_VERSION='<current admin api version***>' npx cypress open`
- `CYPRESS_LOGIN_TEST_EMAIL='<your email>' CYPRESS_LOGIN_TEST_PASSWORD='<your password>' CYPRESS_LOGIN_TEST_OTP_SECRET='<your otp>' CYPRESS_LOGIN_TEST_EMAIL_AUDITEE='<auditee email*>' CYPRESS_LOGIN_TEST_PASSWORD_AUDITEE='<auditee password*>' CYPRESS_LOGIN_TEST_OTP_SECRET_AUDITEE='<auditee otp*>' CYPRESS_API_GOV_JWT='<your jwt>' CYPRESS_API_GOV_KEY='<gov key*>' CYPRESS_API_GOV_URL='localhost:3000' CYPRESS_API_GOV_USER_ID_ADMIN='<admin user uuid**>' CYPRESS_API_GOV_USER_ID='<user uuid*>' CYPRESS_ADMIN_API_VERSION='<current admin api version***>' CYPRESS_API_VERSION='<current api version***>' npx cypress open`
- Note: All of this goes on one line
- *: These fields can be found in the [FAC dev keys Google doc](https://docs.google.com/spreadsheets/d/1byrBp16jufbiEY_GP5MyR0Uqf6WvB_5tubSXN_mYyJY/edit#gid=0)
- **: This field can be the UUID associated with any of the [users with administrative privileges](https://github.com/GSA-TTS/FAC/blob/main/backend/support/api/admin_api_v1_0_0/create_access_tables.sql)
- ***: This current value for this field can be found [here](https://github.com/GSA-TTS/FAC/blob/1af236093cab16beb783eec4021b162f04c90840/backend/docker-compose.yml#L112)
- **: This field can be the UUID associated with any of the [users with administrative privileges](https://github.com/GSA-TTS/FAC/blob/main/backend/support/api/admin_api_v1_1_0/create_access_tables.sql)
- ***: the api versions found in services.api.environment.PGRST_DB_SCHEMAS of docker-compose.yml. (e.g. `api_vX_X_X` and `admin_api_vX_X_X`)
- Click `E2E Testing`
- Select `Chrome` and click `Start E2E Testing in Chrome`
- When the application loads in the Chrome browser, select a test within the `Specs` tab that you wish to run.

## Testing behind Login.gov

Expand Down

0 comments on commit 59c31a3

Please sign in to comment.