How to run karate test runner file with TestNG?

白昼怎懂夜的黑 提交于 2021-02-05 08:41:10

问题


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.

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.

I have gone through various posts which are related TestNG with Karate. But unluckily am unable to trigger my scripts.

Note: I have extended KarateRunner class and used @KarateOptions as well in my code.


回答1:


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

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

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.



来源:https://stackoverflow.com/questions/58048065/how-to-run-karate-test-runner-file-with-testng

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!