简体   繁体   中英

How to run multiple cucumber features?

I have a run test class like this.

@RunWith(Cucumber.class)
@CucumberOptions(
        features = {"src/test/resources/features"},
        glue = {"classpath:com.wirecard.step"},
        format = {"pretty", "html:target/cucumber-report", "json:target/cucumber.json"},
        tags = {"@Login_Flow", "@Merch_Creation", "@Add_Terminal", "@MERCHBATCH_UPLOAD"}
)
public class AsortStdTests {

}

And I have 4 cucumber feature files under src/test/resources/features. When I try to run this test(4 cucumber features), I got the error:

None of the features at [src/test/resources/features] matched the filters: [@Login_Flow, @Merch_Creation, @Add_Terminal, @MERCHBATCH_UPLOAD]
0 Scenarios
0 Steps
0m0.000s


Process finished with exit code 0
Empty test suite.

I've tried to give Cucumber options a full path, it didn't work as well. Anyone can help me with this? Thank you.

The value of tag in cucumberoptions is not correct, it is currently setup to pickup scenarios with all the mentioned tags. You are using AND instead of OR.

You can leave out the tag option completely.

Or you can use this for tag option --- tags = {"@Login_Flow, @Merch_Creation, @Add_Terminal, @MERCHBATCH_UPLOAD"}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM