[英]How to integrate both karate and cucumber and invoke both from a single file/class
I created cucumber automation code for a project, How to call karate feature files from cucumber runner class, or any other way to run the karate feature files from cucumber framework, My plan is to integrate both karate and cucumber and invoke both from a single file/class我为一个项目创建了黄瓜自动化代码,如何从黄瓜跑步者类中调用空手道特征文件,或者从黄瓜框架中运行空手道特征文件的任何其他方式,我的计划是整合空手道和黄瓜,并从单个文件中调用它们/班级
@RunWith(Cucumber.class) public class TestRunner_Cucumber { @RunWith(Cucumber.class) 公共类 TestRunner_Cucumber {
} }
Do this using the Java API.使用 Java API 执行此操作。 Read the docs: https://github.com/intuit/karate#java-api
阅读文档: https : //github.com/intuit/karate#java-api
Map<String, Object> result = Runner.runFeature("classpath:demo/java/from-java.feature", args, true);
By the way, I don't recommend BDD for API testing: https://stackoverflow.com/a/47799207/143475顺便说一句,我不推荐 BDD 进行 API 测试: https : //stackoverflow.com/a/47799207/143475
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.