I want to not run certain cucumber feature if, say, I’m on windows. Google and the cucumber docs seemed to turn up dry so appealing here.
Thanks!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The best way to approach this would likely be using tags.
For example, if you add a tag like
@not-windowsto a feature you can then customize your cucumber execution to ignore this.If you then run your tests with
cucumber --tags ~@not-windowsit will run all cukes that are not tagged by @not-windows. The ~ is what causes the “not” behavior, you could run ONLY these tags by doingcucumber --tags @not-windows. Using the first cucumber line while in Windows, you can block the problematic features (or individual scenarios) from running but if you’re on another OS and run cucumber normally, these will still be ran.Reference: https://github.com/cucumber/cucumber/wiki/Tags