在我的黄瓜 -jvm、Maven、junit 设置中,我的 testRunner 文件为
package com.lebara.testrunner;
import cucumber.junit.Cucumber;
import org.junit.runner.RunWith;
@RunWith(Cucumber.class)
@Cucumber.Options(
glue = {"com.lebara.stepdefs","com.lebara.framework.main", "com.lebara.testrunner"},
features = "C:/Users/sarthak.dayanand/Documents/WebRefreshTest/CukeAutomation/LebaraWebAutomationTest1/src/main/resources",
format = {"pretty", "html:target/cucumber-html-report", "json-pretty:target/cucumber-report.json"},
tags = {"@UserJourney"}
)
public class RunCukesTest {
}
我在上述目录中有我的功能文件。
如果我运行它,我会得到以下异常:
cucumber.runtime.CucumberException: No features found at [C:/Users/sarthak.dayanand/Documents/WebRefreshTest/CukeAutomation/LebaraWebAutomationTest1/src/main/resources/cucumber]...
如果我删除 testrunner 中的“功能”选项,它会尝试在与我的 testrunner.java 相同的目录中查找功能文件
cucumber.runtime.CucumberException: No features found at [com/lebara/testrunner]
如果我把功能文件放在那里,它就可以工作。
我的问题是为什么没有从我以前的位置提取我的功能文件,我认为这是黄瓜的默认文件结构 - maven 设置。
我如何让它从那里拿起?帮助表示赞赏。