1

team - my app is deployed on a cloud cluster with a temporary namespace for dev environment and this keep changing for every push on the branch and this build is happening in Jenkins. i have this value as a variable in Jenkins and need to pass it back to karate-config.js to set the env and this is the base URL for my endpoints deployed.

this is my endpoint once deployed: https://testing.n64672240.us2-dev-a.cluster.k8s.us.xxx.net/testcode

when i print env (var env = karate.env;) its null so cant retrieve the variable from Jenkins.

i need this pass this back to karate-config.js file :https://testing.n64672240.us2-dev-a.cluster.k8s.us.xxx.net/

how can i get this value?

  • i was able to get that using karate.properties. actual implementation var hostname = karate.properties.hostname && karate.properties.hostname.slice(1,-1) and my maven command is - mvn clean test -Dtest=KarateTest -Dcucumber.options="--tags @smoke --tags @functional" -D hostname="${hostname}" – user1528733 May 07 '21 at 19:27

0 Answers0