FindPatientByCodeAsync.robot 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. *** Settings ***
  2. Documentation 查询病人详细信息
  3. Test Setup get_login_token ${URL} mao
  4. Library Collections
  5. Library HttpLibrary.HTTP
  6. Library RequestsLibrary
  7. *** Variables ***
  8. ${uri} /IPatientService
  9. ${method} FindPatientByCodeAsync
  10. *** Test Cases ***
  11. Class_001_查询病人详细信息
  12. [Tags] inexecution
  13. [Template] findPatientByCode_assertClass
  14. ${token} PatientInfoDO_202209060308023hLHXE
  15. Class_002_查询病人详细信息,病人编码不存在
  16. [Tags] inexecution
  17. [Template] findPatientByCode_assertClassNull
  18. ${token} PatientInfoDO_
  19. Exception_001_Token非空校验
  20. [Tags] inexecution
  21. [Template] findPatientByCode_assertException
  22. ${EMPTY} PatientInfoDO_20220516083707wCNXvA 1 Permission validation error
  23. Exception_002_Token正确性校验
  24. [Tags] inexecution
  25. [Template] findPatientByCode_assertException
  26. 111111 PatientInfoDO_20220516083707wCNXvA 1 Permission validation error
  27. *** Keywords ***
  28. findPatientByCode_Post
  29. [Arguments] ${token} ${code}
  30. ${param} Create Dictionary
  31. Set To Dictionary ${param} Token ${token}
  32. Set To Dictionary ${param} Code ${code}
  33. ${data} body_data_list ${method} ${param}
  34. Log ${data}
  35. Log ---开始断言验证---
  36. ${response} request_post ${URL} ${uri} ${data}
  37. #Log ${response}
  38. #log ${response.content}
  39. #${content} Set Variable ${response.content}
  40. #Log ---输出返回内容---:
  41. #Log Json ${content} INFO
  42. #Log ---开始断言验证---
  43. #Should Be True ${response.status_code}==200
  44. ${content} check_response ${response}
  45. [Return] ${content}
  46. findPatientByCode_assertClass
  47. [Arguments] ${token} ${code}
  48. ${content} findPatientByCode_Post ${token} ${code}
  49. ${result} get_content_result ${content}
  50. Log ${result}
  51. ${patientCode} Get From Dictionary ${result} PatientCode
  52. Should Be Equal As Strings ${patientCode} ${code}
  53. [Return] ${content}
  54. findPatientByCode_assertClassNull
  55. [Arguments] ${token} ${code}
  56. ${content} findPatientByCode_Post ${token} ${code}
  57. ${result} get_content_result ${content}
  58. Should Be Equal As Strings ${result} ${null}
  59. [Return] ${content}
  60. findPatientByCode_assertException
  61. [Arguments] ${token} ${code} ${error_code} ${error_msg}
  62. ${content} findPatientByCode_Post ${token} ${code}
  63. #${error} Get From Dictionary ${content.json()} error
  64. #${code} Get From Dictionary ${error} code
  65. #${message} Get From Dictionary ${error} message
  66. #Should Be Equal As Numbers ${code} ${error_code}
  67. #Should Be String ${message} ${error_msg}
  68. ${res} check_content_exception ${content} ${error_code} ${error_msg}
  69. [Return] ${content}