Search code examples
javatestingcucumberkarate

Debug karate features in IntelliJ Idea


I have test

  @Test
  public void myTest() {
    Results results = Runner.path("classpath:features/myFeature.feature").parallel(1);
    Assert.assertEquals(results.getErrorMessages(), 0, results.getFailCount());
  }

Feature looks like this

 * def myVariable =
    """
    function(x, y)
    {
        functionBody...
    }
    """

 Scenario: My scenario
     * kafkaClient.publish(...)
     * def result = myVariable(...)
     And assert result != null

I installed karate plugin, now in feature I see the syntax highlighting, however there is no ability to put breakpoint in feature.

I use karate version 1.2.0

How I can debug features? I want to stop at (* def result) line for example, or I want to debug js function (functionBody...). Is there any proper way to do so?


Solution

  • Right now you can debug a feature file if you use the run-configuration as shown in this video: https://youtu.be/w6V8rKOtyyg

    We don't yet support debugging in JS blocks.

    You need to be on the paid version of the plugin for feature-file debugging to work.