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}`)