![](/img/trans.png)
[英]Unable to run Cucumber scenarios via Testrunner class as TestNG tests in Intellij
[英]How to run cucumber scenarios alongside other type of tests?
我有一些 cucumber 場景運行順利,但我也想運行其他類型的測試。 比如,“測試頁面上的每個組件”不是一個有效的場景,因為 BDD 是用來檢查行為的。 我想划分 cucumber 場景和硒/組件測試
這是我的跑步者:
@RunWith(Cucumber.class)
@CucumberOptions(
monochrome = true,
features = {"src/test/test/features/"},
glue = {"test.steps"},
tags = {""},
plugin = {"pretty", "com.aventstack.extentreports.cucumber.adapter.ExtentCucumberAdapter:" +
"path"}
)
您的 Cucumber 測試將在構建期間與其他單元測試 (*Test) 或集成測試 (*IT) 同時運行,具體取決於運行程序的名稱(代碼片段中缺少該名稱)。
根據您是使用 Cucumber 來斷言單元測試級別或集成測試級別的行為,請分別命名您的RunCucumberTest
或RunCucumberIT
。
例如(使用您提供的選項):
@RunWith(Cucumber.class)
@CucumberOptions(
monochrome = true,
features = {"src/test/test/features/"},
glue = {"test.steps"},
tags = {""},
plugin = {"pretty", "com.aventstack.extentreports.cucumber.adapter.ExtentCucumberAdapter:" +
"path"}
)
public class RunCucumberTest {
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.