-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvariable-validation-failures.yaml
More file actions
47 lines (42 loc) · 1.17 KB
/
variable-validation-failures.yaml
File metadata and controls
47 lines (42 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# Variable Validation Failures
# Tests validation failures with variable substitution
executions:
- name: "User A"
vars:
- USER_ID: "12345"
- EXPECTED_EMAIL: "wrong@example.com"
- name: "User B"
vars:
- USER_ID: "67890"
- EXPECTED_EMAIL: "also-wrong@example.com"
probes:
# Probe 1: Variable in validation - wrong value
- name: "Variable Validation Mismatch"
type: rest
endpoint: "https://httpbin.org/post"
method: POST
headers:
Content-Type: "application/json"
body:
user_id: "${USER_ID}"
email: "actual@example.com"
validation:
status: 200
body:
equals:
json.email: "${EXPECTED_EMAIL}" # FAIL: wrong expected email
# Probe 2: Variable in pattern match - wrong pattern
- name: "Variable Pattern Mismatch"
type: rest
endpoint: "https://httpbin.org/post"
method: POST
headers:
Content-Type: "application/json"
body:
user_id: "${USER_ID}"
validation:
status: 200
body:
matches:
json.user_id: "^${USER_ID}XXX$" # FAIL: pattern doesn't match
# Expected: Both probes fail in both executions (4 total failures)