1

I have a situation where I need to add a param based on a condition. PFB my scenario. Here , if withParam is true then I need to have param content = true else different params based on uriQuery. One way is I create 2 difference scenarios or may be If I can use conditional logic. I tried to use conditional logic as below but I am getting an error

Scenario Outline: Get Nth level categories

    Given path 'v1/catalog/categories/'+categoryId+'/products'
    * if <withParams> == true ?  param content = true :  param <uriQuery>: <condition>
    When method GET
    Then status 200

Examples:
      |uriQuery         |condition |withParams|
      |pageSize         |2         |true      |
      |currentPage      |1         |true      |
      |sortBy           |-1        |false     |
      |pl               |15        |false   |
      |ph               |45+       |true        |
      |includeRegionsMap|true      |   true       |

Error:- evaluation (js) failed: if true == true ? configure param content = true : configure param pageSize: 2, javax.script.ScriptException: :1:3 Expected ( but found true if true == true ? configure param content = true : configure param pageSize: 2

Sunny Sachdeva
  • 289
  • 3
  • 16

0 Answers0