https://cypress.io logo
How to skip a test based on environment variables?
# i-need-help
w
Hope everyone is doing well, I'm trying to find a way to skip a few test cases in my localhost, any idea how I can implement that with a tag or condition skip?
f
Have you tried providing a different list of tests to specPattern in your cypress config based on the environment?
If you set a variable devList = [test1, test2]; prodList = [test3, test4] then you should be able to set specPattern = dev ? devList : prodList or something like that
w
Thanks for the reply @flat-painter-96557 , I was able to do skip test cases with tags and using this plugin https://github.com/cypress-io/cypress/tree/develop/npm/grep