Commit 6dfc588f authored by liguangyu06's avatar liguangyu06
Browse files

优化

parent 7e990fa1
...@@ -13,16 +13,16 @@ import json ...@@ -13,16 +13,16 @@ import json
module = "cmdc_33st" module = "cmdc_33st"
# # 第一步登录后台运营系统获取token # 第一步登录后台运营系统获取token
# username = commonFuc().get_business_data(module, "username_do_be") username = commonFuc().get_business_data(module, "username_do_be")
# password = commonFuc().get_business_data(module, "password_do_be") password = commonFuc().get_business_data(module, "password_do_be")
# # 获取登录后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)
# 第二步进入欠货管理列表 # 第二步进入欠货管理列表
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url43") url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url43")
request_body = commonFuc().get_business_data(module, "payload43")
""" """
场景: 欠货管理列表获取合同协议号接口新增合同名称字段验证 场景: 欠货管理列表获取合同协议号接口新增合同名称字段验证
...@@ -31,16 +31,19 @@ url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url43") ...@@ -31,16 +31,19 @@ url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url43")
""" """
# 发送请求 # 发送请求
result = requests.get(url) result = requests.post(url, json=request_body, headers=headers)
# 获取接口响应时间 # 获取接口响应时间
api_time = float(result.elapsed.total_seconds()) api_time = float(result.elapsed.total_seconds())
# 将接口响应时间添加至result # 获取合同协议相关信息
result = json.loads(result.content) result = json.loads(result.content)
result = result["data"][0]
# 将接口响应时间添加至result
result["api_time"] = api_time result["api_time"] = api_time
# 获取预期结果 # 获取预期结果
check_dict = commonFuc().get_business_data(module, "checkDict43") check_dict = commonFuc().get_business_data(module, "checkDict43")
# print(check_dict) # print(check_dict)
# 断言实际结果中是否包含预期结果的内容 # 断言实际结果中是否包含预期结果的内容
commonFuc().check_variable_exist(check_dict, result["data"][0]) commonFuc().check_variable_exist(check_dict, result)
...@@ -299,7 +299,8 @@ checkDict41: {"draftDemandCode":"%s"} ...@@ -299,7 +299,8 @@ checkDict41: {"draftDemandCode":"%s"}
checkDict42: ["contractAgreementName"] checkDict42: ["contractAgreementName"]
#测试场景43:欠货管理列表获取合同协议号接口新增合同名称字段验证 #测试场景43:欠货管理列表获取合同协议号接口新增合同名称字段验证
"url43": "/user/public/vptihtxyJde/getVptihtxyByPacNo" "url43": "/user/getVptihtxyJdeByCodeAndComp"
"payload43": {}
#预期结果 #预期结果
checkDict43: ["contractAgreementName"] checkDict43: ["contractAgreementName"]
......
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