Cucumber options annotation

前端 未结 3 1533
粉色の甜心
粉色の甜心 2020-12-29 06:48

The cucumber-jvm javadocs states that purpose of the glue element is to specify the location of the stepdefinitions and hooks. However, this doesn\'t seem to work for me. Le

3条回答
  •  时光说笑
    2020-12-29 07:01

    I have successfully used something like:

    @RunWith(Cucumber.class)
    @Cucumber.Options(
        //this code will only look into "features/" folder for features
        features={"classpath:features/"},
        glue = { "com.mycompany.cucumber.stepdefinitions", "com.mycompany.cucumber.hooks" },
        format = { "com.mycompany.cucumber.formatter.RuntimeInfoCatcher", "json:target/cucumber.json" },
        tags = { "@working" }
        )
    public class CucumberStarterIT {
    }
    

    Looking at the doc at http://cukes.info/api/cucumber/jvm/javadoc/cucumber/api/junit/Cucumber.Options.html it specifies the options to be of type String[] so perhaps it's not expected to work "well" if you don't give it a single-value list. Try glue={"directory_b"} and see what happens for you.

提交回复
热议问题