![](/img/trans.png)
[英]Cucumber cannot be resolved to a type. @RunWith(Cucumber.class)
[英]How to run @RunWith(Cucumber.class) step by step
我正在研究BDD文件並嘗試使用JUnit進行測試。
我想在@RunWith(Cucumber.class)中使用RunCukesTest類。
我在許多網站上搜索了如何安裝需求,但我找不到任何網站,一步一步簡要解釋。
你可以一步一步地向我解釋一下,我該如何進行測試?
package test.newtest;
import cucumber.junit.Cucumber;
import org.junit.runner.RunWith;
@RunWith(Cucumber.class)
public class RunCukesTest {
}
Cucumber將默認在RunCucksTest所在的包中查找功能文件。 您還可以通過在@CucumberOptions
批注中提供“features”選項(在RunCucksTest中)來更改它將查找要素文件的位置。 E. g。,
@CucumberOptions(strict = true, features = {
"src/test/resources/cucumber/",
},monochrome=true)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.