Reputation: 475
I'm trying to run multiple tests in cucumber framework using tags option from TestRunner.java
file. I've tried something like below, but it didn't help as expected.
@RunWith(Cucumber.class)
@CucumberOptions(
features = "Feature"
,glue={"stepDefinition"}
,format = {"html:Results"}
,tags = {"@test1","@test2","@test3"}
)
From several posts, I could see that we should use --tags @ --tags @.... for multiple tags with AND functionality. But I believe that the format would work only if I trigger the execution from command prompt, but not in class file. So please help me in updating this part.
Upvotes: 0
Views: 624
Reputation: 11
Your runner class is looking for a feature file which has all the three tags "@test1","@test2","@test3"
. If you have @test1, @test2, @test3
in 3 different feature files but not in a single feature file then try as below.
tags = {"@test1,@test2,@test3"}
DO NOT give quotes for each tag. Just a quote before and after all the tags separated by comma.
Upvotes: 1