Skip to content

Commit

Permalink
build(cypress)!: revise Cypress base URL value for staging scenario
Browse files Browse the repository at this point in the history
  • Loading branch information
andygout committed Mar 10, 2023
1 parent 5a450ea commit 2c99904
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions plugins/cypress/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
2 changes: 1 addition & 1 deletion plugins/cypress/src/tasks/cypress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export class CypressCi extends Task<typeof CypressSchema> {
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}`)
Expand Down

0 comments on commit 2c99904

Please sign in to comment.