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

优化

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