如何从项目jar运行空手道测试? [英] How to run karate tests from project jar?
问题描述
我正在使用gradle的空手道0.9.2.我的项目要求在src/main/java中具有所有空手道测试.因此,我将gradle依赖项配置为"compile"而不是"testCompile",并且还修改了sourceSets使其指向main而不是test.当我使用上述配置运行Runner类时,收到空的测试套件消息.
I am using karate 0.9.2 with gradle. My project requires to have all karate tests inside src/main/java. So I configured the gradle dependency as ‘compile’ instead of ‘testCompile’ and also modified the sourceSets to point to main instead of test. When I ran my runner class with above configuration I got empty test suite message.
build.gradle片段:
build.gradle snippet:
compile 'com.intuit.karate:karate-junit4:0.9.3'
compile 'com.intuit.karate:karate-apache:0.9.3'
sourceSets {
test {
resources {
srcDir file('src/main/java')
exclude '**/*.java'
}
}
}
此外,我要从可部署的项目jar中运行空手道测试.请为我指出可以实现相同目标的资源.
Additionally, I have is to run the karate tests from the deployable project jar. Please point me the resources I can refer to achieve the same.
推荐答案
我们没有直接支持的方法,但是团队已经在Spring Boot等程序中做到了这一点.应该有可能,看看此线程是否有帮助: https://github.com/intuit/karate/issues/520
Not something we directly support but teams have done this in Spring Boot etc. It should be possible, see if this thread helps: https://github.com/intuit/karate/issues/520
此外,您可能也不需要JUnit: https://github.com/intuit/karate /issues/427
Also you may not need JUnit also: https://github.com/intuit/karate/issues/427
并以该票证中的示例项目为例: https://github.com /intuit/karate/issues/529
And see the sample project in this ticket as an example: https://github.com/intuit/karate/issues/529
这篇关于如何从项目jar运行空手道测试?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!