setting RuntimeHook on karate from scala/gatling side

All our karate features being executed as integration tests got a RuntimeHook implementation.
Now I see that they are also called from Scala for performance testing and cannot figure out how to set the same RuntimeHook on them.
Is it possible at all? Did I miss something?

Java snippet from an integration test:

   Karate karateFeatureTest() {
        return"classpath:karate/somedir/a.feature").hook(new KarateHook());

Scala snippet:

  val myVar: ScenarioBuilder = scenario("Test scenario")

While the Karate class has a ‘hook’ method, karateFeature scala method doesn’t have a parameter for a hook.

>Solution :

It should be possible, here is the relevant documentation:

Leave a Reply