We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 87fe3ee commit 73d71a3Copy full SHA for 73d71a3
docs/site/content/zh/latest/tasks/verify.md
@@ -19,6 +19,20 @@ title = "测试用例验证"
19
20
## 数组值检查
21
22
+### 检查数组中是否有元素的字段包含特定值
23
+
24
+示例数据:
25
26
+```json
27
+{
28
+ "data": [{
29
+ "key": "Content-Type"
30
+ }]
31
+}
32
+```
33
34
+校验配置:
35
36
```yaml
37
- name: popularHeaders
38
request:
@@ -28,6 +42,19 @@ title = "测试用例验证"
42
- any(data.data, {.key == "Content-Type"})
43
```
44
45
+### 检查数组中是否有元素的字段只包含特定值
46
47
48
49
+```yaml
50
+- name: popularHeaders
51
+ request:
52
+ api: /popularHeaders
53
+ expect:
54
+ verify:
55
+ - all(data.data, {.key == "Content-Type" or .key == "Target"})
56
57
58
[更多用法](https://expr-lang.org/docs/language-definition#any).
59
60
## 字符串判断
0 commit comments