我正在尝试使用Cucumber,TestNG和gradle进行测试(cucumber + testng + gradle中没有官方示例,并且从gradle github仓库中了解到,目前不支持此工具堆栈)
gradle tests --tests com.CR --stacktrace
表明测试未在异常条件下运行
Caused by: org.gradle.api.tasks.testing.TestExecutionException: No tests found for given includes: [com.CR](--tests filter)
其中 com.CR 是@CucumberOptions的类
经过一番调查,我发现黄瓜类 cucumber.api.testng.AbstractTestNGCucumberTests.class 中的库出了问题,我正在尝试对其进行调试。
我在此类中设置调试点。并使用调试选项运行gradle
gradle test --tests com.CR -Dorg.gradle.debug=true --no-daemon
之后,连接到远程调试端口5005 但这并没有在我的任何调试点上停止。
所以问题是如何调试依赖库的代码或我做错了什么?
答案 0 :(得分:0)
问题解决了。无需调试。 在gradle test {}任务中,必须执行一些其他设置才能运行testng黄瓜运行程序类。