有没有办法根据条件执行api?
Scenario:
And path 'path1'
And request {}
When method post
Then status 200
{execute get1 if condition is true and execute get2 when condition is false}
#get1
And path 'path2'
When method get
Then status 200
#get2
And path 'path3'
When method get
Then status 200
#get3
And path 'path4'
When method get
Then status 200
我尝试过使用三元运算符的条件语句,但我不确定如何在那里执行代码块。
请不要这样做。原因解释如下:https://stackoverflow.com/a/54126724/143475