Skip to content

Instantly share code, notes, and snippets.

@lmiller1990
Created June 26, 2023 02:05
Show Gist options
  • Save lmiller1990/936aafdbf6a83b06e44eb7ce624fd6ad to your computer and use it in GitHub Desktop.
Save lmiller1990/936aafdbf6a83b06e44eb7ce624fd6ad to your computer and use it in GitHub Desktop.
Cypress Conditional Runs
before(() => {
const isHeadless = Cypress.config('isTextTerminal')
if (isHeadless) {
// do something
}
})
// Or ...
before(() => {
// depends on provider. Could be GITHUB_ACTIONS, CIRCLE_CI, etc.
const isCi = Cypress.env('CI')
if (isCi) {
// do something
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment