When using * eval if (condition) { ... } syntax in a Karate feature file, the parser reports an error:
<expr> or KarateTokenType.TRIPLE_QUOTE expected, got 'if'
Steps to Reproduce:
- Create a feature file with an eval if statement:
* def arg = {'reqHeader': '#(reqHeader)', 'statusCode': 403}
* eval if (FEATURE_FLAG == "true") {karate.call('classpath:/utils/someFeature.feature', arg);}
- The IDE (IntelliJ IDEA with Karate plugin) shows a parser error on the if keyword.
Expected Behavior: The eval if syntax should be recognized as valid Karate DSL without parser errors.
Actual Behavior: Parser fails to recognize if following eval keyword and reports a token error.
Environment:
IDE: IntelliJ IDEA 2024.2.1
OS: macOS
Karate Version: 1.5.2 (but in older version also same issue had been seen)