1_登录接口数据驱动.yaml 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. process: G0--P
  2. desc: T2-登录用例
  3. featureName: 登录模块
  4. storyName: 用户模块
  5. remark: 登录模块备注
  6. steps:
  7. - 发送Post请求:
  8. 关键字: request_post_form_urlencoded
  9. URL: "{{URL}}"
  10. PARAMS:
  11. s: /api/user/login
  12. application: app
  13. DATA:
  14. accounts: "{{username}}"
  15. pwd: "{{password}}"
  16. type: username
  17. - 通过JSONPATH提取数据-MSG:
  18. 关键字: ex_jsonData
  19. EXVALUE: $..msg
  20. INDEX: 0
  21. VARNAME: msg_success
  22. #- 通过JSONPATH提取数据-TOKEN:
  23. # 关键字: ex_jsonData
  24. # EXVALUE: $..token
  25. # INDEX: 0
  26. # VARNAME: msg_token
  27. - 断言-文本断言-等于:
  28. 关键字: assert_text_comparators
  29. VALUE: "{{msg_success}}"
  30. EXPECTED: "{{expected}}"
  31. OP_STR: ==
  32. - 断言-全量断言-等于:
  33. 关键字: assert_json_DeepDiff
  34. json1: { "name": "hami","age": 18 }
  35. json2: { "name": "hami","age": 18 }
  36. # - 断言-全量断言-不等于:
  37. # 关键字: assert_json_DeepDiff
  38. # json1: { "name": "hami","age": 18 }
  39. # json2: { "name": "hami","age": 20 }
  40. - 断言-全量断言-过滤字段:
  41. 关键字: assert_json_DeepDiff
  42. json1: { "name": "hami","age": 18 , "city": 长沙 }
  43. json2: { "name": "hami","age": 18 }
  44. 过滤字段: {city}
  45. - 断言-全量断言-不等于:
  46. 关键字: assert_json_DeepDiff
  47. json1: [ 1,2,3 ]
  48. json2: [ 1,3,2 ]
  49. 忽略顺序: True
  50. ddts:
  51. - username: hami
  52. password: '123456'
  53. expected: '登录成功'
  54. desc: "正确的用户名和密码"
  55. - username: hami
  56. password: '1234567'
  57. expected: '密码错误'
  58. desc: "错误的用户名和密码"