chengc 5 dni temu
commit
786be2ab3d
2 zmienionych plików z 200 dodań i 0 usunięć
  1. 142 0
      collections/api-tests.json
  2. 58 0
      environments/api-tests-env.json

+ 142 - 0
collections/api-tests.json

@@ -0,0 +1,142 @@
+{
+	"info": {
+		"_postman_id": "5b90b987-503f-484c-b8d7-a0974674e95d",
+		"name": "api-tests",
+		"description": "Jenkins auto test ERP api",
+		"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
+		"_exporter_id": "3170378"
+	},
+	"item": [
+		{
+			"name": "登录",
+			"event": [
+				{
+					"listen": "test",
+					"script": {
+						"exec": [
+							"var result = pm.response.json();",
+							"pm.environment.set(\"api-login-id\", result.LoginId);"
+						],
+						"type": "text/javascript",
+						"packages": {},
+						"requests": {}
+					}
+				}
+			],
+			"request": {
+				"auth": {
+					"type": "noauth"
+				},
+				"method": "POST",
+				"header": [
+					{
+						"key": "LanguageId",
+						"value": "{{api-language}}",
+						"description": "客户端语言别,0:简体  1:繁体  2:英文"
+					},
+					{
+						"key": "Authorization",
+						"value": "{{api-authorization}}",
+						"description": "\"Basic MTBYWF8wMTo=\" 为\"10XX_01:\"的BASE64加密字符串,如在POSTMAN中的Authorization部分选择Basic Auth填入用户名+密码则不需在此传值"
+					},
+					{
+						"key": "ClientType",
+						"value": "{{api-client-type}}",
+						"description": "用户自定义的客户端识别号,比如客户是WMS系统,可以自定义ClientType=“WMS”"
+					},
+					{
+						"key": "Content-Type",
+						"value": "{{api-content-type}}"
+					},
+					{
+						"key": "X-Tiansi-Auth-Bypass",
+						"value": "{{api-x-tiansi-bypass}}",
+						"description": "跳过接口注册检验",
+						"type": "text"
+					},
+					{
+						"key": "sn",
+						"value": "{{api-sn}}",
+						"type": "text"
+					}
+				],
+				"url": {
+					"raw": "{{api-url}}/User/login",
+					"host": [
+						"{{api-url}}"
+					],
+					"path": [
+						"User",
+						"login"
+					]
+				},
+				"description": "用户登录"
+			},
+			"response": []
+		},
+		{
+			"name": "查询货品列表",
+			"request": {
+				"method": "POST",
+				"header": [
+					{
+						"key": "LoginId",
+						"value": "{{api-login-id}}",
+						"type": "text"
+					}
+				],
+				"body": {
+					"mode": "urlencoded",
+					"urlencoded": [
+						{
+							"key": "CURRENT_PAGE",
+							"value": "1",
+							"type": "text"
+						},
+						{
+							"key": "PAGE_SIZE",
+							"value": "100",
+							"type": "text"
+						}
+					]
+				},
+				"url": {
+					"raw": "{{api-url}}/Prdt/List",
+					"host": [
+						"{{api-url}}"
+					],
+					"path": [
+						"Prdt",
+						"List"
+					]
+				},
+				"description": "同步货品资料"
+			},
+			"response": []
+		}
+	],
+	"event": [
+		{
+			"listen": "prerequest",
+			"script": {
+				"type": "text/javascript",
+				"packages": {},
+				"requests": {},
+				"exec": [
+					""
+				]
+			}
+		},
+		{
+			"listen": "test",
+			"script": {
+				"type": "text/javascript",
+				"packages": {},
+				"requests": {},
+				"exec": [
+					""
+				]
+			}
+		}
+	]
+}

+ 58 - 0
environments/api-tests-env.json

@@ -0,0 +1,58 @@
+{
+	"id": "e8e688ab-0c64-4ffb-90ee-f2cc7b7470d6",
+	"name": "api-tests-env",
+	"values": [
+		{
+			"key": "api-url",
+			"value": "",
+			"type": "default",
+			"enabled": true
+		},
+		{
+			"key": "api-sn",
+			"value": "",
+			"type": "default",
+			"enabled": true
+		},
+		{
+			"key": "api-authorization",
+			"value": "",
+			"type": "default",
+			"enabled": true
+		},
+		{
+			"key": "api-login-id",
+			"value": "",
+			"type": "default",
+			"enabled": true
+		},
+		{
+			"key": "api-content-type",
+			"value": "",
+			"type": "default",
+			"enabled": true
+		},
+		{
+			"key": "api-language",
+			"value": "",
+			"type": "default",
+			"enabled": true
+		},
+		{
+			"key": "api-client-type",
+			"value": "",
+			"type": "default",
+			"enabled": true
+		},
+		{
+			"key": "api-x-tiansi-bypass",
+			"value": "",
+			"type": "default",
+			"enabled": true
+		}
+	],
+	"color": null,
+	"_postman_variable_scope": "environment",
+	"_postman_exported_at": "2026-01-06T02:01:56.258Z",
+	"_postman_exported_using": "Postman/11.77.2"
+}