Commit 4224c6fe authored by liguangyu06's avatar liguangyu06
Browse files

1、购物车新增业务场景用例

2、tag标签命名调整
parent b36661c6
...@@ -12,9 +12,9 @@ import json ...@@ -12,9 +12,9 @@ import json
module = "cmdc-qos" module = "cmdc-qos"
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url") # url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url")
print(url) # print(url)
# url = "https://service-slb.cmic.com.cn/cms/public/isQuickOrderSign" url = "https://service-slb.cmic.com.cn/cms/public/isQuickOrderSign"
# 获取公司ID # 获取公司ID
companyId = commonFuc().get_business_data(module, "companyId2") companyId = commonFuc().get_business_data(module, "companyId2")
print(companyId) print(companyId)
......
...@@ -12,9 +12,10 @@ import json ...@@ -12,9 +12,10 @@ import json
module = "cmdc-qos" module = "cmdc-qos"
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url") # url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url")
# print(url)
url = "https://service-slb.cmic.com.cn/cms/public/isQuickOrderSign"
print(url) print(url)
# url = "https://service-slb.cmic.com.cn/cms/public/isQuickOrderSign"
# 获取公司ID # 获取公司ID
companyId = commonFuc().get_business_data(module, "companyId1") companyId = commonFuc().get_business_data(module, "companyId1")
print(companyId) print(companyId)
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
__author__ = "liguangyu" __author__ = "liguangyu"
""" """
case_tag:api,cmdc新增不存在的商品至购物车列表,2252,2252-3,sit, case_tag:api,cmdc新增不存在的商品至购物车列表,2252,2252-4,sit,bs
主数据平台:多彩商城购物车列表新增商品接口 主数据平台:多彩商城购物车列表新增商品接口
""" """
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
__author__ = "liguangyu" __author__ = "liguangyu"
""" """
case_tag:api,cmdc新增已下架的商品至购物车列表,10000,sit,bs case_tag:api,cmdc新增已失效的商品至购物车列表,2252,2252-4,sit,bs
主数据平台:多彩商城购物车列表新增商品接口 主数据平台:多彩商城购物车列表新增商品接口
""" """
...@@ -15,7 +15,7 @@ import json ...@@ -15,7 +15,7 @@ import json
module = "cmdc_buyercar_list" module = "cmdc_buyercar_list"
# 步骤一登录后台管理系统查询已下架商品列表获取已下架商品信息 # 步骤一登录后台管理系统查询已失效商品列表获取已下架商品信息
# 获取登录后台管理系统所需账号密码 # 获取登录后台管理系统所需账号密码
username = commonFuc().get_business_data(module, "username1") username = commonFuc().get_business_data(module, "username1")
password = commonFuc().get_business_data(module, "password1") password = commonFuc().get_business_data(module, "password1")
...@@ -24,7 +24,7 @@ cmdc_access_token = CmdcDoLogin(username, password).get_token() ...@@ -24,7 +24,7 @@ cmdc_access_token = CmdcDoLogin(username, password).get_token()
print(cmdc_access_token) print(cmdc_access_token)
headers = commonFuc().get_business_data(module, "json_headers", cmdc_access_token) headers = commonFuc().get_business_data(module, "json_headers", cmdc_access_token)
print(headers) print(headers)
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url") url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url50")
print(url) print(url)
request_body = commonFuc().get_business_data(module, "payload50") request_body = commonFuc().get_business_data(module, "payload50")
print(request_body) print(request_body)
...@@ -32,15 +32,10 @@ print(request_body) ...@@ -32,15 +32,10 @@ print(request_body)
result = requests.post(url, 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)
current_company_id = result["data"]["list"][0]["companyId"]
print(current_company_id)
product_id = result["data"]["list"][0]["productId"] product_id = result["data"]["list"][0]["productId"]
print(product_id) print(product_id)
agreement_price_id = result["data"]["list"][0]["agreementPriceId"] price = result["data"]["list"][0]["referencePrice"]
print(agreement_price_id)
price = result["data"]["list"][0]["price"]
print(price) print(price)
# 第二步登录多彩商城添加商品至购物车列表 # 第二步登录多彩商城添加商品至购物车列表
# 获取登录多彩商城所需账号密码 # 获取登录多彩商城所需账号密码
username = commonFuc().get_business_data(module, "username") username = commonFuc().get_business_data(module, "username")
...@@ -52,12 +47,12 @@ headers = commonFuc().get_business_data(module, "json_headers5", cmdc_access_tok ...@@ -52,12 +47,12 @@ headers = commonFuc().get_business_data(module, "json_headers5", cmdc_access_tok
print(headers) print(headers)
url1 = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url2") url1 = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url2")
print(url1) print(url1)
request_body = commonFuc().get_business_data(module, "payload5", current_company_id, product_id, agreement_price_id, price ) request_body = commonFuc().get_business_data(module, "payload5", product_id, price)
print(request_body) print(request_body)
""" """
场景:新增已下架的商品至购物车列表 场景:新增已失效的商品至购物车列表
用例名称:新增已下架的商品至购物车列表 用例名称:新增已失效的商品至购物车列表
输出:{"success":false,"code":"1078","message":"商品不存在,加入购物车失败","data":null,"freshToken":null} 输出:{"success":false,"code":"addBuyerCartFail","message":"商品为失效状态,不可加入购物车","data":null,"freshToken":null}
""" """
# 发送请求 # 发送请求
result = requests.post(url1, json=request_body, headers=headers) result = requests.post(url1, json=request_body, headers=headers)
......
# -*- encoding=utf8 -*-
__author__ = "liguangyu"
"""
case_tag:api,cmdc新增控销的商品至购物车列表,2252,2252-4,sit,bs
主数据平台:多彩商城购物车列表新增商品接口
"""
from common.common_func import commonFuc
from air_case.cmdc_login.多彩商城登录.多彩商城登录 import CmdcMaiiLogin
from air_case.cmdc_login.后台管理系统登录.后台管理系统登录 import CmdcDoLogin
import requests
import json
module = "cmdc_buyercar_list"
# 步骤一登录后台管理系统查询控销商品列表获取已下架商品信息
# 获取登录后台管理系统所需账号密码
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()
print(cmdc_access_token)
headers = commonFuc().get_business_data(module, "json_headers", cmdc_access_token)
print(headers)
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url70")
print(url)
request_body = commonFuc().get_business_data(module, "payload70")
print(request_body)
# 发送请求
result = requests.post(url, json=request_body, headers=headers)
result = json.loads(result.content)
print(result)
if result["data"]["list"][0]["isControlSales"] == 1:
product_id = result["data"]["list"][0]["productId"]
print(product_id)
price = result["data"]["list"][0]["referencePrice"]
print(price)
# 第二步登录多彩商城添加商品至购物车列表
# 获取登录多彩商城所需账号密码
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()
print(cmdc_access_token)
headers = commonFuc().get_business_data(module, "json_headers7", cmdc_access_token)
print(headers)
url1 = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url2")
print(url1)
request_body = commonFuc().get_business_data(module, "payload7", product_id, price)
print(request_body)
"""
场景:新增控销的商品至购物车列表
用例名称:新增控销的商品至购物车列表
输出:{"success":false,"code":"addBuyerCartFail","message":"商品为控销商品,不可加入购物车","data":null,"freshToken":null}
"""
# 发送请求
result = requests.post(url1, json=request_body, headers=headers)
result = json.loads(result.content)
print(result)
# 获取预期结果
check_dict = commonFuc().get_business_data(module, "checkDict7")
print(check_dict)
# 断言实际结果中是否包含预期结果的内容
commonFuc().check_result(check_dict, result)
\ No newline at end of file
# -*- encoding=utf8 -*-
__author__ = "liguangyu"
"""
case_tag:api,cmdc添加JDE已停用的商品至购物车列表,2252,2252-4,sit,bs
主数据平台:多彩商城购物车列表新增商品接口
"""
from common.common_func import commonFuc
from air_case.cmdc_login.多彩商城登录.多彩商城登录 import CmdcMaiiLogin
from air_case.cmdc_login.后台管理系统登录.后台管理系统登录 import CmdcDoLogin
import requests
import json
module = "cmdc_buyercar_list"
# 步骤一登录后台管理系统查询商品列表获取添加JDE已停用商品信息
# 获取登录后台管理系统所需账号密码
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()
print(cmdc_access_token)
headers = commonFuc().get_business_data(module, "json_headers", cmdc_access_token)
print(headers)
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url100")
print(url)
request_body = commonFuc().get_business_data(module, "payload100")
print(request_body)
# 发送请求
result = requests.post(url, json=request_body, headers=headers)
result = json.loads(result.content)
print(result)
product_id = result["data"]["list"][0]["productId"]
print(product_id)
price = result["data"]["list"][0]["referencePrice"]
print(price)
# 第二步登录多彩商城添加商品至购物车列表
# 获取登录多彩商城所需账号密码
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()
print(cmdc_access_token)
headers = commonFuc().get_business_data(module, "json_headers10", cmdc_access_token)
print(headers)
url1 = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url2")
print(url1)
request_body = commonFuc().get_business_data(module, "payload10", product_id, price)
print(request_body)
"""
场景:添加JDE已停用的商品至购物车列表
用例名称:添加JDE已停用的商品至购物车列表
输出:{"success":false,"code":"addBuyerCartFail","message":"商品为失效状态,不可加入购物车","data":null,"freshToken":null}
"""
# 发送请求
result = requests.post(url1, json=request_body, headers=headers)
result = json.loads(result.content)
print(result)
# 获取预期结果
check_dict = commonFuc().get_business_data(module, "checkDict10")
print(check_dict)
# 断言实际结果中是否包含预期结果的内容
commonFuc().check_result(check_dict, result)
\ No newline at end of file
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
__author__ = "liguangyu" __author__ = "liguangyu"
""" """
case_tag:api,cmdc获取购物车列表,2252,2252-2,sit,bs case_tag:api,cmdc获取购物车列表,2252,2252-4,sit,bs
主数据平台:多彩商城购物车列表接口 主数据平台:多彩商城购物车列表接口
""" """
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
__author__ = "liguangyu" __author__ = "liguangyu"
""" """
case_tag:api,cmdc用户购物车新增商品,2252,2252-3,sit, case_tag:api,cmdc用户购物车新增商品,2252,2252-4,sit,bs
主数据平台:多彩商城购物车列表新增商品接口 主数据平台:多彩商城购物车列表新增商品接口
""" """
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
__author__ = "liguangyu" __author__ = "liguangyu"
""" """
case_tag:api,cmdc需求单审核通过1,2250,2250-9,sit,bs case_tag:api,cmdc需求单审核通过1,2250,2250-7,sit,bs
主数据平台:运营后台管理系统需求单审核接口 主数据平台:运营后台管理系统需求单审核接口
""" """
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
__author__ = "liguangyu" __author__ = "liguangyu"
""" """
case_tag:api,cmdc需求单审核通过,2252,2252-8,sit,bs case_tag:api,cmdc需求单审核通过,2252,2252-7,sit,bs
主数据平台:多彩商城获取需求单审核接口 主数据平台:多彩商城获取需求单审核接口
""" """
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
__author__ = "liguangyu" __author__ = "liguangyu"
""" """
case_tag:api,cmdc需求单创建(快速下单),2252,2252-8,sit,bs case_tag:api,cmdc需求单创建(快速下单),2252,2252-3,sit,bs
主数据平台:多彩商城获取需求单创建接口 主数据平台:多彩商城获取需求单创建接口
""" """
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
__author__ = "liguangyu" __author__ = "liguangyu"
""" """
case_tag:api,cmdc需求单创建(代客下单),2250,2250-9,sit,bs case_tag:api,cmdc需求单创建(代客下单),2250,2250-6,sit,bs
主数据平台:运营后台管理系统需求单删除接口 主数据平台:运营后台管理系统需求单删除接口
""" """
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
__author__ = "liguangyu" __author__ = "liguangyu"
""" """
case_tag:api,cmdc需求草稿订单创建,2250,2250-8,sit,bs case_tag:api,cmdc需求草稿订单创建,2250,2250-6,sit,bs
主数据平台:运营后台管理系统需求单删除接口 主数据平台:运营后台管理系统需求单删除接口
""" """
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
__author__ = "liguangyu" __author__ = "liguangyu"
""" """
case_tag:api,cmdc删除不存在的需求单,2250,2250-7,sit,bs case_tag:api,cmdc删除不存在的需求单,2250,2250-5,sit,bs
主数据平台:运营后台管理系统需求单删除接口 主数据平台:运营后台管理系统需求单删除接口
""" """
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
__author__ = "liguangyu" __author__ = "liguangyu"
""" """
case_tag:api,cmdc重复删除需求单,2250,2250-7,sit,bs case_tag:api,cmdc重复删除需求单,2250,2250-5,sit,bs
主数据平台:运营后台管理系统需求单删除接口 主数据平台:运营后台管理系统需求单删除接口
""" """
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
__author__ = "liguangyu" __author__ = "liguangyu"
""" """
case_tag:api,cmdc需求单删除,2250,2250-7,sit,bs case_tag:api,cmdc需求单删除,2250,2250-5,sit,bs
主数据平台:运营后台管理系统需求单删除接口 主数据平台:运营后台管理系统需求单删除接口
""" """
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
__author__ = "liguangyu" __author__ = "liguangyu"
""" """
case_tag:api,cmdc审核不存在的需求单,2250,2250-6,sit,bs case_tag:api,cmdc审核不存在的需求单,2250,2250-4,sit,bs
主数据平台:运营后台管理系统需求单审核拒绝接口 主数据平台:运营后台管理系统需求单审核拒绝接口
""" """
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
__author__ = "liguangyu" __author__ = "liguangyu"
""" """
case_tag:api,cmdc审核其他状态的需求单,2250,2250-6,sit,bs case_tag:api,cmdc审核其他状态的需求单,2250,2250-4,sit,bs
主数据平台:运营后台管理系统需求单审核拒绝接口 主数据平台:运营后台管理系统需求单审核拒绝接口
""" """
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
__author__ = "liguangyu" __author__ = "liguangyu"
""" """
case_tag:api,cmdc重复审核,2250,2250-6,sit,bs case_tag:api,cmdc重复审核,2250,2250-4,sit,bs
主数据平台:运营后台管理系统需求单审核拒绝接口 主数据平台:运营后台管理系统需求单审核拒绝接口
""" """
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
__author__ = "liguangyu" __author__ = "liguangyu"
""" """
case_tag:api,cmdc需求单审核不通过,2250,2250-6,sit,bs case_tag:api,cmdc需求单审核不通过,2250,2250-4,sit,bs
主数据平台:运营后台管理系统需求单审核拒绝接口 主数据平台:运营后台管理系统需求单审核拒绝接口
""" """
......
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