Commit 91e51ef2 authored by liguangyu06's avatar liguangyu06
Browse files

优化

parent 1ba11eca
...@@ -15,8 +15,8 @@ import json ...@@ -15,8 +15,8 @@ import json
module = "cmdc_order_merge" module = "cmdc_order_merge"
# 第一步登录后台运营系统获取token信息 # 第一步登录后台运营系统获取token信息
username = commonFuc().get_business_data(module, "username1") username = commonFuc().get_business_data(module, "username2")
password = commonFuc().get_business_data(module, "password1") password = commonFuc().get_business_data(module, "password2")
# 获取登录后Cmdc_access_token # 获取登录后Cmdc_access_token
cmdc_access_token = CmdcDoLogin(username, password).get_token() cmdc_access_token = CmdcDoLogin(username, password).get_token()
headers = commonFuc().get_business_data(module, "json_headers", cmdc_access_token) headers = commonFuc().get_business_data(module, "json_headers", cmdc_access_token)
......
...@@ -15,22 +15,22 @@ import json ...@@ -15,22 +15,22 @@ import json
module = "cmdc_order_merge" module = "cmdc_order_merge"
# 获取登录所需账号密码 # 获取登录所需账号密码
username = commonFuc().get_business_data(module, "username1") username = commonFuc().get_business_data(module, "username2")
password = commonFuc().get_business_data(module, "password1") password = commonFuc().get_business_data(module, "password2")
# 获取登录后Cmdc_access_token # 获取登录后Cmdc_access_token
cmdc_access_token = CmdcDoLogin(username, password).get_token() cmdc_access_token = CmdcDoLogin(username, password).get_token()
headers = commonFuc().get_business_data(module, "json_headers", cmdc_access_token) headers = commonFuc().get_business_data(module, "json_headers", cmdc_access_token)
# 设置需要查询的商品编码 # 设置需要查询的商品编码
product_code_random = "16518884" product_code_random = "14384307"
# 模糊查询商品编码信息 # 模糊查询商品编码信息
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url3") url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url3")
request_body = commonFuc().get_business_data(module, "payload3", product_code_random) request_body = commonFuc().get_business_data(module, "payload3", product_code_random)
""" """
场景: 验证模糊查询客户信息接口连通性 场景: 验证模糊查询商品编码信息接口连通性
用例名称:模糊查询客户信息 用例名称:模糊查询商品编码信息
输出:{"productCode":"%s"} 输出:{"productCode":"%s"}
""" """
# 发送请求 # 发送请求
...@@ -38,7 +38,7 @@ result = requests.post(url, json=request_body, headers=headers) ...@@ -38,7 +38,7 @@ result = requests.post(url, json=request_body, headers=headers)
# 获取接口响应时间 # 获取接口响应时间
api_time = float(result.elapsed.total_seconds()) api_time = float(result.elapsed.total_seconds())
result = json.loads(result.content) result = json.loads(result.content)
# print(result)
# 获取查询结果中商品编码信息 # 获取查询结果中商品编码信息
result = {"productCode": result["data"][0]["productCode"]} result = {"productCode": result["data"][0]["productCode"]}
# print(result) # print(result)
......
...@@ -15,8 +15,8 @@ import json ...@@ -15,8 +15,8 @@ import json
module = "cmdc_order_merge" module = "cmdc_order_merge"
# 获取登录所需账号密码 # 获取登录所需账号密码
username = commonFuc().get_business_data(module, "username1") username = commonFuc().get_business_data(module, "username2")
password = commonFuc().get_business_data(module, "password1") password = commonFuc().get_business_data(module, "password2")
# 获取登录后Cmdc_access_token # 获取登录后Cmdc_access_token
cmdc_access_token = CmdcDoLogin(username, password).get_token() cmdc_access_token = CmdcDoLogin(username, password).get_token()
headers = commonFuc().get_business_data(module, "json_headers", cmdc_access_token) headers = commonFuc().get_business_data(module, "json_headers", cmdc_access_token)
......
...@@ -15,14 +15,14 @@ import json ...@@ -15,14 +15,14 @@ import json
module = "cmdc_order_merge" module = "cmdc_order_merge"
# 获取登录所需账号密码 # 获取登录所需账号密码
username = commonFuc().get_business_data(module, "username1") username = commonFuc().get_business_data(module, "username2")
password = commonFuc().get_business_data(module, "password1") password = commonFuc().get_business_data(module, "password2")
# 获取登录后Cmdc_access_token # 获取登录后Cmdc_access_token
cmdc_access_token = CmdcDoLogin(username, password).get_token() cmdc_access_token = CmdcDoLogin(username, password).get_token()
headers = commonFuc().get_business_data(module, "json_headers", cmdc_access_token) headers = commonFuc().get_business_data(module, "json_headers", cmdc_access_token)
# 设置需要查询的模糊字段 # 设置需要查询的模糊字段
material_code_random = "14306" material_code_random = "TPVL200"
# 模糊查询物料编码 # 模糊查询物料编码
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url6") url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url6")
......
...@@ -15,8 +15,8 @@ import json ...@@ -15,8 +15,8 @@ import json
module = "cmdc_order_merge" module = "cmdc_order_merge"
# 第一步获取登录所需账号密码 # 第一步获取登录所需账号密码
username = commonFuc().get_business_data(module, "username1") username = commonFuc().get_business_data(module, "username2")
password = commonFuc().get_business_data(module, "password1") password = commonFuc().get_business_data(module, "password2")
# 获取登录后Cmdc_access_token # 获取登录后Cmdc_access_token
cmdc_access_token = CmdcDoLogin(username, password).get_token() cmdc_access_token = CmdcDoLogin(username, password).get_token()
headers = commonFuc().get_business_data(module, "json_headers", cmdc_access_token) headers = commonFuc().get_business_data(module, "json_headers", cmdc_access_token)
......
...@@ -6,6 +6,10 @@ ...@@ -6,6 +6,10 @@
"username1": "Admin00111" "username1": "Admin00111"
"password1": "Aa123456" "password1": "Aa123456"
#后台运营管理系统登录信息(子站点国联医疗器械有限公司)
"username2": "Admin00102"
"password2": "Aa123456"
#后台管理系统headers #后台管理系统headers
json_headers: { json_headers: {
...@@ -38,7 +42,7 @@ checkDict2: {"cusCompanyName":"%s"} ...@@ -38,7 +42,7 @@ checkDict2: {"cusCompanyName":"%s"}
#测试场景三:模糊查询商品编码信息 #测试场景三:模糊查询商品编码信息
"url3": "/product/public/getProductVoAll" "url3": "/product/public/getProductVoAll"
"payload3": {"productCodeList":["%s"],"filialeCode":"00111"} "payload3": {"productCodeList":["%s"],"filialeCode":"00102"}
#预期结果 #预期结果
checkDict3: {"productCode":"%s"} checkDict3: {"productCode":"%s"}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment