Commit 83b15939 authored by liguangyu06's avatar liguangyu06
Browse files

优化调整

parent a62e1393
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
__author__ = "liguangyu" __author__ = "liguangyu"
""" """
case_tag:cmdc_api,cmdc快速下单-需求单取消,2252,2252-4,sit,bs case_tag:cmdc_api,cmdc快速下单-申请取消-审核,2252,2252-4,sit,bs
涉及到接口:需求单创建、需求单取消等接口 涉及到接口:需求单创建、需求单取消、审核等接口
""" """
from common.common_func import commonFuc from common.common_func import commonFuc
...@@ -46,10 +46,10 @@ check_dict2 = commonFuc().get_business_data(module, "checkDict2") ...@@ -46,10 +46,10 @@ check_dict2 = commonFuc().get_business_data(module, "checkDict2")
# 断言实际结果中是否包含预期结果的内容 # 断言实际结果中是否包含预期结果的内容
commonFuc().check_result(check_dict2, result2) commonFuc().check_result(check_dict2, result2)
# 第四步获取到新增草稿订单对应的id并进行参数化赋值处理 # 第四步获取到新增需求单对应的id并进行参数化赋值处理
demand_code = result2["data"]["list"][0]["demandCode"] demand_code = result2["data"]["list"][0]["demandCode"]
print(demand_code)
# 步骤五对新创建的草稿订单进行删除操作 # 步骤五对新创建的需求单进行取消申请操作
url3 = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url30") url3 = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url30")
request_body3 = commonFuc().get_business_data(module, "payload30", demand_code) request_body3 = commonFuc().get_business_data(module, "payload30", demand_code)
# 发送请求 # 发送请求
...@@ -62,8 +62,41 @@ check_dict3 = commonFuc().get_business_data(module, "checkDict30") ...@@ -62,8 +62,41 @@ check_dict3 = commonFuc().get_business_data(module, "checkDict30")
commonFuc().check_result(check_dict3, result3) commonFuc().check_result(check_dict3, result3)
""" """
场景:流程验证-快速下单创建-需求单取消 场景:流程验证-快速下单创建-申请取消-审核
用例名称:快速下单创建-需求单取消 用例名称:快速下单创建-申请取消-审核
备注说明:此处取消为取消申请操作,需相关人员进行审核处理
""" """
# 步骤六在后台运营系统查询出用户提交取消申请
# 登录后台运营系统获取token信息
# 获取登录多彩商城所需账号密码
username = commonFuc().get_business_data(module, "username1")
password = commonFuc().get_business_data(module, "password1")
# 获取登录后Cmdc_access_token并进行参数化赋值
cmdc_access_token = CmdcDoLogin(username, password).get_token()
headers = commonFuc().get_business_data(module, "json_headers", cmdc_access_token)
# 查询用户提交的取消的需求单
url4 = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url83")
request_body4 = commonFuc().get_business_data(module, "payload83", demand_code)
# 发送请求
result4 = requests.post(url4, json=request_body4, headers=headers)
result4 = json.loads(result4.content)
print(result4)
# 获取预期结果
check_dict4 = commonFuc().get_business_data(module, "checkDict83")
# 断言实际结果中是否包含预期结果的内容
commonFuc().check_result(check_dict4, result4)
# 获取demandid
demand_id = result2["data"]["list"][0]["demandId"]
# 对需求单进行审核操作
url5 = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url84")
print(url5)
request_body5 = commonFuc().get_business_data(module, "payload84", demand_id)
print(request_body5)
# 发送请求
result5 = requests.post(url5, json=request_body5, headers=headers)
result5 = json.loads(result5.content)
print(result5)
# 获取预期结果
check_dict5 = commonFuc().get_business_data(module, "checkDict84")
# 断言实际结果中是否包含预期结果的内容
commonFuc().check_result(check_dict5, result5)
...@@ -21,7 +21,7 @@ username = commonFuc().get_business_data(module, "username") ...@@ -21,7 +21,7 @@ username = commonFuc().get_business_data(module, "username")
password = commonFuc().get_business_data(module, "password") password = commonFuc().get_business_data(module, "password")
# 获取登录后Cmdc_access_token # 获取登录后Cmdc_access_token
cmdc_access_token = CmdcDoLogin(username, password).get_token() cmdc_access_token = CmdcDoLogin(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)
request_body = commonFuc().get_business_data(module, "payload1") request_body = commonFuc().get_business_data(module, "payload1")
""" """
......
...@@ -21,7 +21,7 @@ username = commonFuc().get_business_data(module, "username") ...@@ -21,7 +21,7 @@ username = commonFuc().get_business_data(module, "username")
password = commonFuc().get_business_data(module, "password") password = commonFuc().get_business_data(module, "password")
# 获取登录后Cmdc_access_token # 获取登录后Cmdc_access_token
cmdc_access_token = CmdcDoLogin(username, password).get_token() cmdc_access_token = CmdcDoLogin(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)
request_body = commonFuc().get_business_data(module, "payload1") request_body = commonFuc().get_business_data(module, "payload1")
""" """
......
...@@ -144,9 +144,18 @@ checkDict82: {"success":true,"code":"200","message":"OK","data":1,"freshToken":n ...@@ -144,9 +144,18 @@ checkDict82: {"success":true,"code":"200","message":"OK","data":1,"freshToken":n
#审核取消操作
#列表查询
"url83": "/order/back/listDemand"
"payload83": {"times":[null],"listOrderStatus":[],"productName":null,"demandCode":null,"demandParentCode":"%s","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}
#预期结果
checkDict83: {"success":true,"code":"200","message":"OK"}
#需求审核
"url84": "/order/back/refuseDemand"
"payload84": {"demandId":"%d","auditStatus":2,"auditRemark":"审核拒绝原因"}
#预期结果
checkDict84: {"success":true,"code":"200","message":"OK","data":1,"freshToken":null}
......
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