Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

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.Test
   Karate karateFeatureTest() {
        return Karate.run("classpath:karate/somedir/a.feature").hook(new KarateHook());
    }

Scala snippet:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

  val myVar: ScenarioBuilder = scenario("Test scenario")
    .exec(karateFeature("classpath:karate/somedir/a.feature"))

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: https://github.com/karatelabs/karate/tree/master/karate-gatling#runner

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading