Commit cb57052a authored by liguangyu06's avatar liguangyu06
Browse files

优化

parent 87c491f7
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
__author__ = "liguangyu" __author__ = "liguangyu"
""" """
case_tag:api,cmdc获取需求单列表,用例集id2250,sit,bs case_tag:api,cmdc获取需求单列表,2250,sit,bs
主数据平台:运营后台管理系统需求单列表接口 主数据平台:运营后台管理系统需求单列表接口
""" """
...@@ -14,8 +14,8 @@ import json ...@@ -14,8 +14,8 @@ import json
module = "cmdc_demand_list" module = "cmdc_demand_list"
url123 = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url") url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url1")
print(url123) print(url)
# 获取登录所需账号密码 # 获取登录所需账号密码
username = commonFuc().get_business_data(module, "username") username = commonFuc().get_business_data(module, "username")
password = commonFuc().get_business_data(module, "password") password = commonFuc().get_business_data(module, "password")
...@@ -32,7 +32,7 @@ print(request_body) ...@@ -32,7 +32,7 @@ print(request_body)
输出:{"success":true,"code":"200","message":"OK"} 输出:{"success":true,"code":"200","message":"OK"}
""" """
# 发送请求 # 发送请求
result = requests.post(url123, json=request_body, headers=headers) result = requests.post(url, json=request_body, headers=headers)
result = json.loads(result.content) result = json.loads(result.content)
print(result) print(result)
# 获取预期结果 # 获取预期结果
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
__author__ = "liguangyu" __author__ = "liguangyu"
""" """
case_tag:api,cmdc需求单-草稿订单删除逆向用例功能验证,用例集id2250,sit,bs case_tag:api,cmdc需求单-草稿订单删除逆向用例功能验证,2250,sit,bs
主数据平台:运营后台管理系统需求单-草稿订单删除接口 主数据平台:运营后台管理系统需求单-草稿订单删除接口
""" """
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
__author__ = "liguangyu" __author__ = "liguangyu"
""" """
case_tag:api,cmdc需求单-草稿订单删除功能验证,用例集id2250,sit,bs case_tag:api,cmdc需求单-草稿订单删除功能验证,2250,sit,bs
主数据平台:运营后台管理系统需求单-草稿订单删除接口 主数据平台:运营后台管理系统需求单-草稿订单删除接口
""" """
...@@ -40,4 +40,3 @@ check_dict = commonFuc().get_business_data(module, "checkDict3") ...@@ -40,4 +40,3 @@ check_dict = commonFuc().get_business_data(module, "checkDict3")
print(check_dict) print(check_dict)
# 断言实际结果中是否包含预期结果的内容 # 断言实际结果中是否包含预期结果的内容
commonFuc().check_result(check_dict, result) commonFuc().check_result(check_dict, result)
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
__author__ = "liguangyu" __author__ = "liguangyu"
""" """
case_tag:api,cmdc需求单获取失败,用例集id2250,sit,bs case_tag:api,cmdc需求单获取失败,2250,sit,bs
主数据平台:运营后台管理系统需求单列表接口 主数据平台:运营后台管理系统需求单列表接口
""" """
...@@ -13,7 +13,7 @@ import json ...@@ -13,7 +13,7 @@ import json
module = "cmdc_demand_list" module = "cmdc_demand_list"
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url") url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url1")
# url = "https://service-slb.cmic.com.cn/order/back/listDemand" # url = "https://service-slb.cmic.com.cn/order/back/listDemand"
print(url) print(url)
headers = commonFuc().get_business_data(module, "json_headers") headers = commonFuc().get_business_data(module, "json_headers")
...@@ -23,7 +23,7 @@ print(request_body) ...@@ -23,7 +23,7 @@ print(request_body)
""" """
场景:用户信息过期或获取失败,无法访问需求列表 场景:用户信息过期或获取失败,无法访问需求列表
用例名称:需求单-获取用户信息失败 用例名称:需求单-获取用户信息失败
输出:{"success":false,"code":"login_empty","message":"获取登录信息失败","data":null,"freshToken":null} 输出:{"code":"401","message":"Unauthorized","success":false}
""" """
# 发送请求 # 发送请求
result = requests.post(url, json=request_body, headers=headers) result = requests.post(url, json=request_body, headers=headers)
......
...@@ -67,6 +67,6 @@ class CmdcDoLogin(): ...@@ -67,6 +67,6 @@ class CmdcDoLogin():
if __name__ == "__main__": if __name__ == "__main__":
cmdc_access_token = CmdcDoLogin("admin1", "FFtmods@365y").get_token() cmdc_access_token = CmdcDoLogin("admin2", "FFtmods@365y").get_token()
print(cmdc_access_token) print(cmdc_access_token)
...@@ -34,11 +34,12 @@ class CmdcMaiiLogin(): ...@@ -34,11 +34,12 @@ class CmdcMaiiLogin():
# 发送请求获取验证码 # 发送请求获取验证码
result = requests.get(code_url, params=param) result = requests.get(code_url, params=param)
# print(result.content) # print(result.content)
with open("verifycode.png", 'wb') as f:
f.write(result.content)
# 获取当前文件路径 # 获取当前文件路径
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
code_path = BASE_DIR + "/多彩商城登录.air/verifycode.png" code_path = BASE_DIR + "/多彩商城登录/verifycode.png"
# 获取到验证码存入本地文件
with open(code_path, 'wb') as f:
f.write(result.content)
# 识别并获取验证码 # 识别并获取验证码
code = VerificationCodeOcr(code_path, "rainbow123", "rainbow123").base64_api() code = VerificationCodeOcr(code_path, "rainbow123", "rainbow123").base64_api()
# 获取多彩商城登录地址 # 获取多彩商城登录地址
......
...@@ -34,11 +34,12 @@ class CmdcMaiiLogin(): ...@@ -34,11 +34,12 @@ class CmdcMaiiLogin():
# 发送请求获取验证码 # 发送请求获取验证码
result = requests.get(code_url, params=param) result = requests.get(code_url, params=param)
# print(result.content) # print(result.content)
with open("verifycode.png", 'wb') as f:
f.write(result.content)
# 获取当前文件路径 # 获取当前文件路径
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
code_path = BASE_DIR + "/多彩商城登录.air/verifycode.png" code_path = BASE_DIR + "/多彩商城登录/verifycode.png"
# 获取到验证码存入本地文件
with open(code_path, 'wb') as f:
f.write(result.content)
# 识别并获取验证码 # 识别并获取验证码
code = VerificationCodeOcr(code_path, "rainbow123", "rainbow123").base64_api() code = VerificationCodeOcr(code_path, "rainbow123", "rainbow123").base64_api()
# 获取多彩商城登录地址 # 获取多彩商城登录地址
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
__author__ = "liguangyu" __author__ = "liguangyu"
""" """
case_tag:api,cmdc采购单查询,用例集id2250,sit,bs case_tag:api,cmdc采购单查询,2250,sit,bs
主数据平台:运营后台管理系统采购单查询接口 主数据平台:运营后台管理系统采购单查询接口
""" """
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
__author__ = "liguangyu" __author__ = "liguangyu"
""" """
case_tag:api,cmdc客户查询,用例集id2250,sit,bs case_tag:api,cmdc客户查询,2250,sit,bs
主数据平台:运营后台管理系统客户接口 主数据平台:运营后台管理系统客户接口
""" """
......
#需求单列表接口地址 #需求单列表接口地址
"url": "/order/back/listDemand" "url1": "/order/back/listDemand"
json_headers: { json_headers: {
"Content-Type": "application/json", "Content-Type": "application/json",
"Cmdc_access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VySWQiOjIsInVzZXJOYW1lIjoiYWRtaW4yIiwidGltZSI6MTY5Mzk4ODY5NDg0M30.f71cshaaFyY2w2i53P87etu5-x2Y3gqMVKraUGYndp0" "Cmdc_access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VySWQiOjIsInVzZXJOYW1lIjoiYWRtaW4yIiwidGltZSI6MTY5Mzk4ODY5NDg0M30.f71cshaaFyY2w2i53P87etu5-x2Y3gqMVKraUGYndp0"
...@@ -7,7 +7,7 @@ json_headers: { ...@@ -7,7 +7,7 @@ json_headers: {
"payload": {"times":[null],"listOrderStatus":[],"productName":null,"demandCode":null,"demandParentCode":null,"customerName":null,"manufacturer":null,"materialCode":null,"sellerCompanyName":null,"produceRegisterNum":null,"productLineName":null,"auditByName":null,"orderSource":null,"changeTypeList":null,"isRebateEdit":null,"jdeType":null,"pageSize":8,"pageStart":1,"orderChangeType":null,"snSgin":null,"changeSign":null,"customerCode":null,"distributionType":null,"busCustomerCode":null,"loginName":null,"cancelSign":0,"shipmentType":null,"startTime":null} "payload": {"times":[null],"listOrderStatus":[],"productName":null,"demandCode":null,"demandParentCode":null,"customerName":null,"manufacturer":null,"materialCode":null,"sellerCompanyName":null,"produceRegisterNum":null,"productLineName":null,"auditByName":null,"orderSource":null,"changeTypeList":null,"isRebateEdit":null,"jdeType":null,"pageSize":8,"pageStart":1,"orderChangeType":null,"snSgin":null,"changeSign":null,"customerCode":null,"distributionType":null,"busCustomerCode":null,"loginName":null,"cancelSign":0,"shipmentType":null,"startTime":null}
#预期结果 #预期结果
checkDict1: {"success":false,"code":"login_empty","message":"获取登录信息失败","data":null,"freshToken":null} checkDict1: {"code":"401","message":"Unauthorized","success":false}
# 后台运营管理系统登录信息 # 后台运营管理系统登录信息
"username": "admin2" "username": "admin2"
......
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