AddOrganizationsAsync.robot 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. *** Settings ***
  2. Documentation 添加组织
  3. Resource ../../../CommonConfig/Config.robot
  4. Resource ../../../AllApi/ClientAPI/PersonalInformationApi/CommonLoginAsync.robot
  5. Resource ../../../AllApi/ClientAPI/OrganizationInformationApi/AddOrganizationsAsync.robot
  6. Resource ../../../AllApi/ClientAPI/OrganizationInformationApi/SearchOrganizationsAsync.robot
  7. Resource ../../../AllApi/ClientAPI/OrganizationInformationApi/RemoveOrganizationsAsync.robot
  8. *** Variables ***
  9. *** Test Cases ***
  10. Class_001_添加组织
  11. [Setup]
  12. [Template]
  13. #随机生成组织名
  14. ${oranName} Random Characters
  15. #登录,获取用户Token
  16. ${token} GetCommonLoginAsyncToken ${user_mao}[0] ${EMPTY} ${user_mao}[1] ${3} ${0}
  17. #添加组织
  18. ${res} AddOrganizationsAsyncPost ${token} ${oranName} ${organizationInfo_mao}[0] ${EMPTY} ${patientType}[0] ${languageCode}[0]
  19. Log ${res}
  20. #校验
  21. ${flag} Result Analysis ${res} True ${EMPTY} ${EMPTY}
  22. Should Be True ${flag}
  23. #搜索组织,返回OrganizationCode
  24. ${organizationCode} SearchOrganizationsAsyncOrganizationCode ${token} ${oranName} ${organizationInfo_mao}[0] ${organizationType}[1]
  25. #删除组织
  26. ${response} RemoveOrganizationsAsyncPost ${token} ${organizationCode}
  27. #删除组织校验
  28. ${flag} Result Analysis ${response} True ${EMPTY} ${EMPTY}
  29. Exception_001_添加组织,OrganizationName非空校验
  30. [Template]
  31. #登录,获取用户Token
  32. ${token} GetCommonLoginAsyncToken ${user_mao}[0] ${EMPTY} ${user_mao}[1] ${3} ${0}
  33. #添加组织,OrganizationName传入空值
  34. ${res} AddOrganizationsAsyncPost ${token} ${EMPTY} ${organizationInfo_mao}[0] ${EMPTY} ${patientType}[0] ${languageCode}[0]
  35. Log ${res}
  36. #返回error信息校验
  37. ${flag} Result Analysis ${res} false ${6017} OrganizationName \ is Empty
  38. Should Be True ${flag}
  39. Exception_002_添加组织,OrganizationName重名校验
  40. [Template]
  41. #随机生成组织名
  42. ${oranName} Random Characters
  43. #登录,获取用户Token
  44. ${token} GetCommonLoginAsyncToken ${user_mao}[0] ${EMPTY} ${user_mao}[1] ${3} ${0}
  45. #添加组织
  46. ${res} AddOrganizationsAsyncPost ${token} ${oranName} ${organizationInfo_mao}[0] ${EMPTY} ${patientType}[0] ${languageCode}[0]
  47. Log ${res}
  48. #校验
  49. ${flag} Result Analysis ${res} True ${EMPTY} ${EMPTY}
  50. Should Be True ${flag}
  51. #搜索组织,返回OrganizationCode
  52. ${organizationCode} SearchOrganizationsAsyncOrganizationCode ${token} ${oranName} ${organizationInfo_mao}[0] ${organizationType}[1]
  53. #添加重名组织
  54. ${res} AddOrganizationsAsyncPost ${token} ${oranName} ${organizationInfo_mao}[0] ${EMPTY} ${patientType}[0] ${languageCode}[0]
  55. #返回error信息校验
  56. ${flag} Result Analysis ${res} false ${6056} OrganizationName Duplicate
  57. Should Be True ${flag}
  58. #删除组织
  59. ${response} RemoveOrganizationsAsyncPost ${token} ${organizationCode}
  60. #删除组织校验
  61. ${flag} Result Analysis ${response} True ${EMPTY} ${EMPTY}
  62. Exception_003_添加组织,zh-CN语言编码下OrganizationName最大字符长度限制(20)
  63. [Template]
  64. #登录,获取用户Token
  65. ${token} GetCommonLoginAsyncToken ${user_mao}[0] ${EMPTY} ${user_mao}[1] ${3} ${0}
  66. #添加组织,OrganizationName传入空值
  67. ${res} AddOrganizationsAsyncPost ${token} 1234567890qazwsxedcrf ${organizationInfo_mao}[0] ${EMPTY} ${patientType}[0] ${languageCode}[0]
  68. Log ${res}
  69. #返回error信息校验
  70. ${flag} Result Analysis ${res} false ${6003} Name is too long less than 20
  71. Should Be True ${flag}
  72. Exception_004_添加组织,en-US语言编码下OrganizationName最大字符长度限制(50)
  73. [Template]
  74. #登录,获取用户Token
  75. ${token} GetCommonLoginAsyncToken ${user_mao}[0] ${EMPTY} ${user_mao}[1] ${3} ${0}
  76. #添加组织,OrganizationName传入空值
  77. ${res} AddOrganizationsAsyncPost ${token} 12345678901234567890qazwsxedcr1234567890qazwsxedcrf ${organizationInfo_mao}[0] ${EMPTY} ${patientType}[0] ${languageCode}[1]
  78. Log ${res}
  79. #返回error信息校验
  80. ${flag} Result Analysis ${res} false ${6003} Name is too long less than 50
  81. Should Be True ${flag}
  82. Exception_005_添加组织,PatientType特定值校验
  83. [Template]
  84. #登录,获取用户Token
  85. ${token} GetCommonLoginAsyncToken ${user_mao}[0] ${EMPTY} ${user_mao}[1] ${3} ${0}
  86. #添加组织,OrganizationName传入空值
  87. ${res} AddOrganizationsAsyncPost ${token} zzaaqq ${EMPTY} ${EMPTY} 99 ${languageCode}[0]
  88. Log ${res}
  89. #返回error信息校验
  90. ${flag} Result Analysis ${res} false ${4041} PatientType code error
  91. Should Be True ${flag}
  92. Exception_006_添加组织,Token非空校验
  93. [Template]
  94. #添加组织,Token传入空值
  95. ${res} AddOrganizationsAsyncPost ${EMPTY} 测试测试呀 ${EMPTY} ${EMPTY} 99 ${languageCode}[0]
  96. Log ${res}
  97. #返回error信息校验
  98. ${flag} Result Analysis ${res} false ${1} Permission validation error
  99. Should Be True ${flag}
  100. Exception_007_添加组织,Token正确性校验
  101. [Template]
  102. #添加组织,Token传入不正确的值
  103. ${res} AddOrganizationsAsyncPost 11111111 测试测试呀 ${EMPTY} ${EMPTY} 99 ${languageCode}[0]
  104. Log ${res}
  105. #返回error信息校验
  106. ${flag} Result Analysis ${res} false ${1} Permission validation error
  107. Should Be True ${flag}
  108. *** Keywords ***