Commit 26a8cd6d authored by liguangyu06's avatar liguangyu06
Browse files

优化

1 merge request!6Master|代码更新归档
Showing with 19 additions and 15 deletions
+19 -15
......@@ -19,7 +19,7 @@ request_body = commonFuc().get_business_data(module, "payload11")
"""
场景: 获取站点信息验证_需求单
用例名称:获取站点信息验证_需求单
输出:{"companyId":6}
输出:{"companyId":7}
"""
# 发送请求
......@@ -27,6 +27,7 @@ result = requests.get(url, params=request_body)
# 获取接口响应时间
api_time = result.elapsed.total_seconds()
result = json.loads(result.content)
# print(result)
# 获取站点信息中公司id
result = {"companyId": result["data"]["companyId"]}
result["api_time"] = api_time
......
......@@ -16,8 +16,8 @@ module = "cmdc_demand_mall"
# 第一步登录多采商城获取token
# 获取登录所需账号密码
username = commonFuc().get_business_data(module, "username")
password = commonFuc().get_business_data(module, "password")
username = commonFuc().get_business_data(module, "username3")
password = commonFuc().get_business_data(module, "password3")
# 获取登录后Cmdc_access_token
cmdc_access_token = CmdcMaiiLogin(username, password).get_token()
headers = commonFuc().get_business_data(module, "json_headers1", cmdc_access_token)
......@@ -33,7 +33,7 @@ result = json.loads(result.content)
random_demand = random.randint(0, len(result["data"]["list"]) - 1)
# 获取需求单信息
demand_code = result["data"]["list"][random_demand]["demandCode"]
demand_code = "17020165859551447"
demand_code = "17023454128426831"
# 第三步获取需求单对应的订单变动明细列表
......@@ -51,7 +51,7 @@ result = requests.get(url, params=request_body, headers=headers)
# 获取接口响应时间
api_time = result.elapsed.total_seconds()
result = json.loads(result.content)
print(result)
# print(result)
# 获取订单明细列表中isChange
result = {"isChange": result["data"]["isChange"]}
result["api_time"] = api_time
......
......@@ -16,8 +16,8 @@ module = "cmdc_demand_mall"
# 第一步登录多采商城获取token
# 获取登录所需账号密码
username = commonFuc().get_business_data(module, "username")
password = commonFuc().get_business_data(module, "password")
username = commonFuc().get_business_data(module, "username3")
password = commonFuc().get_business_data(module, "password3")
# 获取登录后Cmdc_access_token
cmdc_access_token = CmdcMaiiLogin(username, password).get_token()
headers = commonFuc().get_business_data(module, "json_headers1", cmdc_access_token)
......@@ -33,9 +33,9 @@ result = json.loads(result.content)
random_demand = random.randint(0, len(result["data"]["list"]) - 1)
# 获取需求单信息
# demand_code = result["data"]["list"][random_demand]["demandCode"]
demand_code = "17018438457347575"
demand_code = "17023454128426831"
# demand_parent_code = result["data"]["list"][random_demand]["demandParentCode"]
demand_parent_code = "s2312061400015"
demand_parent_code = "s2312120900008"
# 第三步获取需求单对应的操作记录
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url12")
......
......@@ -36,9 +36,9 @@ result = json.loads(result.content)
random_demand = random.randint(0, len(result["data"]["list"]) - 1)
# 获取需求单信息
demand_id = result["data"]["list"][random_demand]["demandId"]
# demand_id = "40187"
# demand_id = "37974"
demand_code = result["data"]["list"][random_demand]["demandCode"]
# 16934694037805759
# 第三步进行需求单销售合同下载
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url22")
......@@ -69,10 +69,10 @@ excel = HandleExcel(file_path, "Sheet1")
result = {"demandCode": excel.read_data()[0].get("医疗器械产品销售合同 ")[-17:]}
print(excel.read_data()[0].get("医疗器械产品销售合同 "))
result["api_time"] = api_time
print(result)
# print(result)
# 获取预期结果
check_dict = commonFuc().get_business_data(module, "checkDict22", demand_code)
print(check_dict)
# print(check_dict)
# 断言实际结果中是否包含预期结果的内容
commonFuc().check_result(check_dict, result)
......@@ -2,6 +2,9 @@
"username": "BJ0621"
"password": "Aa123456"
"username3": "GL1000086"
"password3": "Aa123456"
#后台运营管理系统登录信息(子站点上海医疗器械有限公司)
"username1": "Admin00111"
"password1": "Aa123456"
......@@ -93,9 +96,9 @@ checkDict10: {"demandCode":"%s"}
#测试场景十一:获取站点信息验证_需求单
"url11": "/cms/public/website/queryWebsiteByCompanyIdNoCode"
"payload11": {"companyId":6}
"payload11": {"companyId":7}
#预期结果
checkDict11: {"companyId":6}
checkDict11: {"companyId":7}
......
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