1

这是我的示例功能文件:

Feature: Karate expression to check if status within array of status.

  Scenario: Test
    * def status = "ACTIVE"
    * def possibleStatus = ["ACTIVE", "INACTIVE"]
    * match status contains possibleStatus ?

有没有办法使用空手道表达式检查状态是 ACTIVE 还是 INACTIVE ?

注意:绝对可以通过编写自定义 JS 函数来实现。

4

1 回答 1

1

这是个简单的。

* def status = "ACTIVE"
* def possibleStatus = ["ACTIVE", "INACTIVE"]
* match possibleStatus contains status

任何问题 :)

于 2019-03-10T00:35:33.773 回答