GetRankByCodeAsync.robot 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. *** Settings ***
  2. Documentation 客户端-获取职称信息
  3. Suite Setup
  4. Test Setup
  5. Resource ../../../CommonConfig/Config.robot
  6. Resource ../../../AllApi/ClientAPI/PersonalInformationApi/CommonLoginAsync.robot
  7. Resource ../../../AllApi/ClientAPI/OrganizationInformationApi/AddRanksAsync.robot
  8. Resource ../../../AllApi/ClientAPI/OrganizationInformationApi/GetAllRanksAsync.robot
  9. Resource ../../../AllApi/ClientAPI/OrganizationInformationApi/RemoveRanksAsync.robot
  10. Resource ../../../AllApi/ClientAPI/OrganizationInformationApi/GetRankByCodeAsync.robot
  11. *** Variables ***
  12. *** Test Cases ***
  13. Class_001_获取职称信息
  14. [Template]
  15. #随机生成职称名
  16. ${raName} Random Characters
  17. #登录,获取用户Token
  18. ${token} GetCommonLoginAsyncToken ${user_mao}[0] ${EMPTY} ${user_mao}[1] ${3} ${0}
  19. #添加职称信息
  20. ${res} AddRanksAsyncPost ${token} ${raName} ${organizationInfo_mao}[0] ${EMPTY}
  21. Log ${res}
  22. #添加职称成功校验
  23. ${flag1} Result Analysis ${res} True ${EMPTY} ${EMPTY}
  24. Should Be True ${flag1}
  25. #获取新添加职称信息记录的RankCode
  26. ${rankCode} GetAllRanksAsyncPost_RankCode ${token} ${EMPTY} ${organizationInfo_mao}[0]
  27. #获取职称信息
  28. ${res1} GetRankByCodeAsyncPost ${token} ${rankCode}
  29. ${content1} Get From Dictionary ${res1} content
  30. ${rankName} Get From Dictionary ${content1} RankName
  31. Should Be Equal As Strings ${rankName} ${raName}
  32. #删除职称
  33. ${response} RemoveRanksAsyncPost ${token} ${rankCode}
  34. #删除组织校验
  35. ${flag2} Result Analysis ${response} True ${EMPTY} ${EMPTY}
  36. Should Be True ${flag2}
  37. Exception_001_获取职称信息,Token非空校验
  38. [Template]
  39. #获取职称信息
  40. ${res} GetRankByCodeAsyncPost ${EMPTY} 111111
  41. Log ${res}
  42. #返回error信息校验
  43. ${flag} Result Analysis ${res} false ${1} Permission validation error
  44. Should Be True ${flag}
  45. Exception_002_获取职称信息,Token正确性校验
  46. [Template]
  47. #获取职称信息
  48. ${res} GetRankByCodeAsyncPost 111111 111111
  49. Log ${res}
  50. #返回error信息校验
  51. ${flag} Result Analysis ${res} false ${1} Permission validation error
  52. Should Be True ${flag}
  53. Exception_003_获取职称信息,RankCode不存在
  54. [Template]
  55. #登录,获取用户Token
  56. ${token} GetCommonLoginAsyncToken ${user_mao}[0] ${EMPTY} ${user_mao}[1] ${3} ${0}
  57. #获取职称信息
  58. ${res} GetRankByCodeAsyncPost ${token} 111111
  59. Log ${res}
  60. #校验返回,result返回null
  61. ${content} Get From Dictionary ${res} content
  62. Should Be Empty ${content}
  63. Exception_004_获取职称信息,RankCode非空校验
  64. [Template]
  65. #登录,获取用户Token
  66. ${token} GetCommonLoginAsyncToken ${user_mao}[0] ${EMPTY} ${user_mao}[1] ${3} ${0}
  67. #获取职称信息
  68. ${res} GetRankByCodeAsyncPost ${token} ${EMPTY}
  69. Log ${res}
  70. #返回error信息校验
  71. ${flag} Result Analysis ${res} false ${9} Code can't be null
  72. Should Be True ${flag}
  73. *** Keywords ***