cypress-skip-test
cypress-skip-test copied to clipboard
How to include/exclude a test based of custom value
There seems to be a finite list of values that can be passed in to skipOn and onlyOn (eg. 'localhost', 'mac', etc.) which don't seem to be documented anywhere. I also see in the docs that you can use the CYPRESS_ENVIRONMENT value too. I'm looking to be able to use a custom value/expression from my cypress.json file. Eg.
{
"env": {
"includedTests": "platform"
}
}
Is there a way to do something like this:
skipOn(Cypress.env.includedTests === 'platform')
onlyOn support a boolean argument so you can use it for the inverse case:
cy.onlyOn(Cypress.env.includedTests !== 'platform')
See https://github.com/cypress-io/cypress-skip-test#boolean-flag