FindPatients.robot 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. *** Settings ***
  2. Documentation 分页查询病人列表
  3. Suite Setup
  4. Test Setup get_login_token ${URL} mao
  5. Library Collections
  6. Library HttpLibrary.HTTP
  7. Library RequestsLibrary
  8. Library DateTime
  9. *** Variables ***
  10. ${uri} /IPatientService
  11. ${method} FindPatientsAsync
  12. *** Test Cases ***
  13. Class_001_分页查询病人列表
  14. [Tags] inexecution
  15. [Template] findPatients_assertClass
  16. ${token} 1 10
  17. *** Keywords ***
  18. findPatients_Post
  19. [Arguments] ${token} ${pageIndex} ${pageSize}
  20. ${param} Create Dictionary
  21. Set To Dictionary ${param} Token ${token}
  22. ${pageIndex1} Convert To Integer ${pageIndex}
  23. Set To Dictionary ${param} PageIndex ${pageIndex1}
  24. ${pageSize1} Convert To Integer ${pageSize}
  25. Set To Dictionary ${param} PageSize ${pageSize1}
  26. #Set To Dictionary ${param} Keyword ${keyword}
  27. #开始时间、结束时间
  28. #Set To Dictionary ${param} IsValid ${isValid}
  29. ${data} body_data_list ${method} ${param}
  30. Log ${data}
  31. Log ---开始断言验证---
  32. ${response} request_post ${URL} ${uri} ${data}
  33. #Log ${response}
  34. #log ${response.content}
  35. #${content} Set Variable ${response.content}
  36. #Log ---输出返回内容---:
  37. #Log Json ${content} INFO
  38. #Log ---开始断言验证---
  39. #Should Be True ${response.status_code}==200
  40. ${content} check_response ${response}
  41. Log ${content}
  42. [Return] ${content}
  43. findPatients_assertClass
  44. [Arguments] ${token} ${pageIndex} ${pageSize}
  45. ${content} findPatients_Post ${token} ${pageIndex} ${pageSize}
  46. ${result} get_content_result ${content}
  47. Log ${result}
  48. ${pageData} Get From Dictionary ${result} PageData
  49. Should Not Be Empty ${pageData}
  50. [Return] ${content}
  51. findPatients_assertException
  52. [Arguments] ${token} ${pageIndex} ${pageSize} ${keyword} ${startTime} ${endTime} ${isValid} ${error_code} ${error_msg}
  53. ${content} findPatients_Post ${token} ${pageIndex} ${pageSize} ${keyword} ${startTime} ${endTime} ${isValid}
  54. #${error} Get From Dictionary ${content.json()} error
  55. #${code} Get From Dictionary ${error} code
  56. #${message} Get From Dictionary ${error} message
  57. #Should Be Equal As Numbers ${code} ${error_code}
  58. #Should Be String ${message} ${error_msg}
  59. ${res} check_content_exception ${content} ${error_code} ${error_msg}
  60. [Return] ${content}