Search code examples
karatekarate-call-single

Can we run karate-config .json once while using Karate runner object?


I have followed the karate documentation for callsingle but that works if we specify the classpath in karate-config.json file. Actually I am using karate runner class like below and I want to run the karate-config json only once for all of my scenarios. I have searched a quite for this but not able to get and not sure even if this is possible ? Appreciate any suggestions! Thanks!!

public class TestRunner {
    @Test
    public void testParallel() {
        Results results = Runner.path("classpath:apis")
                .tags("@regression")
                .karateEnv("test")
                .outputCucumberJson(true)
                .parallel(5);
        assertEquals(0, results.getFailCount(), results.getErrorMessages());
    }
}

Solution

  • No it is not possible. Teams are able to use karate.callSingle() for specific "one-time" needs and it has been working fine for years.