api-tests.json 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. {
  2. "info": {
  3. "_postman_id": "5b90b987-503f-484c-b8d7-a0974674e95d",
  4. "name": "api-tests",
  5. "description": "Jenkins auto test ERP api",
  6. "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
  7. "_exporter_id": "3170378"
  8. },
  9. "item": [
  10. {
  11. "name": "登录",
  12. "event": [
  13. {
  14. "listen": "test",
  15. "script": {
  16. "exec": [
  17. "var result = pm.response.json();",
  18. "pm.environment.set(\"api-login-id\", result.LoginId);"
  19. ],
  20. "type": "text/javascript",
  21. "packages": {},
  22. "requests": {}
  23. }
  24. }
  25. ],
  26. "request": {
  27. "auth": {
  28. "type": "noauth"
  29. },
  30. "method": "POST",
  31. "header": [
  32. {
  33. "key": "LanguageId",
  34. "value": "{{api-language}}",
  35. "description": "客户端语言别,0:简体 1:繁体 2:英文"
  36. },
  37. {
  38. "key": "Authorization",
  39. "value": "{{api-authorization}}",
  40. "description": "\"Basic MTBYWF8wMTo=\" 为\"10XX_01:\"的BASE64加密字符串,如在POSTMAN中的Authorization部分选择Basic Auth填入用户名+密码则不需在此传值"
  41. },
  42. {
  43. "key": "ClientType",
  44. "value": "{{api-client-type}}",
  45. "description": "用户自定义的客户端识别号,比如客户是WMS系统,可以自定义ClientType=“WMS”"
  46. },
  47. {
  48. "key": "Content-Type",
  49. "value": "{{api-content-type}}"
  50. },
  51. {
  52. "key": "X-Tiansi-Auth-Bypass",
  53. "value": "{{api-x-tiansi-bypass}}",
  54. "description": "跳过接口注册检验",
  55. "type": "text"
  56. },
  57. {
  58. "key": "sn",
  59. "value": "{{api-sn}}",
  60. "type": "text"
  61. }
  62. ],
  63. "url": {
  64. "raw": "{{api-url}}/User/login",
  65. "host": [
  66. "{{api-url}}"
  67. ],
  68. "path": [
  69. "User",
  70. "login"
  71. ]
  72. },
  73. "description": "用户登录"
  74. },
  75. "response": []
  76. },
  77. {
  78. "name": "查询货品列表",
  79. "request": {
  80. "method": "POST",
  81. "header": [
  82. {
  83. "key": "LoginId",
  84. "value": "{{api-login-id}}",
  85. "type": "text"
  86. }
  87. ],
  88. "body": {
  89. "mode": "urlencoded",
  90. "urlencoded": [
  91. {
  92. "key": "CURRENT_PAGE",
  93. "value": "1",
  94. "type": "text"
  95. },
  96. {
  97. "key": "PAGE_SIZE",
  98. "value": "100",
  99. "type": "text"
  100. }
  101. ]
  102. },
  103. "url": {
  104. "raw": "{{api-url}}/Prdt/List",
  105. "host": [
  106. "{{api-url}}"
  107. ],
  108. "path": [
  109. "Prdt",
  110. "List"
  111. ]
  112. },
  113. "description": "同步货品资料"
  114. },
  115. "response": []
  116. }
  117. ],
  118. "event": [
  119. {
  120. "listen": "prerequest",
  121. "script": {
  122. "type": "text/javascript",
  123. "packages": {},
  124. "requests": {},
  125. "exec": [
  126. ""
  127. ]
  128. }
  129. },
  130. {
  131. "listen": "test",
  132. "script": {
  133. "type": "text/javascript",
  134. "packages": {},
  135. "requests": {},
  136. "exec": [
  137. ""
  138. ]
  139. }
  140. }
  141. ]
  142. }