1

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 {

}

chk
  • 11
  • 3
  • Your idea to mix non-BDD Karate Gherkin with BDD-Cucumber Gherkin, is not a good one, in my opinion. Keep them separate. – djangofan Jan 22 '20 at 23:58
  • I think you would see step undefined warning for karate if you keep both cucumber and karate tests in a single feature file. – Muhil R May 07 '20 at 17:07

1 Answers1

0

Do this using the Java API. Read the docs: 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

Peter Thomas
  • 54,465
  • 21
  • 84
  • 248