Commit ff582d34 authored by liguangyu06's avatar liguangyu06
Browse files

优化

parent 8fa1e69c
......@@ -38,11 +38,19 @@ request_body = commonFuc().get_business_data(module, "payload22", stash_msg)
result = requests.get(url, params=request_body, headers=headers)
result = json.loads(result.content)
# print(result)
# 获取查询结果中stashCode
result = {"stashCode": result["data"][0]["stashCode"][:1]}
# 获取预期结果
check_dict = commonFuc().get_business_data(module, "checkDict22", stash_msg)
# print(check_dict)
# 断言实际结果中是否包含预期结果的内容
commonFuc().check_result(check_dict, result)
# 增加判断登录失败情况
if result["success"]:
# 获取查询结果中stashCode
result = {"stashCode": result["data"][0]["stashCode"][:1]}
# 获取预期结果
check_dict = commonFuc().get_business_data(module, "checkDict22", stash_msg)
# print(check_dict)
# 断言实际结果中是否包含预期结果的内容
commonFuc().check_result(check_dict, result)
else:
# 获取预期结果
check_dict = commonFuc().get_business_data(module, "payload_401")
# print(check_dict)
# 断言实际结果中是否包含预期结果的内容
commonFuc().check_result(check_dict, result)
......@@ -24,6 +24,9 @@ json_headers1: {
"Sourcetype": "mall"
}
# 登录失败
"payload_401": {"code":"401","message":"Unauthorized","success":false}
#测试场景一:获取商品属性列表
"url1": "/product/productProperties/list"
"payload1": {"productCode":"","productName":"","specifications":"","materialCode":"","manufacturer":"","propertyName":"","propertyNote":"","propertyVal":"","createTimeStart":"","createTimeEnd":"","updateTimeEnd":"","updateTimeStart":"","times":null,"times2":null,"pageNumber":1,"pageSize":8}
......@@ -529,8 +532,13 @@ checkDict72: {"productLineCode":"%s"}
#预期结果
checkDict73: {"success":true,"code":"200","message":"正在同步中","data":null,"freshToken":null}
#测试场景七十四:获取产品线制单员列表
"url74": "/user/queryMarkerList"
"payload74": {"productLineCode":"%s","realName":"","memberIdsList":[],"pageNumber":1,"pageSize":5}
#预期结果
checkDict74: {"success":true,"code":"200","message":"正在同步中","data":null,"freshToken":null}
# 查询已分配制单员的产品线信息
"payload74_1": {"productLineCode":null,"productLineName":null,"memberId":null,"isDistribution":1,"pageStart":1,"pageSize":10}
......
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