From 59c31a3e27ee508d853c2028556745d8174e99a3 Mon Sep 17 00:00:00 2001 From: Bobby Novak <176936850+rnovak338@users.noreply.github.com> Date: Mon, 12 Aug 2024 10:55:43 -0400 Subject: [PATCH] Update testing.md (#4157) - 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. --- docs/testing.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/testing.md b/docs/testing.md index 93b7320770..d480e1dd3f 100644 --- a/docs/testing.md +++ b/docs/testing.md @@ -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='' CYPRESS_LOGIN_TEST_PASSWORD='' CYPRESS_LOGIN_TEST_OTP_SECRET='' CYPRESS_LOGIN_TEST_EMAIL_AUDITEE='' CYPRESS_LOGIN_TEST_PASSWORD_AUDITEE='' CYPRESS_LOGIN_TEST_OTP_SECRET_AUDITEE='' CYPRESS_API_GOV_JWT='' CYPRESS_API_GOV_URL='localhost:3000' CYPRESS_API_GOV_USER_ID_ADMIN='' CYPRESS_ADMIN_API_VERSION='' npx cypress open` +- `CYPRESS_LOGIN_TEST_EMAIL='' CYPRESS_LOGIN_TEST_PASSWORD='' CYPRESS_LOGIN_TEST_OTP_SECRET='' CYPRESS_LOGIN_TEST_EMAIL_AUDITEE='' CYPRESS_LOGIN_TEST_PASSWORD_AUDITEE='' CYPRESS_LOGIN_TEST_OTP_SECRET_AUDITEE='' CYPRESS_API_GOV_JWT='' CYPRESS_API_GOV_KEY='' CYPRESS_API_GOV_URL='localhost:3000' CYPRESS_API_GOV_USER_ID_ADMIN='' CYPRESS_API_GOV_USER_ID='' CYPRESS_ADMIN_API_VERSION='' CYPRESS_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