Commit acef7870 authored by liguangyu06's avatar liguangyu06
Browse files

用例优化

parent bf9fa052
......@@ -34,16 +34,16 @@ result = json.loads(result.content)
# 生成随机数
flow_random = random.randint(0, len(result["data"]["list"]) - 1)
# 获取超发记录信息
demandCode = result["data"]["list"][flow_random]["demandCode"]
customerCode = result["data"]["list"][flow_random]["customerCode"]
# 第三步进行列表查询条件验证
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url16")
request_body = commonFuc().get_business_data(module, "payload16", demandCode)
request_body = commonFuc().get_business_data(module, "payload16", customerCode)
"""
场景: 超发记录导出功能验证
用例名称:超发记录导出功能验证
输出:{"demandCode":"%s"}
输出:{"customerCode":"%s"}
"""
# 发送请求
......@@ -62,13 +62,13 @@ with open(file_path, 'wb') as f:
# 获取导出文件中子需求单号
excel = HandleExcel(file_path, "Sheet1")
# print(excel.read_data())
result = {"demandCode": excel.read_data()[0].get("子需求单号")}
result = {"customerCode": excel.read_data()[0].get("客户名称")}
# 将接口响应时间添加至结果中
result["api_time"] = api_time
# 获取预期结果
check_dict = commonFuc().get_business_data(module, "checkDict16", demandCode)
check_dict = commonFuc().get_business_data(module, "checkDict16", customerCode)
# print(check_dict)
# 断言实际结果中是否包含预期结果的内容
commonFuc().check_result(check_dict, result)
......
......@@ -75,9 +75,9 @@ checkDict15: {"productData":"%s"}
#测试场景16:超发记录导出功能验证
"url16": "/order/public/exportStayOverflowExcel"
"payload16": {"demandCode":"%s"}
"payload16": {"custData":"%s"}
#预期结果
checkDict16: {"demandCode":"%s"}
checkDict16: {"customerCode":"%s"}
#测试场景7:获取超发配置列表
"url7": "/order/public/supernovaList"
......
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