简体   繁体   English

如何集成空手道和黄瓜并从单个文件/类中调用它们

[英]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.

相关问题 如何从java类中读取文件,两者都在同一个jar中 - How to read a file from a java class, both are in the same jar 如何从单个文本文件中同时打印字符串和整数? - How do I print both Strings and Ints from a single text file? 如何将空手道与Testrail集成 - How to integrate karate with testrail 如何从单个数据定义生成Java和PHP中的实体? - How to generate entities in both Java and PHP from a single data definition? 黄瓜(在 Java 中):如何仅使用两个标签运行场景 - cucumber (in Java): How can I run scenarios with both tags only 如何将Spring整合到黄瓜中 - How to integrate Spring into Cucumber 如何将黄瓜与詹金斯融合 - How to integrate cucumber with Jenkins Activity 及其 Fragment 的单个布局文件和单个 Java 文件 - Single layout file and single java file for Both Activity and it's Fragment 如何从键盘和文件中读取? - How do I read both from keyboard and from file? 如何使用着色器从文件中的类调用以在包含gl代码的另一个文件中显示(两个文件都位于jni文件夹中)? - how do I call from a class that is in a file to display in another file containing the gl code using shaders (where both files are in jni folder)?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM