We require the use of custom properties via environment variables in our tests, so we used the citrus:env([ARG1], [ARG2]) function. However after extensive experimentation we simply could not get it to work as expected. The following snippet should reproduce the issue:
Feature: loadTest
Scenario: Runs
Given variable foo is "https://jsonplaceholder.typicode.com"
Given URL: ${foo}
When send GET /todos/1
Then receive HTTP 200 OK
Scenario: Fails
Given variable foo is "citrus:env('TESTENV','https://jsonplaceholder.typicode.com')"
Given URL: ${foo}
When send GET /todos/1
Then receive HTTP 200 OK
with the command yaks run -e TESTENV=https://web.de/ -n yakstesting test.feature to run it. It results in the following error:
java.lang.NullPointerException
at com.consol.citrus.functions.core.EnvironmentPropertyFunction.execute(EnvironmentPropertyFunction.java:58)
at com.consol.citrus.functions.FunctionUtils.resolveFunction(FunctionUtils.java:143)
at com.consol.citrus.functions.FunctionUtils.replaceFunctionsInString(FunctionUtils.java:96)
at com.consol.citrus.context.TestContext.replaceDynamicContentInString(TestContext.java:406)
If this is a problem on our end, could you please provide an adjusted snippet that is able to correctly retrieve environment variables passed via --env?
We require the use of custom properties via environment variables in our tests, so we used the
citrus:env([ARG1], [ARG2])
function. However after extensive experimentation we simply could not get it to work as expected. The following snippet should reproduce the issue:with the command
yaks run -e TESTENV=https://web.de/ -n yakstesting test.feature
to run it. It results in the following error:If this is a problem on our end, could you please provide an adjusted snippet that is able to correctly retrieve environment variables passed via
--env
?Thank you in advance!