Composite steps not working inside conditional steps
When we create a conditional step and give a composite step inside it , the composite step does not get executed
Sample story which gives error is as below
Meta :
GivenStories: /path/to/test.story
Scenario:
test.story
Meta:
Scenario: 1.login to the application When the condition '`#{eval(${testBooleanValue} == true)}' is true I do |step| |composite step|
when we run the story the composite step does not get executed and is just printed on the console without any execution
Artifacts If applicable, add artifacts to help explain your problem:
- Screenshots
- Allure report
- Test execution logs
Execution environment (please complete the following information):
- Vividus version: [e.g. 0.4.10]
- OS: Windows 10
- Java: java 18.0.1.1 2022-04-22 Java(TM) SE Runtime Environment (build 18.0.1.1+2-6) Java HotSpot(TM) 64-Bit Server VM (build 18.0.1.1+2-6, mixed mode, sharing)
@vinay-kabbe most probably you're facing known issue: https://github.com/vividus-framework/vividus/issues/1746. In order to debug your case could you please describe how variable ${testBooleanValue} is initialized?
@vinay-kabbe if your variable is true or false you can use it without eval
When the condition '${testBooleanValue}' is true I do
|step|
|composite step|
@vinay-kabbe most probably you're facing known issue: #1746. In order to debug your case could you please describe how variable
${testBooleanValue}is initialized?
the variable testBooleanValue is initialized in the property file from where it is directly read into the story
@vinay-kabbe if your variable is true or false you can use it without eval
When the condition '${testBooleanValue}' is true I do |step| |composite step|
I tried doing this but no change in behaviour , it still does not execute the composite step
the variable testBooleanValue is initialized in the property file from where it is directly read into the story
@vinay-kabbe could you please provide your test execution logs and report, or create Short, Self Contained, Correct (Compilable), Example
the variable testBooleanValue is initialized in the property file from where it is directly read into the story
@vinay-kabbe could you please provide your test execution logs and report, or create Short, Self Contained, Correct (Compilable), Example
I have created a short example using google which demonstrates the problem that I am facing. Please have a look at it , the composite step is not executed if it is inside a conditional step vividus-starter.zip Below is the allure report for the story which I ran in the above project allure-report-for-google-scenario.zip
@valfirst : what is the priority for this bug and what is the ETA? Do let me know if you need anything else from my side
@vinay-kabbe
- The original scenario has typo:
... '>>>`<<<#{eval(...
remove backtick ` and everything will work
- The provided test project also has the same typos:
When the condition '`#{eval(${isEnteredText} == true)}`' is true I do
It must be either
When the condition '#{eval(${isEnteredText} == true)}' is true I do
or
When the condition `#{eval(${isEnteredText} == true)}` is true I do
- Also Ivan's suggestion works perfectly:
When the condition '${isEnteredText}' is true I do
|step|
|composite step|