Search code examples
automationkarate

Can we access different env under same test run tag using @env variable


I have used same tag for two different feature files and looking to pick env stg1 for feature file A and stg2 for feature file B.

Current configuration which pick feature files/scenarios to run on one kind of env

(name regression tests) mvn clean test -Dtest=KarateTests#regressionTests -Dkarate.env=stg1 -Dkarate.config.dir="./" -Dpublish.testburst=true -Dkarate.options="--tags @COMMONTAG1"
call: getReportSummary_forSlack
call: publishReportSlackNotificationSuccess(var channel = 'regression', var msg = "Success! US ECOMM Regression Test Report - Env selected - stg1 - PMID - FAAA Report Summary $SUMMARY_SLACK")

Expectations is to pick different env as per feature file with same tag.


Solution

  • No only one karate.env value can be applied at a time when you run tests.