【发布时间】:2018-12-29 09:31:30
【问题描述】:
我在 Eclipse IDE 中的 Maven 项目的帮助下创建了一个基本的 Cucumber 框架。
我正在尝试使用 TestNG 套件执行所有运行器类。为此,我必须在 pom.xml 文件中添加 Cucumber 和 TestNG 集成所需的所有依赖项。
跑步者 1 级
package tests.report.runners;
import cucumber.api.CucumberOptions;
@CucumberOptions(features = "src/test/resources/features",glue= {"tests"},tags= {"@Report"})
public class ReportRunner {
}
跑步者 2 级
package tests.dashboard.runners;
import cucumber.api.CucumberOptions;
@CucumberOptions(features = "src/test/resources/features",glue= {"tests"},tags= {"@Report"})
public class DashboardRunner {
}
testng.xml
?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="First Suite" parallel="classes">
<test name="Chrome Test" parallel="classes">
<classes>
<class name ="tests.report.runners.ReportRunner"></class>
<class name ="tests.dashboard.runners.DashboardRunner"></class>
</classes>
</test>
</suite>
包结构在这里:
但是,我收到此错误:
在类路径中找不到类:\src\test\java\tests\report\runners\ReportRunner.java
如何调试?
【问题讨论】:
-
您在使用此集成时特别遇到了什么问题?我想知道它是否有助于更具体。你有错误吗?
-
请阅读Under what circumstances may I add “urgent” or other similar phrases to my question, in order to obtain faster answers? - 总结是这不是解决志愿者的理想方式,并且可能会适得其反。请不要将此添加到您的问题中。
-
好的,这样好多了,谢谢 - 我已将其添加到您的问题中。
标签: maven cucumber testng cucumber-jvm cucumber-java