当前,当尝试通过命令行窗口运行测试时,以下命令将起作用,但是由于从info.cakes更新到io.cucumber,它似乎不再起作用?
.Text
异常消息:
mvn test -Dcucumber.options="--tags @login"
但是直接从运行器类运行测试有效:
Sep 17, 2019 5:18:37 PM cucumber.runtime.FeaturePathFeatureSupplier get
WARNING: No features found at classpath:runners
黄瓜版本:
package runners;
import io.cucumber.junit.CucumberOptions;
import io.cucumber.junit.Cucumber;
import io.cucumber.testng.AbstractTestNGCucumberTests;
import org.junit.runner.RunWith;
@RunWith(Cucumber.class)
@CucumberOptions(features = { "classpath:features" }, glue = {
"stepDefinitions"}, monochrome = true, tags = {"@login"}, dryRun = false,
plugin = { "pretty", "html:target/cucumber", "json:target/cucumber.json"})
public class MainRunner extends AbstractTestNGCucumberTests {
}
答案 0 :(得分:1)
import io.cucumber.junit.CucumberOptions;
import io.cucumber.junit.Cucumber;
import io.cucumber.testng.AbstractTestNGCucumberTests;
import org.junit.runner.RunWith;
您正在混合JUnit和TestNG。您应该在单个类中使用JUnit或TestNG。两者都不是。