Cucumber 选项(命令行)不再适用于较新版本的 Cucumber (io.cucumber)?



目前,以下命令在尝试通过命令行窗口运行测试时可以工作,但是自从从info.cakes更新到io.cucumber以来,它似乎不再起作用?

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 {
}

黄瓜版:

<cucumber.version>4.7.2</cucumber.version>
import io.cucumber.junit.CucumberOptions;
import io.cucumber.junit.Cucumber;
import io.cucumber.testng.AbstractTestNGCucumberTests;
import org.junit.runner.RunWith;

您正在混合JUnit和TestNG。你应该在单个类中使用JUnit或TestNG。不能两者兼而有之。

相关内容

最新更新