问题描述
我们已经实施了黄瓜放心的API自动化程序.最近,我们知道空手道与放心"相比具有优势.因此,我想到了向我的组织推荐使用Karate的建议,因此我准备了带有Karate的API自动化脚本的示例.是的,我可以使用JUnit很好地执行,但是如果尝试使用TestNG执行相同的testrunner文件,则根本无法执行,显示执行后测试运行为零.
We have implemented cucumber with rest assured for API automation. Recently we came to know Karate giving advantages when compared with Rest assured. So I thought of recommend to my organization to use Karate, hence I have prepared sample to API automation scripts with Karate. Yes, I can execute very well with JUnit, but same testrunner file if I tried to execute with TestNG am unable to execute at all, displaying Test runs are zero after my execution.
能否请您帮我用TestNG framwework运行空手道赛跑者文件.确实,您的答案将使我们做出决定.
Could you please help me is there any way to run Karate runner file with TestNG framwework. Really your answer going to make us decision.
我经历了与空手道有关的TestNG相关的各种帖子.但是很不幸,我无法触发我的脚本.
I have gone through various posts which are related TestNG with Karate. But unluckily am unable to trigger my scripts.
注意:我扩展了KarateRunner类,并在我的代码中也使用了@KarateOptions.
Note: I have extended KarateRunner class and used @KarateOptions as well in my code.
推荐答案
TestNG仅在开发模式下才需要.所有团队最终都需要执行CI,而空手道甚至不需要JUnit,请参考: https: //github.com/intuit/karate#parallel-execution
TestNG is needed only for development mode. All teams finally need to do CI and here Karate does not need even JUnit, please refer this: https://github.com/intuit/karate#parallel-execution
现在处于开发模式-即使您坚持使用TestNG,也可以将JUnit混合到同一项目中: https://stackoverflow .com/a/19928639/143475
Now for development mode - even if you insist on using TestNG, you can mix JUnit into the same project: https://stackoverflow.com/a/19928639/143475
请放弃尝试在空手道中使用TestNG的做法,这是不必要的,而且会浪费您的时间.另外请注意,我们有 IDE支持,这是大多数开发人员都会使用的.大部分时间甚至都不需要JUnit支持.
Please give up trying to use TestNG for Karate, it is un-necessary and a waste of your time. Also note that we have IDE support which is what most developers will use. Even the JUnit support is not needed most of the time.
这篇关于如何使用TestNG运行空手道测试运行程序文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!