Commit bd40d9ea authored by liguangyu06's avatar liguangyu06
Browse files

用例优化

parent 92897d84
......@@ -19,25 +19,22 @@ username = commonFuc().get_business_data(module, "username")
password = commonFuc().get_business_data(module, "password")
# 获取登录后Cmdc_access_token
cmdc_access_token = CmdcMaiiLogin(username, password).get_token()
headers = commonFuc().get_business_data(module, "json_headers", cmdc_access_token)
# 第二步查询站点对应的companyId
url1 = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url1")
request_body1 = commonFuc().get_business_data(module, "payload1")
result1 = requests.post(url1, json=request_body1, headers=headers)
result1 = json.loads(result1.text)
"""
场景:站点不拥有快速下单权限入口
用例名称:快速下单权限判定接口-站点满足条件显示快速下单入口
输入:companyId
输出:"quickOrderSign": 0
"""
# 发送请求
result1 = requests.post(url1, json=request_body1, headers=headers)
result1 = json.loads(result1.text)
# 获取站点对应的快速下单标识字段quickOrderSign
result1 = result1["data"]
......
......@@ -14,14 +14,16 @@ import json
module = "cmdc_query_customer"
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url")
# print(url)
# 获取登录所需账号密码
username = commonFuc().get_business_data(module, "username")
password = commonFuc().get_business_data(module, "password")
# 获取登录后Cmdc_access_token
cmdc_access_token = CmdcDoLogin(username, password).get_token()
headers = commonFuc().get_business_data(module, "json_headers1", cmdc_access_token)
# 进行客户查询操作
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url")
request_body = commonFuc().get_business_data(module, "payload1")
"""
......
......@@ -15,14 +15,15 @@ import json
module = "cmdc_userinfo_query"
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url1")
print(url)
# 获取登录所需账号密码
username = commonFuc().get_business_data(module, "username")
password = commonFuc().get_business_data(module, "password")
# 获取登录后Cmdc_access_token
cmdc_access_token = CmdcMaiiLogin(username, password).get_token()
headers = commonFuc().get_business_data(module, "json_headers", cmdc_access_token)
# 进行用户信息查询
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url1")
request_body = commonFuc().get_business_data(module, "payload1")
"""
......
......@@ -15,7 +15,6 @@ import json
module = "cmdc_website"
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url2")
# print(url)
# 获取登录所需账号密码
username = commonFuc().get_business_data(module, "username1")
......@@ -23,6 +22,9 @@ password = commonFuc().get_business_data(module, "password1")
# 获取登录后Cmdc_access_token
cmdc_access_token = CmdcMaiiLogin(username, password).get_token()
headers = commonFuc().get_business_data(module, "json_headers", cmdc_access_token)
# 进行站点切换
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url2")
request_body = commonFuc().get_business_data(module, "payload2")
"""
......
......@@ -15,7 +15,6 @@ import json
module = "cmdc_website"
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url1")
# print(url)
# 获取登录所需账号密码
username = commonFuc().get_business_data(module, "username")
......@@ -23,6 +22,9 @@ password = commonFuc().get_business_data(module, "password")
# 获取登录后Cmdc_access_token
cmdc_access_token = CmdcMaiiLogin(username, password).get_token()
headers = commonFuc().get_business_data(module, "json_headers", cmdc_access_token)
# 获取站点信息
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url1")
request_body = commonFuc().get_business_data(module, "payload1")
"""
......
......@@ -21,6 +21,7 @@ password = commonFuc().get_business_data(module, "password1")
# 获取登录后Cmdc_access_token
cmdc_access_token = CmdcMaiiLogin(username, password).get_token()
headers = commonFuc().get_business_data(module, "json_headers", cmdc_access_token)
# 第二步切换至子站点
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url2")
request_body = commonFuc().get_business_data(module, "payload2")
......
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