我想知道是否有辦法在 Cucumber 運(yùn)行時修改 CucumberOptions 標(biāo)簽?我不確定這是否可行,但我想知道是否有辦法在 Cucumber 運(yùn)行時修改標(biāo)簽。在我的示例代碼中,我想在 Cucumber 運(yùn)行后添加另一個標(biāo)記“@Login”。我正在嘗試設(shè)置一個配置,在其中我可以選擇要運(yùn)行的功能而無需進(jìn)入 Runner 類。設(shè)置類 String AddTags = "@Login"; set = new HashMap<String, String>(){ {put("Tags", AddTags);賽跑者import org.junit.runner.RunWith;import cucumber.api.CucumberOptions;import cucumber.api.junit.Cucumber;@RunWith(Cucumber.class) @CucumberOptions (features="src/test/cucumber/features", tags = "@Smoke", //For instance, once cucumber runs I want to add tag "@Login". //So something like adding Settings.set.get("Tags");plugin = {"pretty", "html:target/cucumber- htmlreport","json:target/cucumber-report.json"})public class Runner {}不確定 Cucumber 是否可行,但想問一下。
2 回答

FFIVE
TA貢獻(xiàn)1797條經(jīng)驗 獲得超6個贊
您可以使用標(biāo)簽表達(dá)式來組合多個標(biāo)簽,例如:
**Expression Description**
@fast Scenarios tagged with @fast
@wip and not @slow Scenarios tagged with @wip that aren’t also tagged with @slow
@smoke and @fast Scenarios tagged with both @smoke and @fast
@gui or @database Scenarios tagged with either @gui or @database
添加回答
舉報
0/150
提交
取消