cucumber-jvm 上 .feature 文件的默认位置是什么?

What's the default location of .feature files on cucumber-jvm?

我在文档中找不到 cucumber-jvm 查找 .feature 文件的位置。

我从 c​​ucumber-jvm maven 原型创建了一个项目,mvn 测试发现示例功能文件没有问题,但没有配置。

然后我从那里创建了一个项目 maven project archetype,但 mvn test 没有找到我创建的功能文件。并想了解原因。

假设您使用的是 Cucumber-JUnit。创建一个使用 Cucumber JUnit 运行程序的空 class。

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