【发布时间】:2018-10-24 18:06:40
【问题描述】:
我最近开始使用黄瓜,我刚刚建立了项目 project setup
如您所见,我有 DefaultRunner.java,它是 JUnit 运行器类,它具有以下代码:
package Runners;
import org.junit.runner.RunWith;
import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;
@RunWith(Cucumber.class)
@CucumberOptions(
features = "src\\test\\resources\\Features\\GreatCourse.feature",
glue={"Steps"},
format = {"pretty","html:target/cucumber"},
tags= {"@smoke"}
)
public class DefaultRunner {
}
现在我可以毫无问题地在 Windows 系统上运行它,但由于寻址系统的原因,我无法在 Mac 上运行它。我尝试使用 if 语句来选择操作系统,但它不起作用。
【问题讨论】:
-
您得到的确切错误是什么?您是否尝试过: features = "src/test/resources/Features/GreatCourse.feature"?
-
我可以使用它,但这意味着我只能在 Mac 上使用它,而不能在 Windows 机器上使用。我希望能够编写一行代码并能够在两台机器上使用它。
标签: api junit frameworks cucumber runner