我在文档中找不到Cucumber-jvm查找.feature文件的地方。
我从cumulage-jvm maven原型创建了一个项目,并通过mvn测试找到了示例特征文件,没有问题,但是没有配置。
然后,我从那里创建了一个项目原型,而mvn test找不到我创建的功能文件。并且想知道为什么。
答案 0 :(得分:1)
假设您正在使用Cucumber-JUnit。创建一个使用Cucumber JUnit运行器的空类。
package com.example;
import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;
import org.junit.runner.RunWith;
@RunWith(Cucumber.class)
public class RunCucumberTest {
}
这将与运行程序(com.example
)在同一程序包中执行所有场景,默认情况下还假定粘合代码位于同一程序包中。 @CucumberOptions可用于为跑步者提供其他配置。
因此,如果您使用的是maven,则将功能放在/src/test/resources/com/example/
中。
发件人:https://github.com/cucumber/cucumber-jvm/tree/master/junit