FindValidPatientsByName.robot 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. *** Settings ***
  2. Documentation 获取有效相同病人名称的列表
  3. Suite Setup get_login_token ${URL} jo22
  4. Library Collections
  5. Library HttpLibrary.HTTP
  6. Library RequestsLibrary
  7. *** Variables ***
  8. ${uri} /IPatientService
  9. ${method} FindValidPatientsByName
  10. *** Test Cases ***
  11. Class_001_获取有效相同病人名称的列表
  12. [Tags] inexecution
  13. [Template] findValidPatientsByName_assertClass
  14. ${token} 12
  15. *** Keywords ***
  16. findValidPatientsByName_Post
  17. [Arguments] ${token} ${name}
  18. ${param} Create Dictionary
  19. Set To Dictionary ${param} Token ${token}
  20. Set To Dictionary ${param} Name ${name}
  21. ${data} body_data_list ${method} ${param}
  22. Log ${data}
  23. Log ---开始断言验证---
  24. ${response} request_post ${URL} ${uri} ${data}
  25. ${content} check_response ${response}
  26. Log ${content}
  27. [Return] ${response}
  28. findValidPatientsByName_assertClass
  29. [Arguments] ${token} ${name}
  30. ${content} findValidPatientsByName_Post ${token} ${name}
  31. ${result} Get From Dictionary ${content.json()} result
  32. Log ${result}[0]
  33. ${result1} Set Variable ${result}[0]
  34. ${PatientDataList} Set Variable ${result1}[PatientData]
  35. Log ${PatientDataList}
  36. ${Patient} Set Variable ${PatientDataList}[0]
  37. Should Not Be Empty ${result}
  38. Should Be Equal As Strings ${Patient}[Value] ${name}
  39. [Return] ${content}
  40. findValidPatientsByName_assertClassNull
  41. [Arguments] ${token} ${name}
  42. ${content} findPatientByCode_Post ${token} ${code}
  43. ${result} Get From Dictionary ${content.json()} result
  44. should be empty ${result}
  45. [Return] ${content}
  46. findValidPatientsByName_assertException
  47. [Arguments] ${token} ${name} ${error_code} ${error_msg}
  48. ${content} findPatientByCode_Post ${token} ${code}
  49. ${error} Get From Dictionary ${content.json()} error
  50. ${code} Get From Dictionary ${error} code
  51. ${message} Get From Dictionary ${error} message
  52. Should Be Equal As Numbers ${code} ${error_code}
  53. Should Be String ${message} ${error_msg}
  54. [Return] ${content}