From 2c999048660b65a9a48d396340106e41986c8f45 Mon Sep 17 00:00:00 2001 From: Andy Gout Date: Fri, 10 Mar 2023 10:39:17 +0000 Subject: [PATCH] build(cypress)!: revise Cypress base URL value for staging scenario --- plugins/cypress/readme.md | 2 ++ plugins/cypress/src/tasks/cypress.ts | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/cypress/readme.md b/plugins/cypress/readme.md index c30bb8407..ff879ffc8 100644 --- a/plugins/cypress/readme.md +++ b/plugins/cypress/readme.md @@ -36,6 +36,8 @@ hooks: The `CypressCI` task runs on the `test:review` and `test:staging` hooks by default. These will run your Cypress end-to-end tests against the currently deployed review or staging app respectively. +For the Cypress end-to-end tests to be run against the staging app, you will need to add to the project's Vault `continuous-integration` secrets a `CYPRESS_CUSTOM_STAGING_URL` environment variable whose value is the staging app's Heroku URL. + ### Running on another hook You can also configure Cypress to run on any other hook; for example, if you want to run it with `npm run test` via the `npm` plugin, you can manually configure Cypress to run on `npm`'s `test:local` hook: diff --git a/plugins/cypress/src/tasks/cypress.ts b/plugins/cypress/src/tasks/cypress.ts index ab386e070..ef0266632 100644 --- a/plugins/cypress/src/tasks/cypress.ts +++ b/plugins/cypress/src/tasks/cypress.ts @@ -27,7 +27,7 @@ export class CypressCi extends Task { cypressEnv.CYPRESS_BASE_URL = `https://${reviewState.appName}.herokuapp.com` cypressEnv.CYPRESS_REVIEW_APP = 'true' } else { - cypressEnv.CYPRESS_BASE_URL = `https://${process.env.CY_CUSTOM_DOMAIN_STAGING}` + cypressEnv.CYPRESS_BASE_URL = process.env.CYPRESS_CUSTOM_STAGING_URL || '' } this.logger.info(`running cypress against ${cypressEnv.CYPRESS_BASEURL}`)