Can cucumber tag a single step?
Alberto last edited by
The application that I'm testing receives input from an outside sensor, but sensor data is unavailable on the test environment. Therefore, I use mock data. The problem is, mock data requires some more clicking to be done in the app.
So I would just add another step to my feature file when I'm testing on the test environment.
Is there a way to tag a single step the way you can tag a scenario in Cucumber?
Not directly the step, but the step can inspect the scenario context.
scenario.getSourceTagNames() would return the list of tags - thus you can add a @testEnv tag on the scenario and just perform the extra clicking if this tag is present.
With the configuration above, when in not in testing env, you can run all scenarios without @testEnv.