0

我的跑步者课程如下所示:

@RunWith(Cucumber.class)
@CucumberOptions(
        plugin = { "pretty", "html:target/cucumber", "json:target/cucumber.json" },
        glue = "glue path",
        features = "feature path",
        tags = {"@tags"}
        )
public class TestClass{
}

我想知道是否有办法替换硬编码值,例如

glue = "**some path**", features = "**some feature**" 

用常量还是变量?你能帮忙吗?

谢谢。

4

1 回答 1

0

将您的值声明为静态最终变量,您可以在注释中使用。

public static final String glue = "glue"; in class Constants.java

用它作为

@CucumberOptions(
        plugin = { "pretty", "html:target/cucumber", "json:target/cucumber.json" },
        glue = Constants.glue,
        features = "feature path",
        tags = {"@tags"}
        ) 
于 2016-12-02T07:33:45.030 回答