卡在这个 file 很久了,眼睛看了无数次,也没觉得 这个 yaml faile 不合法啊
- test:
name: get guest
request:
url: https://xxx/sessions/guest
method: GET
headers:
Content-Type: "application/json"
validate:
- eq: ["status_code", 200]
extract: [
{"token": content.token"}
]
- test:
name: pin request
request:
url: https://xxx/sessions/pinCodeRequest
method: POST
headers:
Content-Type: "application/json"
Authorization: "test $token"
json:
phoneNumber: 7900099049
customerConsent: true
currentPage: "INITIAL_REGISTRATION_PIN"
validate:
- eq: ["status_code", 200]
一直 warning httprunner.loader.buildup:__load_file_content:402 - Invalid test file format: api/demo_api.yml
另外 如果 第一个 test 的 token 传递到第二 test 中 需要在前面 加上一个子串 譬如 "test " + token, 我上面的写法是对的么? 多谢