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 に答える