vendredi 18 octobre 2019

How do I configure and use/switch between configuration environments using Karate

I try to configure different testing targets via karate-config-.js files located in the same directory. When I try to execute the tests against the different target-systems: mvn test -Dkarate.env=int02 (tried: -DargLine="-Dkarate.env=int02") the karate-config-int02.js file is not executed and the test execution get stuck somewhere. I've read the documenation: https://github.com/intuit/karate#switching-the-environment but for now I found no working example. I am working with karate 0.9.4 on macOS with Java 1.8 in a maven 3.6.0 example-project for a prof of concept. Extending the pom file: <properties> <karate.env>int02</karate.env> </properties> was also not working.

I though via the -Dkarate.env=int02 I could ensure that the karate-config-int02.js would be used to configure the instance specific properties I need. I do have a line in both karate-config files like: karate.log('karate-config|karate-config-int02 is called') but I always see: 'karate-config is called'

Aucun commentaire:

Enregistrer un commentaire