Arthur-Wu committed this file on 2024-11-21
This commit is contained in:
parent
2bed9e9a69
commit
0469beb719
32
MAIN_YM.py
32
MAIN_YM.py
@ -1,9 +1,39 @@
|
|||||||
# !/usr/bin/python
|
# !/usr/bin/python
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
# This is a sample Python script.
|
# This is a sample Python script.
|
||||||
|
|
||||||
# Press Shift+F10 to execute it or replace it with your code.
|
# Press Shift+F10 to execute it or replace it with your code.
|
||||||
# Press Double Shift to search everywhere for classes, files, tool windows, actions, and settings.
|
# Press Double Shift to search everywhere for classes, files, tool windows, actions, and settings.
|
||||||
|
import threading
|
||||||
|
import time
|
||||||
|
|
||||||
|
|
||||||
|
# # 要并发执行的任务函数
|
||||||
|
# def task(thread_name, delay):
|
||||||
|
# print(f"Thread {thread_name} starting")
|
||||||
|
# time.sleep(delay)
|
||||||
|
# print(f"Thread {thread_name} finished")
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# # 主程序
|
||||||
|
# def main():
|
||||||
|
# # 创建线程列表
|
||||||
|
# threads = []
|
||||||
|
# # 创建线程并启动
|
||||||
|
# for i in range(3):
|
||||||
|
# t = threading.Thread(target=task, args=("Thread-{}".format(i), i))
|
||||||
|
# threads.append(t)
|
||||||
|
# t.start()
|
||||||
|
#
|
||||||
|
# # 等待所有线程完成
|
||||||
|
# for t in threads:
|
||||||
|
# t.join()
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# if __name__ == "__main__":
|
||||||
|
# main()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def print_hi(name):
|
def print_hi(name):
|
||||||
from commons.EngineX import Engine, NotificationModule
|
from commons.EngineX import Engine, NotificationModule
|
||||||
|
@ -1,5 +0,0 @@
|
|||||||
# !/usr/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
# @Author:: Arthur Wu
|
|
||||||
# @Description:: 游客转会员登录,加购打折商品,并结算
|
|
||||||
# @Date:: 2021-05-10 16:30:23
|
|
@ -1,5 +0,0 @@
|
|||||||
# !/usr/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
# @Author:: Arthur Wu
|
|
||||||
# @Description:: 游客转会员登录,加购促销白名单商品,并结算
|
|
||||||
# @Date:: 2021-05-10 16:30:22
|
|
@ -1,4 +0,0 @@
|
|||||||
# !/usr/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
# @Author:: Arthur Wu
|
|
||||||
# @Description:: 游客转会员登录,加购重量放通商品,并结算
|
|
@ -1,5 +0,0 @@
|
|||||||
# !/usr/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
# @Author:: Arthur Wu
|
|
||||||
# @Description:: 游客转会员登录,加购2个购物袋,退购一个购物袋,并结算
|
|
||||||
# @Date:: 2021-05-10 15:30:27
|
|
@ -1,5 +0,0 @@
|
|||||||
# !/usr/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
# @Author:: Arthur Wu
|
|
||||||
# @Description:: 游客转会员登录,加购2个普通商品,退购一个,并结算
|
|
||||||
# @Date:: 2021-05-10 15:30:27
|
|
@ -1,5 +0,0 @@
|
|||||||
# !/usr/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
# @Author:: Arthur Wu
|
|
||||||
# @Description:: 游客转会员登录,加购2个会员商品,退购一个,并结算
|
|
||||||
# @Date:: 2021-05-10 15:30:27
|
|
@ -1,4 +0,0 @@
|
|||||||
# !/usr/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
# @Author:: Arthur Wu
|
|
||||||
# @Description:: 游客转会员登录,加购多件商品,退购一个商品,并结算
|
|
@ -1,5 +0,0 @@
|
|||||||
# !/usr/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
# @Author:: Arthur Wu
|
|
||||||
# @Description:: 游客转会员登录,加购2个打折商品,退购一个,并结算
|
|
||||||
# @Date:: 2021-05-10 15:30:22
|
|
@ -1,5 +0,0 @@
|
|||||||
# !/usr/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
# @Author:: Arthur Wu
|
|
||||||
# @Description:: 游客转会员登录,加购2个促销白名单商品,退购一个,并结算
|
|
||||||
# @Date:: 2021-05-10 16:30:22
|
|
@ -1,5 +0,0 @@
|
|||||||
# !/usr/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
# @Author:: Arthur Wu
|
|
||||||
# @Description:: 游客转会员登录,加购2个重量放通商品,退购一个,并结算
|
|
||||||
# @Date:: 2021-05-10 15:30:23
|
|
@ -2,3 +2,4 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
# @Author:: Arthur Wu
|
# @Author:: Arthur Wu
|
||||||
# @Description:: 会员登录,领取优惠券
|
# @Description:: 会员登录,领取优惠券
|
||||||
|
# @Date:: 2024/11/21
|
||||||
|
@ -8,9 +8,9 @@ from commons.SignatureYM import SignatureYM2
|
|||||||
|
|
||||||
|
|
||||||
class YMClientApi(object):
|
class YMClientApi(object):
|
||||||
def __init__(self):
|
def __init__(self, ShoppingCartMac):
|
||||||
self.Domain = "https://api.test.yimaogo.com/cart"
|
self.Domain = "https://api.test.yimaogo.com/cart"
|
||||||
self.headerss = SignatureYM2(Mac="b8:2d:28:04:c7:5c")._headers()
|
self.headerss = SignatureYM2(ShoppingCartMac)._headers()
|
||||||
|
|
||||||
''' 1- without sessionid '''
|
''' 1- without sessionid '''
|
||||||
def get_ads_list(self):
|
def get_ads_list(self):
|
||||||
@ -99,8 +99,9 @@ class YMClientApi(object):
|
|||||||
"deleteGoods": [],
|
"deleteGoods": [],
|
||||||
"existGoods": [],
|
"existGoods": [],
|
||||||
"orderNo": LoginData["data"][0]["orderNo"]
|
"orderNo": LoginData["data"][0]["orderNo"]
|
||||||
})
|
}, indent=4, ensure_ascii=False)
|
||||||
url = self.Domain+"/v2/shopping/add/retire/purchase"
|
url = self.Domain+"/v2/shopping/add/retire/purchase"
|
||||||
|
logging.info(f"---加购商品请求体payload: {payload}---")
|
||||||
response = requests.request("POST", url, headers=self.headerss, data=payload)
|
response = requests.request("POST", url, headers=self.headerss, data=payload)
|
||||||
logging.info(f"-----------接口返回状态码:{response.status_code}")
|
logging.info(f"-----------接口返回状态码:{response.status_code}")
|
||||||
logging.info(f"-----------接口返回数据:{response.json()}\n\n")
|
logging.info(f"-----------接口返回数据:{response.json()}\n\n")
|
||||||
|
@ -12,8 +12,10 @@ adsAreaId-5: 扫码广告
|
|||||||
adsAreaId-6: 支付后广告
|
adsAreaId-6: 支付后广告
|
||||||
adsAreaId-7: 小票广告
|
adsAreaId-7: 小票广告
|
||||||
'''
|
'''
|
||||||
|
''' 1-购物车Mac地址 '''
|
||||||
|
ShoppingCartMac = "b8:2d:28:04:c7:5c"
|
||||||
|
|
||||||
'''1-武商会员账号'''
|
''' -武商会员账号 '''
|
||||||
VIPPhoneNumber = "17786408673"
|
VIPPhoneNumber = "17786408673"
|
||||||
|
|
||||||
''' -商超、门店信息
|
''' -商超、门店信息
|
||||||
@ -25,18 +27,25 @@ MarketAndStoreDetails = {"putMarketId": 50, "putStoreId": ["69"]}
|
|||||||
GoodsBagInputcode_mid = '6971648922990'
|
GoodsBagInputcode_mid = '6971648922990'
|
||||||
GoodsBagInputcode_max = '6971648922983'
|
GoodsBagInputcode_max = '6971648922983'
|
||||||
''' -普通商品-2件 '''
|
''' -普通商品-2件 '''
|
||||||
NormalGoodsInputcode01 = "6924743915848" # 乐事薯片
|
NormalGoodsInputcode01 = "6925791908202" # 荆味酥糖
|
||||||
NormalGoodsInputcode02 = "6925303796426" # 统一番茄牛肉面
|
NormalGoodsInputcode02 = "6925303796426" # 统一番茄牛肉面
|
||||||
''' -会员商品 '''
|
NormalGoodsInputcode03 = "6924743915848" # 乐事薯片
|
||||||
VipGoodsInputcode = "6925303796426" # 统一番茄牛肉面
|
|
||||||
VipGoodsInputcode02 = "6924743915848" # 乐事薯片
|
|
||||||
''' -折扣商品 '''
|
|
||||||
SaleGoodsInputCode = "6924743915848" # 乐事薯片
|
|
||||||
''' -促销商品白名单 '''
|
|
||||||
PromotionalWhitelistGoods = {"GoodsInputcode": "6925303796426", "GoodsName": "统一茄皇蕃茄牛肉面"}
|
|
||||||
''' -重量放通白名单 '''
|
|
||||||
WeightToWhitelistGoods = {"GoodsInputcode": "6924743915848", "GoodsName": "乐事无限翡翠黄瓜味薯片"}
|
|
||||||
|
|
||||||
|
''' -优惠商品 '''
|
||||||
|
VipGoodsInputcode = "6922024730036" # 大白兔奶糖
|
||||||
|
VipGoodsInputcode02 = "4897114790479" # 维极熊白啤酒1L
|
||||||
|
VipGoodsInputcode03 = "4820193033335" # 巴瓦克纯麦啤酒
|
||||||
|
|
||||||
|
''' -折扣商品 '''
|
||||||
|
SaleGoodsInputCode = "9588856298051" # 濠品轩燕麦酥
|
||||||
|
''' -促销商品白名单 '''
|
||||||
|
PromotionalWhitelistGoods = {"GoodsInputcode": "9588856298051", "GoodsName": "濠品轩燕麦酥"}
|
||||||
|
''' -重量放通白名单 '''
|
||||||
|
WeightToWhitelistGoods = {"GoodsInputcode": "6922024730036", "GoodsName": "大白兔奶糖"}
|
||||||
|
''' -散称商品 '''
|
||||||
|
BulkGoods = {"GoodsInputcode": "2934431009517", "GoodsName": "阿克苏苹果"}
|
||||||
|
''' -计件商品 '''
|
||||||
|
PieceRateGoods = {"GoodsInputcode": "2910551005806", "GoodsName": "优选大白菜秧"}
|
||||||
|
|
||||||
|
|
||||||
''' 0-广告数据 '''
|
''' 0-广告数据 '''
|
||||||
|
Binary file not shown.
@ -9,9 +9,9 @@ from YiMao.businessFunc.ClientApiLib import YMClientApi
|
|||||||
from YiMao.data.WuShangSceneTestData import *
|
from YiMao.data.WuShangSceneTestData import *
|
||||||
|
|
||||||
|
|
||||||
DescName = "002-非会员加购购物袋并试算"
|
DescName = "Anon001-非会员加购购物袋并试算"
|
||||||
@allure.story(f'[场景测试] {DescName}验证')
|
@allure.story(f'[场景测试] {DescName}验证')
|
||||||
class Test_C002_NonVipAddShoppingBagAndSettlePayment(unittest.TestCase):
|
class Test_CAnon001_AddShoppingBagAndSettlePayment(unittest.TestCase):
|
||||||
f'''@Date:: 2024/11/15
|
f'''@Date:: 2024/11/15
|
||||||
@Author:: Arthur Wu
|
@Author:: Arthur Wu
|
||||||
@Desc::
|
@Desc::
|
||||||
@ -21,11 +21,11 @@ class Test_C002_NonVipAddShoppingBagAndSettlePayment(unittest.TestCase):
|
|||||||
'''
|
'''
|
||||||
def setUp(self) -> None:
|
def setUp(self) -> None:
|
||||||
self.timestamp = int(time.time())
|
self.timestamp = int(time.time())
|
||||||
self.ymc = YMClientApi()
|
self.ymc = YMClientApi(ShoppingCartMac)
|
||||||
self.goodsbag_mid = GoodsBagInputcode_mid
|
self.goodsbag_mid = GoodsBagInputcode_mid
|
||||||
self.goodsbag_max = GoodsBagInputcode_max
|
self.goodsbag_max = GoodsBagInputcode_max
|
||||||
|
|
||||||
def test_C00201_AddMidShoppingbagsForPurchase(self):
|
def test_CAnon00101_AddMidShoppingbagsForPurchase(self):
|
||||||
allure.dynamic.description(f"描述:加购中号购物袋")
|
allure.dynamic.description(f"描述:加购中号购物袋")
|
||||||
allure.step("步骤1:session开始")
|
allure.step("步骤1:session开始")
|
||||||
self.ymc.session_start()
|
self.ymc.session_start()
|
||||||
@ -43,8 +43,9 @@ class Test_C002_NonVipAddShoppingBagAndSettlePayment(unittest.TestCase):
|
|||||||
self.ymc.request_order_settlement(LoginData)
|
self.ymc.request_order_settlement(LoginData)
|
||||||
else:
|
else:
|
||||||
LOGGER.info(f"---购物袋 {self.goodsbag_mid} 不存在")
|
LOGGER.info(f"---购物袋 {self.goodsbag_mid} 不存在")
|
||||||
|
raise AssertionError(f"购物袋 {self.goodsbag_mid} 不存在")
|
||||||
|
|
||||||
def test_C00202_AddMaxShoppingbagsForPurchase(self):
|
def test_CAnon00102_AddMaxShoppingbagsForPurchase(self):
|
||||||
allure.dynamic.description("描述:加购大号购物袋")
|
allure.dynamic.description("描述:加购大号购物袋")
|
||||||
allure.step("步骤1:session开始")
|
allure.step("步骤1:session开始")
|
||||||
self.ymc.session_start()
|
self.ymc.session_start()
|
||||||
@ -62,6 +63,7 @@ class Test_C002_NonVipAddShoppingBagAndSettlePayment(unittest.TestCase):
|
|||||||
self.ymc.request_order_settlement(LoginData)
|
self.ymc.request_order_settlement(LoginData)
|
||||||
else:
|
else:
|
||||||
LOGGER.info(f"---购物袋 {self.goodsbag_max} 不存在")
|
LOGGER.info(f"---购物袋 {self.goodsbag_max} 不存在")
|
||||||
|
raise AssertionError(f"购物袋 {self.goodsbag_mid} 不存在")
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
@ -9,9 +9,9 @@ from YiMao.businessFunc.ClientApiLib import YMClientApi
|
|||||||
from YiMao.data.WuShangSceneTestData import *
|
from YiMao.data.WuShangSceneTestData import *
|
||||||
|
|
||||||
|
|
||||||
DescName = "003-非会员加购无优惠商品并试算"
|
DescName = "Anon002-非会员加购无优惠商品并试算"
|
||||||
@allure.story(f'[场景测试] {DescName}验证')
|
@allure.story(f'[场景测试] {DescName}验证')
|
||||||
class Test_C003(unittest.TestCase):
|
class Test_CAnon002(unittest.TestCase):
|
||||||
f'''@Date:: 2024/11/15
|
f'''@Date:: 2024/11/15
|
||||||
@Author:: Arthur Wu
|
@Author:: Arthur Wu
|
||||||
@Desc:: test_C003_NonVipAddNonDiscountedProductsForPurchase
|
@Desc:: test_C003_NonVipAddNonDiscountedProductsForPurchase
|
||||||
@ -21,10 +21,10 @@ class Test_C003(unittest.TestCase):
|
|||||||
'''
|
'''
|
||||||
def setUp(self) -> None:
|
def setUp(self) -> None:
|
||||||
self.timestamp = int(time.time())
|
self.timestamp = int(time.time())
|
||||||
self.ymc = YMClientApi()
|
self.ymc = YMClientApi(ShoppingCartMac)
|
||||||
self.NormalGoodsInputcode01 = NormalGoodsInputcode01 # 乐事薯片
|
self.NormalGoodsInputcode01 = NormalGoodsInputcode01 # 乐事薯片
|
||||||
|
|
||||||
def test_C003_NonVipAddNonDiscountedProductsForPurchase(self):
|
def test_CAnon002_AddNonDiscountedProductsForPurchase(self):
|
||||||
allure.dynamic.description(f"描述:{DescName}")
|
allure.dynamic.description(f"描述:{DescName}")
|
||||||
allure.step("步骤1:session开始")
|
allure.step("步骤1:session开始")
|
||||||
self.ymc.session_start()
|
self.ymc.session_start()
|
||||||
@ -42,6 +42,7 @@ class Test_C003(unittest.TestCase):
|
|||||||
self.ymc.request_order_settlement(LoginData)
|
self.ymc.request_order_settlement(LoginData)
|
||||||
else:
|
else:
|
||||||
LOGGER.info(f"---商品 {self.NormalGoodsInputcode01} 不存在")
|
LOGGER.info(f"---商品 {self.NormalGoodsInputcode01} 不存在")
|
||||||
|
raise AssertionError(f"商品 {self.NormalGoodsInputcode01} 不存在")
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
@ -9,9 +9,9 @@ from YiMao.businessFunc.ClientApiLib import YMClientApi
|
|||||||
from YiMao.data.WuShangSceneTestData import *
|
from YiMao.data.WuShangSceneTestData import *
|
||||||
|
|
||||||
|
|
||||||
DescName = "004-非会员加购会员商品并结算"
|
DescName = "Anon003-非会员加购会员商品并结算"
|
||||||
@allure.story(f'[场景测试] {DescName}验证')
|
@allure.story(f'[场景测试] {DescName}验证')
|
||||||
class Test_C004(unittest.TestCase):
|
class Test_CAnon003(unittest.TestCase):
|
||||||
f'''@Date:: 2024/11/15
|
f'''@Date:: 2024/11/15
|
||||||
@Author:: Arthur Wu
|
@Author:: Arthur Wu
|
||||||
@Desc::
|
@Desc::
|
||||||
@ -21,11 +21,11 @@ class Test_C004(unittest.TestCase):
|
|||||||
'''
|
'''
|
||||||
def setUp(self) -> None:
|
def setUp(self) -> None:
|
||||||
self.timestamp = int(time.time())
|
self.timestamp = int(time.time())
|
||||||
self.ymc = YMClientApi()
|
self.ymc = YMClientApi(ShoppingCartMac)
|
||||||
# 会员有优惠商品暂未提供
|
# 会员有优惠商品暂未提供
|
||||||
self.vip_goods_inputcode = VipGoodsInputcode # 统一番茄牛肉面
|
self.vip_goods_inputcode = VipGoodsInputcode # 统一番茄牛肉面
|
||||||
|
|
||||||
def test_C004_NonVipAddMemberPproductsForPurchase(self):
|
def test_CAnon003_AddMemberProductsForPurchase(self):
|
||||||
allure.dynamic.description(f"描述:{DescName}")
|
allure.dynamic.description(f"描述:{DescName}")
|
||||||
allure.step("步骤1:session开始")
|
allure.step("步骤1:session开始")
|
||||||
self.ymc.session_start()
|
self.ymc.session_start()
|
||||||
@ -43,6 +43,7 @@ class Test_C004(unittest.TestCase):
|
|||||||
self.ymc.request_order_settlement(LoginData)
|
self.ymc.request_order_settlement(LoginData)
|
||||||
else:
|
else:
|
||||||
LOGGER.info(f"---商品 {self.vip_goods_inputcode} 不存在")
|
LOGGER.info(f"---商品 {self.vip_goods_inputcode} 不存在")
|
||||||
|
raise AssertionError(f"商品 {self.vip_goods_inputcode} 不存在")
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
@ -9,9 +9,9 @@ from YiMao.businessFunc.ClientApiLib import YMClientApi
|
|||||||
from YiMao.data.WuShangSceneTestData import *
|
from YiMao.data.WuShangSceneTestData import *
|
||||||
|
|
||||||
|
|
||||||
DescName = "005-非会员加购多件商品并结算"
|
DescName = "Anon004-非会员加购多件商品并结算"
|
||||||
@allure.story(f'[场景测试] {DescName}验证')
|
@allure.story(f'[场景测试] {DescName}验证')
|
||||||
class Test_C005(unittest.TestCase):
|
class Test_CAnon004(unittest.TestCase):
|
||||||
f'''@Date:: 2024/11/15
|
f'''@Date:: 2024/11/15
|
||||||
@Author:: Arthur Wu
|
@Author:: Arthur Wu
|
||||||
@Desc::
|
@Desc::
|
||||||
@ -20,11 +20,11 @@ class Test_C005(unittest.TestCase):
|
|||||||
'''
|
'''
|
||||||
def setUp(self) -> None:
|
def setUp(self) -> None:
|
||||||
self.timestamp = int(time.time())
|
self.timestamp = int(time.time())
|
||||||
self.ymc = YMClientApi()
|
self.ymc = YMClientApi(ShoppingCartMac)
|
||||||
self.goods_inputcode1 = NormalGoodsInputcode01 # 乐事薯片
|
self.goods_inputcode1 = NormalGoodsInputcode01 # 乐事薯片
|
||||||
self.goods_inputcode2 = NormalGoodsInputcode02 # 统一番茄牛肉面
|
self.goods_inputcode2 = NormalGoodsInputcode02 # 统一番茄牛肉面
|
||||||
|
|
||||||
def test_C005_NonVipAddMultipleItemsForPurchase(self):
|
def test_CAnon004_AddMultipleItemsForPurchase(self):
|
||||||
allure.dynamic.description(f"描述:{DescName}")
|
allure.dynamic.description(f"描述:{DescName}")
|
||||||
allure.step("步骤1:session开始")
|
allure.step("步骤1:session开始")
|
||||||
self.ymc.session_start()
|
self.ymc.session_start()
|
||||||
@ -47,8 +47,10 @@ class Test_C005(unittest.TestCase):
|
|||||||
self.ymc.request_order_settlement(LoginData)
|
self.ymc.request_order_settlement(LoginData)
|
||||||
else:
|
else:
|
||||||
LOGGER.info(f"---商品 {self.goods_inputcode2} 不存在")
|
LOGGER.info(f"---商品 {self.goods_inputcode2} 不存在")
|
||||||
|
raise AssertionError(f"商品 {self.goods_inputcode2} 不存在")
|
||||||
else:
|
else:
|
||||||
LOGGER.info(f"---商品 {self.goods_inputcode1} 不存在")
|
LOGGER.info(f"---商品 {self.goods_inputcode1} 不存在")
|
||||||
|
raise AssertionError(f"商品 {self.goods_inputcode1} 不存在")
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
@ -9,9 +9,9 @@ from YiMao.businessFunc.ClientApiLib import YMClientApi
|
|||||||
from YiMao.data.WuShangSceneTestData import *
|
from YiMao.data.WuShangSceneTestData import *
|
||||||
|
|
||||||
|
|
||||||
DescName = "006-非会员加购打折商品并结算"
|
DescName = "Anon005-非会员加购打折商品并结算"
|
||||||
@allure.story(f'[场景测试] {DescName}验证')
|
@allure.story(f'[场景测试] {DescName}验证')
|
||||||
class Test_C006(unittest.TestCase):
|
class Test_CAnon005(unittest.TestCase):
|
||||||
f'''@Date:: 2024/11/15
|
f'''@Date:: 2024/11/15
|
||||||
@Author:: Arthur Wu
|
@Author:: Arthur Wu
|
||||||
@Desc::
|
@Desc::
|
||||||
@ -21,11 +21,11 @@ class Test_C006(unittest.TestCase):
|
|||||||
'''
|
'''
|
||||||
def setUp(self) -> None:
|
def setUp(self) -> None:
|
||||||
self.timestamp = int(time.time())
|
self.timestamp = int(time.time())
|
||||||
self.ymc = YMClientApi()
|
self.ymc = YMClientApi(ShoppingCartMac)
|
||||||
# 折扣商品暂未提供
|
# 折扣商品暂未提供
|
||||||
self.sale_goods_inputCode = SaleGoodsInputCode # 乐事薯片
|
self.sale_goods_inputCode = SaleGoodsInputCode # 乐事薯片
|
||||||
|
|
||||||
def test_C006_NonVipAddDiscountedProductsForPurchase(self):
|
def test_CAnon005_AddDiscountedProductsForPurchase(self):
|
||||||
allure.dynamic.description(f"描述:{DescName}")
|
allure.dynamic.description(f"描述:{DescName}")
|
||||||
allure.step("步骤1:session开始")
|
allure.step("步骤1:session开始")
|
||||||
self.ymc.session_start()
|
self.ymc.session_start()
|
||||||
@ -43,6 +43,7 @@ class Test_C006(unittest.TestCase):
|
|||||||
self.ymc.request_order_settlement(LoginData)
|
self.ymc.request_order_settlement(LoginData)
|
||||||
else:
|
else:
|
||||||
LOGGER.info(f"---商品 {self.sale_goods_inputCode} 不存在")
|
LOGGER.info(f"---商品 {self.sale_goods_inputCode} 不存在")
|
||||||
|
raise Exception(f"---商品 {self.sale_goods_inputCode} 不存在")
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
@ -10,9 +10,9 @@ from YiMao.businessFunc.ServiceApiLib import YMServiceApi
|
|||||||
from YiMao.data.WuShangSceneTestData import *
|
from YiMao.data.WuShangSceneTestData import *
|
||||||
|
|
||||||
|
|
||||||
DescName = "007-非会员加购促销白名单商品并结算"
|
DescName = "Anon006-非会员加购促销白名单商品并结算"
|
||||||
@allure.story(f'[场景测试] {DescName}验证')
|
@allure.story(f'[场景测试] {DescName}验证')
|
||||||
class Test_C007(unittest.TestCase):
|
class Test_CAnon006(unittest.TestCase):
|
||||||
f'''@Date:: 2024/11/15
|
f'''@Date:: 2024/11/15
|
||||||
@Author:: Arthur Wu
|
@Author:: Arthur Wu
|
||||||
@Desc::
|
@Desc::
|
||||||
@ -22,7 +22,7 @@ class Test_C007(unittest.TestCase):
|
|||||||
'''
|
'''
|
||||||
def setUp(self) -> None:
|
def setUp(self) -> None:
|
||||||
self.timestamp = int(time.time())
|
self.timestamp = int(time.time())
|
||||||
self.ymc = YMClientApi()
|
self.ymc = YMClientApi(ShoppingCartMac)
|
||||||
self.yms = YMServiceApi()
|
self.yms = YMServiceApi()
|
||||||
# 促销白名单商品暂未提供
|
# 促销白名单商品暂未提供
|
||||||
self.promotional_whitelist_goods = PromotionalWhitelistGoods
|
self.promotional_whitelist_goods = PromotionalWhitelistGoods
|
||||||
@ -31,7 +31,7 @@ class Test_C007(unittest.TestCase):
|
|||||||
"StoreId": MarketAndStoreDetails["putStoreId"][0]
|
"StoreId": MarketAndStoreDetails["putStoreId"][0]
|
||||||
}
|
}
|
||||||
|
|
||||||
def test_C007_NonVipAddPromotionalWhitelistProducts(self):
|
def test_CAnon006_AddPromotionalWhitelistProducts(self):
|
||||||
allure.dynamic.description(f"描述:{DescName}")
|
allure.dynamic.description(f"描述:{DescName}")
|
||||||
allure.step("[前置条件]:先调用管理平台接口,将指定商品添加到促销白名单中")
|
allure.step("[前置条件]:先调用管理平台接口,将指定商品添加到促销白名单中")
|
||||||
pre_respomse = self.yms.add_promotional_product_whitelist(
|
pre_respomse = self.yms.add_promotional_product_whitelist(
|
||||||
@ -57,12 +57,15 @@ class Test_C007(unittest.TestCase):
|
|||||||
self.ymc.request_order_settlement(LoginData)
|
self.ymc.request_order_settlement(LoginData)
|
||||||
else:
|
else:
|
||||||
LOGGER.info(f"---商品 {self.promotional_whitelist_goods["GoodsInputcode"]} 不存在")
|
LOGGER.info(f"---商品 {self.promotional_whitelist_goods["GoodsInputcode"]} 不存在")
|
||||||
|
raise Exception(f"商品 {self.promotional_whitelist_goods["GoodsInputcode"]}不存在")
|
||||||
|
|
||||||
allure.step("[后置处理]:删除添加的促销白名单商品")
|
allure.step("[后置处理]:删除添加的促销白名单商品")
|
||||||
self.yms.delete_whitelist_goods()
|
self.yms.delete_whitelist_goods()
|
||||||
else:
|
else:
|
||||||
LOGGER.info(f"---添加商品 {self.promotional_whitelist_goods['GoodsInputcode']} "
|
LOGGER.info(f"---添加商品 {self.promotional_whitelist_goods['GoodsInputcode']} "
|
||||||
f"到促销白名单失败")
|
f"到促销白名单失败")
|
||||||
|
raise Exception(f"---添加商品 {self.promotional_whitelist_goods['GoodsInputcode']} "
|
||||||
|
f"到促销白名单失败")
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
@ -10,9 +10,9 @@ from YiMao.businessFunc.ServiceApiLib import YMServiceApi
|
|||||||
from YiMao.data.WuShangSceneTestData import *
|
from YiMao.data.WuShangSceneTestData import *
|
||||||
|
|
||||||
|
|
||||||
DescName = "008-非会员加购重量放通商品并结算"
|
DescName = "Anon007-非会员加购重量放通商品并结算"
|
||||||
@allure.story(f'[场景测试] {DescName}验证')
|
@allure.story(f'[场景测试] {DescName}验证')
|
||||||
class Test_C008(unittest.TestCase):
|
class Test_CAnon007(unittest.TestCase):
|
||||||
f'''@Date:: 2024/11/15
|
f'''@Date:: 2024/11/15
|
||||||
@Author:: Arthur Wu
|
@Author:: Arthur Wu
|
||||||
@Desc::
|
@Desc::
|
||||||
@ -22,7 +22,7 @@ class Test_C008(unittest.TestCase):
|
|||||||
'''
|
'''
|
||||||
def setUp(self) -> None:
|
def setUp(self) -> None:
|
||||||
self.timestamp = int(time.time())
|
self.timestamp = int(time.time())
|
||||||
self.ymc = YMClientApi()
|
self.ymc = YMClientApi(ShoppingCartMac)
|
||||||
self.yms = YMServiceApi()
|
self.yms = YMServiceApi()
|
||||||
# 重量放通白名单商品暂未提供
|
# 重量放通白名单商品暂未提供
|
||||||
self.weight_to_whitelist_goods = WeightToWhitelistGoods
|
self.weight_to_whitelist_goods = WeightToWhitelistGoods
|
||||||
@ -31,7 +31,7 @@ class Test_C008(unittest.TestCase):
|
|||||||
"StoreId": MarketAndStoreDetails["putStoreId"][0]
|
"StoreId": MarketAndStoreDetails["putStoreId"][0]
|
||||||
}
|
}
|
||||||
|
|
||||||
def test_C008_NonVipAddWeightToTheProduct(self):
|
def test_CAnon007_AddWeightToTheProduct(self):
|
||||||
allure.dynamic.description(f"描述:{DescName}")
|
allure.dynamic.description(f"描述:{DescName}")
|
||||||
allure.step("[前置条件]:先调用管理平台接口,将指定商品添加到重量放通白名单中")
|
allure.step("[前置条件]:先调用管理平台接口,将指定商品添加到重量放通白名单中")
|
||||||
pre_respomse = self.yms.add_weight_to_whitelist(
|
pre_respomse = self.yms.add_weight_to_whitelist(
|
||||||
@ -58,12 +58,15 @@ class Test_C008(unittest.TestCase):
|
|||||||
self.ymc.request_order_settlement(LoginData)
|
self.ymc.request_order_settlement(LoginData)
|
||||||
else:
|
else:
|
||||||
LOGGER.info(f"---商品 {self.weight_to_whitelist_goods["GoodsInputcode"]} 不存在")
|
LOGGER.info(f"---商品 {self.weight_to_whitelist_goods["GoodsInputcode"]} 不存在")
|
||||||
|
raise Exception(f"---商品 {self.weight_to_whitelist_goods["GoodsInputcode"]} 不存在")
|
||||||
|
|
||||||
allure.step("[后置处理]:删除添加的重量放通白名单商品")
|
allure.step("[后置处理]:删除添加的重量放通白名单商品")
|
||||||
self.yms.delete_weight_whitelist_goods()
|
self.yms.delete_weight_whitelist_goods()
|
||||||
else:
|
else:
|
||||||
LOGGER.info(f"---添加商品 {self.weight_to_whitelist_goods['GoodsInputcode']} "
|
LOGGER.info(f"---添加商品 {self.weight_to_whitelist_goods['GoodsInputcode']} "
|
||||||
f"到重量放通白名单失败")
|
f"到重量放通白名单失败")
|
||||||
|
raise Exception(f"---添加商品 {self.weight_to_whitelist_goods['GoodsInputcode']} "
|
||||||
|
f"到重量放通白名单失败")
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
@ -8,9 +8,10 @@ from configs.globalObj import LOGGER
|
|||||||
from YiMao.businessFunc.ClientApiLib import YMClientApi
|
from YiMao.businessFunc.ClientApiLib import YMClientApi
|
||||||
from YiMao.data.WuShangSceneTestData import *
|
from YiMao.data.WuShangSceneTestData import *
|
||||||
|
|
||||||
DescName = "009-非会员,加购2个购物袋,退购一个购物袋,并结算"
|
|
||||||
|
DescName = "Anon008-非会员,加购2个购物袋,退购一个购物袋,并结算"
|
||||||
@allure.story(f'[场景测试] {DescName}验证')
|
@allure.story(f'[场景测试] {DescName}验证')
|
||||||
class Test_C009(unittest.TestCase):
|
class Test_CAnon008(unittest.TestCase):
|
||||||
f'''@Date:: 2024/11/20
|
f'''@Date:: 2024/11/20
|
||||||
@Author:: Arthur Wu
|
@Author:: Arthur Wu
|
||||||
@Desc::
|
@Desc::
|
||||||
@ -19,11 +20,11 @@ class Test_C009(unittest.TestCase):
|
|||||||
'''
|
'''
|
||||||
def setUp(self) -> None:
|
def setUp(self) -> None:
|
||||||
self.timestamp = int(time.time())
|
self.timestamp = int(time.time())
|
||||||
self.ymc = YMClientApi()
|
self.ymc = YMClientApi(ShoppingCartMac)
|
||||||
self.shoppingbag_mid = GoodsBagInputcode_mid # 乐事薯片
|
self.shoppingbag_mid = GoodsBagInputcode_mid # 乐事薯片
|
||||||
self.shoppingbag_max = GoodsBagInputcode_max # 统一番茄牛肉面
|
self.shoppingbag_max = GoodsBagInputcode_max # 统一番茄牛肉面
|
||||||
|
|
||||||
def test_C009_NonVipReturnShoppingBag(self):
|
def test_CAnon008_ReturnShoppingBag(self):
|
||||||
allure.dynamic.description(f"描述:{DescName}")
|
allure.dynamic.description(f"描述:{DescName}")
|
||||||
allure.step("步骤1:session开始")
|
allure.step("步骤1:session开始")
|
||||||
self.ymc.session_start()
|
self.ymc.session_start()
|
||||||
@ -53,8 +54,10 @@ class Test_C009(unittest.TestCase):
|
|||||||
self.ymc.request_order_settlement(LoginData)
|
self.ymc.request_order_settlement(LoginData)
|
||||||
else:
|
else:
|
||||||
LOGGER.info(f"---商品 {self.shoppingbag_max} 不存在")
|
LOGGER.info(f"---商品 {self.shoppingbag_max} 不存在")
|
||||||
|
raise AssertionError(f"---商品 {self.shoppingbag_max} 不存在")
|
||||||
else:
|
else:
|
||||||
LOGGER.info(f"---商品 {self.shoppingbag_mid} 不存在")
|
LOGGER.info(f"---商品 {self.shoppingbag_mid} 不存在")
|
||||||
|
raise AssertionError(f"---商品 {self.shoppingbag_mid} 不存在")
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
@ -8,9 +8,10 @@ from configs.globalObj import LOGGER
|
|||||||
from YiMao.businessFunc.ClientApiLib import YMClientApi
|
from YiMao.businessFunc.ClientApiLib import YMClientApi
|
||||||
from YiMao.data.WuShangSceneTestData import *
|
from YiMao.data.WuShangSceneTestData import *
|
||||||
|
|
||||||
DescName = "010-非会员,加购2个普通商品,退购一个,并结算"
|
|
||||||
|
DescName = "Anon009-非会员,加购2个普通商品,退购一个,并结算"
|
||||||
@allure.story(f'[场景测试] {DescName}验证')
|
@allure.story(f'[场景测试] {DescName}验证')
|
||||||
class Test_C010(unittest.TestCase):
|
class Test_CAnon009(unittest.TestCase):
|
||||||
f'''@Date:: 2024/11/20
|
f'''@Date:: 2024/11/20
|
||||||
@Author:: Arthur Wu
|
@Author:: Arthur Wu
|
||||||
@Desc::
|
@Desc::
|
||||||
@ -19,11 +20,11 @@ class Test_C010(unittest.TestCase):
|
|||||||
'''
|
'''
|
||||||
def setUp(self) -> None:
|
def setUp(self) -> None:
|
||||||
self.timestamp = int(time.time())
|
self.timestamp = int(time.time())
|
||||||
self.ymc = YMClientApi()
|
self.ymc = YMClientApi(ShoppingCartMac)
|
||||||
self.goods_01 = NormalGoodsInputcode01 # 乐事薯片
|
self.goods_01 = NormalGoodsInputcode01 # 乐事薯片
|
||||||
self.goods_02 = NormalGoodsInputcode02 # 统一番茄牛肉面
|
self.goods_02 = NormalGoodsInputcode02 # 统一番茄牛肉面
|
||||||
|
|
||||||
def test_C010_NonVipReturnPurchaseOfOrdinaryGoods(self):
|
def test_CAnon009_ReturnPurchaseOfOrdinaryGoods(self):
|
||||||
allure.dynamic.description(f"描述:{DescName}")
|
allure.dynamic.description(f"描述:{DescName}")
|
||||||
allure.step("步骤1:session开始")
|
allure.step("步骤1:session开始")
|
||||||
self.ymc.session_start()
|
self.ymc.session_start()
|
||||||
@ -53,8 +54,10 @@ class Test_C010(unittest.TestCase):
|
|||||||
self.ymc.request_order_settlement(LoginData)
|
self.ymc.request_order_settlement(LoginData)
|
||||||
else:
|
else:
|
||||||
LOGGER.info(f"---商品 {self.goods_02} 不存在")
|
LOGGER.info(f"---商品 {self.goods_02} 不存在")
|
||||||
|
raise AssertionError(f"---商品 {self.goods_02} 不存在")
|
||||||
else:
|
else:
|
||||||
LOGGER.info(f"---商品 {self.goods_01} 不存在")
|
LOGGER.info(f"---商品 {self.goods_01} 不存在")
|
||||||
|
raise AssertionError(f"---商品 {self.goods_01} 不存在")
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
@ -8,9 +8,10 @@ from configs.globalObj import LOGGER
|
|||||||
from YiMao.businessFunc.ClientApiLib import YMClientApi
|
from YiMao.businessFunc.ClientApiLib import YMClientApi
|
||||||
from YiMao.data.WuShangSceneTestData import *
|
from YiMao.data.WuShangSceneTestData import *
|
||||||
|
|
||||||
DescName = "011-非会员,加购2个会员商品,退购一个,并结算"
|
|
||||||
|
DescName = "Anon010-非会员,加购2个会员商品,退购一个,并结算"
|
||||||
@allure.story(f'[场景测试] {DescName}验证')
|
@allure.story(f'[场景测试] {DescName}验证')
|
||||||
class Test_C011(unittest.TestCase):
|
class Test_CAnon010(unittest.TestCase):
|
||||||
f'''@Date:: 2024/11/20
|
f'''@Date:: 2024/11/20
|
||||||
@Author:: Arthur Wu
|
@Author:: Arthur Wu
|
||||||
@Desc::
|
@Desc::
|
||||||
@ -19,11 +20,11 @@ class Test_C011(unittest.TestCase):
|
|||||||
'''
|
'''
|
||||||
def setUp(self) -> None:
|
def setUp(self) -> None:
|
||||||
self.timestamp = int(time.time())
|
self.timestamp = int(time.time())
|
||||||
self.ymc = YMClientApi()
|
self.ymc = YMClientApi(ShoppingCartMac)
|
||||||
self.vip_goods_01 = VipGoodsInputcode # 乐事薯片
|
self.vip_goods_01 = VipGoodsInputcode # 乐事薯片
|
||||||
self.vip_goods_02 = VipGoodsInputcode02 # 统一番茄牛肉面
|
self.vip_goods_02 = VipGoodsInputcode02 # 统一番茄牛肉面
|
||||||
|
|
||||||
def test_C011_NonVipReturnOfMemberProducts(self):
|
def test_CAnon010_ReturnOfMemberProducts(self):
|
||||||
allure.dynamic.description(f"描述:{DescName}")
|
allure.dynamic.description(f"描述:{DescName}")
|
||||||
allure.step("步骤1:session开始")
|
allure.step("步骤1:session开始")
|
||||||
self.ymc.session_start()
|
self.ymc.session_start()
|
||||||
@ -53,8 +54,10 @@ class Test_C011(unittest.TestCase):
|
|||||||
self.ymc.request_order_settlement(LoginData)
|
self.ymc.request_order_settlement(LoginData)
|
||||||
else:
|
else:
|
||||||
LOGGER.info(f"---商品 {self.vip_goods_02} 不存在")
|
LOGGER.info(f"---商品 {self.vip_goods_02} 不存在")
|
||||||
|
raise AssertionError(f"---商品 {self.vip_goods_02} 不存在")
|
||||||
else:
|
else:
|
||||||
LOGGER.info(f"---商品 {self.vip_goods_01} 不存在")
|
LOGGER.info(f"---商品 {self.vip_goods_01} 不存在")
|
||||||
|
raise AssertionError(f"---商品 {self.vip_goods_01} 不存在")
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
@ -8,9 +8,10 @@ from configs.globalObj import LOGGER
|
|||||||
from YiMao.businessFunc.ClientApiLib import YMClientApi
|
from YiMao.businessFunc.ClientApiLib import YMClientApi
|
||||||
from YiMao.data.WuShangSceneTestData import *
|
from YiMao.data.WuShangSceneTestData import *
|
||||||
|
|
||||||
DescName = "012-非会员,加购多件商品,退购一个商品,并结算"
|
|
||||||
|
DescName = "Anon011-非会员,加购多件商品,退购一个商品,并结算"
|
||||||
@allure.story(f'[场景测试] {DescName}验证')
|
@allure.story(f'[场景测试] {DescName}验证')
|
||||||
class Test_C012(unittest.TestCase):
|
class Test_CAnon011(unittest.TestCase):
|
||||||
f'''@Date:: 2024/11/20
|
f'''@Date:: 2024/11/20
|
||||||
@Author:: Arthur Wu
|
@Author:: Arthur Wu
|
||||||
@Desc::
|
@Desc::
|
||||||
@ -19,11 +20,11 @@ class Test_C012(unittest.TestCase):
|
|||||||
'''
|
'''
|
||||||
def setUp(self) -> None:
|
def setUp(self) -> None:
|
||||||
self.timestamp = int(time.time())
|
self.timestamp = int(time.time())
|
||||||
self.ymc = YMClientApi()
|
self.ymc = YMClientApi(ShoppingCartMac)
|
||||||
self.goods_inputcode1 = NormalGoodsInputcode01 # 乐事薯片
|
self.goods_inputcode1 = NormalGoodsInputcode01 # 乐事薯片
|
||||||
self.goods_inputcode2 = NormalGoodsInputcode02 # 统一番茄牛肉面
|
self.goods_inputcode2 = NormalGoodsInputcode02 # 统一番茄牛肉面
|
||||||
|
|
||||||
def test_C012_NonVipReturnOneItemFromMultiplePurchases(self):
|
def test_CAnon011_ReturnOneItemFromMultiplePurchases(self):
|
||||||
allure.dynamic.description(f"描述:{DescName}")
|
allure.dynamic.description(f"描述:{DescName}")
|
||||||
allure.step("步骤1:session开始")
|
allure.step("步骤1:session开始")
|
||||||
self.ymc.session_start()
|
self.ymc.session_start()
|
||||||
@ -53,8 +54,10 @@ class Test_C012(unittest.TestCase):
|
|||||||
self.ymc.request_order_settlement(LoginData)
|
self.ymc.request_order_settlement(LoginData)
|
||||||
else:
|
else:
|
||||||
LOGGER.info(f"---商品 {self.goods_inputcode2} 不存在")
|
LOGGER.info(f"---商品 {self.goods_inputcode2} 不存在")
|
||||||
|
raise AssertionError(f"---商品 {self.goods_inputcode2} 不存在")
|
||||||
else:
|
else:
|
||||||
LOGGER.info(f"---商品 {self.goods_inputcode1} 不存在")
|
LOGGER.info(f"---商品 {self.goods_inputcode1} 不存在")
|
||||||
|
raise AssertionError(f"---商品 {self.goods_inputcode1} 不存在")
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
@ -8,9 +8,10 @@ from configs.globalObj import LOGGER
|
|||||||
from YiMao.businessFunc.ClientApiLib import YMClientApi
|
from YiMao.businessFunc.ClientApiLib import YMClientApi
|
||||||
from YiMao.data.WuShangSceneTestData import *
|
from YiMao.data.WuShangSceneTestData import *
|
||||||
|
|
||||||
DescName = "013-非会员,加购2个打折商品,退购一个,并结算"
|
|
||||||
|
DescName = "Anon012-非会员,加购2个打折商品,退购一个,并结算"
|
||||||
@allure.story(f'[场景测试] {DescName}验证')
|
@allure.story(f'[场景测试] {DescName}验证')
|
||||||
class Test_C013(unittest.TestCase):
|
class Test_CAnon012(unittest.TestCase):
|
||||||
f'''@Date:: 2024/11/20
|
f'''@Date:: 2024/11/20
|
||||||
@Author:: Arthur Wu
|
@Author:: Arthur Wu
|
||||||
@Desc::
|
@Desc::
|
||||||
@ -19,10 +20,10 @@ class Test_C013(unittest.TestCase):
|
|||||||
'''
|
'''
|
||||||
def setUp(self) -> None:
|
def setUp(self) -> None:
|
||||||
self.timestamp = int(time.time())
|
self.timestamp = int(time.time())
|
||||||
self.ymc = YMClientApi()
|
self.ymc = YMClientApi(ShoppingCartMac)
|
||||||
self.sale_goods_inputCode = SaleGoodsInputCode # 乐事薯片
|
self.sale_goods_inputCode = SaleGoodsInputCode # 乐事薯片
|
||||||
|
|
||||||
def test_C013_NonVipReturnOfDiscountedProducts(self):
|
def test_CAnon012_ReturnOfDiscountedProducts(self):
|
||||||
allure.dynamic.description(f"描述:{DescName}")
|
allure.dynamic.description(f"描述:{DescName}")
|
||||||
allure.step("步骤1:session开始")
|
allure.step("步骤1:session开始")
|
||||||
self.ymc.session_start()
|
self.ymc.session_start()
|
||||||
@ -47,6 +48,7 @@ class Test_C013(unittest.TestCase):
|
|||||||
self.ymc.request_order_settlement(LoginData)
|
self.ymc.request_order_settlement(LoginData)
|
||||||
else:
|
else:
|
||||||
LOGGER.info(f"---商品 {self.sale_goods_inputCode} 不存在")
|
LOGGER.info(f"---商品 {self.sale_goods_inputCode} 不存在")
|
||||||
|
raise AssertionError(f"---商品 {self.sale_goods_inputCode} 不存在")
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
@ -10,9 +10,9 @@ from YiMao.businessFunc.ServiceApiLib import YMServiceApi
|
|||||||
from YiMao.data.WuShangSceneTestData import *
|
from YiMao.data.WuShangSceneTestData import *
|
||||||
|
|
||||||
|
|
||||||
DescName = "014-非会员加购2个促销白名单商品,退购一个"
|
DescName = "Anon013-非会员加购2个促销白名单商品,退购一个"
|
||||||
@allure.story(f'[场景测试] {DescName}验证')
|
@allure.story(f'[场景测试] {DescName}验证')
|
||||||
class Test_C014(unittest.TestCase):
|
class Test_CAnon013(unittest.TestCase):
|
||||||
f'''@Date:: 2024/11/20
|
f'''@Date:: 2024/11/20
|
||||||
@Author:: Arthur Wu
|
@Author:: Arthur Wu
|
||||||
@Desc::
|
@Desc::
|
||||||
@ -21,7 +21,7 @@ class Test_C014(unittest.TestCase):
|
|||||||
'''
|
'''
|
||||||
def setUp(self) -> None:
|
def setUp(self) -> None:
|
||||||
self.timestamp = int(time.time())
|
self.timestamp = int(time.time())
|
||||||
self.ymc = YMClientApi()
|
self.ymc = YMClientApi(ShoppingCartMac)
|
||||||
self.yms = YMServiceApi()
|
self.yms = YMServiceApi()
|
||||||
# 促销白名单商品暂未提供
|
# 促销白名单商品暂未提供
|
||||||
self.promotional_whitelist_goods = PromotionalWhitelistGoods
|
self.promotional_whitelist_goods = PromotionalWhitelistGoods
|
||||||
@ -30,7 +30,7 @@ class Test_C014(unittest.TestCase):
|
|||||||
"StoreId": MarketAndStoreDetails["putStoreId"][0]
|
"StoreId": MarketAndStoreDetails["putStoreId"][0]
|
||||||
}
|
}
|
||||||
|
|
||||||
def test_C014_NonVipReturnPromotionWhitelistProducts(self):
|
def test_CAnon013_ReturnPromotionWhitelistProducts(self):
|
||||||
allure.dynamic.description(f"描述:{DescName}")
|
allure.dynamic.description(f"描述:{DescName}")
|
||||||
allure.step("[前置条件]:先调用管理平台接口,将指定商品添加到促销白名单中")
|
allure.step("[前置条件]:先调用管理平台接口,将指定商品添加到促销白名单中")
|
||||||
pre_respomse = self.yms.add_promotional_product_whitelist(
|
pre_respomse = self.yms.add_promotional_product_whitelist(
|
||||||
@ -49,9 +49,13 @@ class Test_C014(unittest.TestCase):
|
|||||||
'''step1:加购商品x,分别加购x件'''
|
'''step1:加购商品x,分别加购x件'''
|
||||||
allure.step("步骤3:获取促销白名单商品信息")
|
allure.step("步骤3:获取促销白名单商品信息")
|
||||||
GoodsInfoData1 = self.ymc.get_goods_info(self.promotional_whitelist_goods["GoodsInputcode"])
|
GoodsInfoData1 = self.ymc.get_goods_info(self.promotional_whitelist_goods["GoodsInputcode"])
|
||||||
|
LOGGER.info(f"---获取的商品信息为:{GoodsInfoData1}")
|
||||||
|
if GoodsInfoData1['data']['weight'] == 0:
|
||||||
|
GoodsInfoData1['data']['weight'] = 300
|
||||||
if GoodsInfoData1['msg'] != '加购商品不存在':
|
if GoodsInfoData1['msg'] != '加购商品不存在':
|
||||||
allure.step("步骤4:加购白名单商品")
|
allure.step("步骤4:加购白名单商品")
|
||||||
AddGoodsResp = self.ymc.add_cart_goods(GoodsInfoData1, 2, LoginData)
|
AddGoodsResp = self.ymc.add_cart_goods(GoodsInfoData1, 1, LoginData)
|
||||||
|
LOGGER.info(f"---加购商品返回结果:{AddGoodsResp}")
|
||||||
|
|
||||||
''' step2:随机退购一个商品,并结算 '''
|
''' step2:随机退购一个商品,并结算 '''
|
||||||
allure.step("\n步骤5:退购一件商品")
|
allure.step("\n步骤5:退购一件商品")
|
||||||
@ -64,12 +68,15 @@ class Test_C014(unittest.TestCase):
|
|||||||
self.ymc.request_order_settlement(LoginData)
|
self.ymc.request_order_settlement(LoginData)
|
||||||
else:
|
else:
|
||||||
LOGGER.info(f"---商品 {self.promotional_whitelist_goods["GoodsInputcode"]} 不存在")
|
LOGGER.info(f"---商品 {self.promotional_whitelist_goods["GoodsInputcode"]} 不存在")
|
||||||
|
raise Exception(f"---商品 {self.promotional_whitelist_goods["GoodsInputcode"]} 不存在")
|
||||||
|
|
||||||
allure.step("[后置处理]:删除添加的促销白名单商品")
|
allure.step("[后置处理]:删除添加的促销白名单商品")
|
||||||
self.yms.delete_whitelist_goods()
|
self.yms.delete_whitelist_goods()
|
||||||
else:
|
else:
|
||||||
LOGGER.info(f"---添加商品 {self.promotional_whitelist_goods['GoodsInputcode']} "
|
LOGGER.info(f"---添加商品 {self.promotional_whitelist_goods['GoodsInputcode']} "
|
||||||
f"到促销白名单失败")
|
f"到促销白名单失败")
|
||||||
|
raise Exception(f"---添加商品 {self.promotional_whitelist_goods['GoodsInputcode']} "
|
||||||
|
f"到促销白名单失败")
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
@ -10,9 +10,9 @@ from YiMao.businessFunc.ServiceApiLib import YMServiceApi
|
|||||||
from YiMao.data.WuShangSceneTestData import *
|
from YiMao.data.WuShangSceneTestData import *
|
||||||
|
|
||||||
|
|
||||||
DescName = "015-非会员加购2个重量放通商品,退购一个"
|
DescName = "Anon014-非会员加购2个重量放通商品,退购一个"
|
||||||
@allure.story(f'[场景测试] {DescName}验证')
|
@allure.story(f'[场景测试] {DescName}验证')
|
||||||
class Test_C015(unittest.TestCase):
|
class Test_CAnon014(unittest.TestCase):
|
||||||
f'''@Date:: 2024/11/20
|
f'''@Date:: 2024/11/20
|
||||||
@Author:: Arthur Wu
|
@Author:: Arthur Wu
|
||||||
@Desc::
|
@Desc::
|
||||||
@ -21,7 +21,7 @@ class Test_C015(unittest.TestCase):
|
|||||||
'''
|
'''
|
||||||
def setUp(self) -> None:
|
def setUp(self) -> None:
|
||||||
self.timestamp = int(time.time())
|
self.timestamp = int(time.time())
|
||||||
self.ymc = YMClientApi()
|
self.ymc = YMClientApi(ShoppingCartMac)
|
||||||
self.yms = YMServiceApi()
|
self.yms = YMServiceApi()
|
||||||
# 重量放通白名单商品暂未提供
|
# 重量放通白名单商品暂未提供
|
||||||
self.weight_to_whitelist_goods = WeightToWhitelistGoods
|
self.weight_to_whitelist_goods = WeightToWhitelistGoods
|
||||||
@ -30,7 +30,7 @@ class Test_C015(unittest.TestCase):
|
|||||||
"StoreId": MarketAndStoreDetails["putStoreId"][0]
|
"StoreId": MarketAndStoreDetails["putStoreId"][0]
|
||||||
}
|
}
|
||||||
|
|
||||||
def test_C015_NonVipReturnWeightOfTheProducte(self):
|
def test_CAnon014_ReturnWeightOfTheProducte(self):
|
||||||
allure.dynamic.description(f"描述:{DescName}")
|
allure.dynamic.description(f"描述:{DescName}")
|
||||||
allure.step("[前置条件]:先调用管理平台接口,将指定商品添加到重量放通白名单中")
|
allure.step("[前置条件]:先调用管理平台接口,将指定商品添加到重量放通白名单中")
|
||||||
pre_respomse = self.yms.add_weight_to_whitelist(
|
pre_respomse = self.yms.add_weight_to_whitelist(
|
||||||
@ -49,9 +49,13 @@ class Test_C015(unittest.TestCase):
|
|||||||
|
|
||||||
allure.step("步骤3:获取重量放通白名单商品信息")
|
allure.step("步骤3:获取重量放通白名单商品信息")
|
||||||
GoodsInfoData1 = self.ymc.get_goods_info(self.weight_to_whitelist_goods["GoodsInputcode"])
|
GoodsInfoData1 = self.ymc.get_goods_info(self.weight_to_whitelist_goods["GoodsInputcode"])
|
||||||
|
LOGGER.info(f"---获取的商品信息为:{GoodsInfoData1}")
|
||||||
|
if GoodsInfoData1['data']['weight'] == 0:
|
||||||
|
GoodsInfoData1['data']['weight'] = 400
|
||||||
if GoodsInfoData1['msg'] != '加购商品不存在':
|
if GoodsInfoData1['msg'] != '加购商品不存在':
|
||||||
allure.step("步骤4:加购白名单商品")
|
allure.step("步骤4:加购白名单商品")
|
||||||
AddGoodsResp = self.ymc.add_cart_goods(GoodsInfoData1, 5, LoginData)
|
AddGoodsResp = self.ymc.add_cart_goods(GoodsInfoData1, 1, LoginData)
|
||||||
|
LOGGER.info(f"---加购商品返回结果:{AddGoodsResp}")
|
||||||
|
|
||||||
''' step2:随机退购一个商品,并结算 '''
|
''' step2:随机退购一个商品,并结算 '''
|
||||||
allure.step("\n步骤5:退购一件商品")
|
allure.step("\n步骤5:退购一件商品")
|
||||||
@ -64,12 +68,15 @@ class Test_C015(unittest.TestCase):
|
|||||||
self.ymc.request_order_settlement(LoginData)
|
self.ymc.request_order_settlement(LoginData)
|
||||||
else:
|
else:
|
||||||
LOGGER.info(f"---商品 {self.weight_to_whitelist_goods["GoodsInputcode"]} 不存在")
|
LOGGER.info(f"---商品 {self.weight_to_whitelist_goods["GoodsInputcode"]} 不存在")
|
||||||
|
raise Exception(f"---商品 {self.weight_to_whitelist_goods['GoodsInputcode']} 不存在")
|
||||||
|
|
||||||
allure.step("[后置处理]:删除添加的重量放通白名单商品")
|
allure.step("[后置处理]:删除添加的重量放通白名单商品")
|
||||||
self.yms.delete_weight_whitelist_goods()
|
self.yms.delete_weight_whitelist_goods()
|
||||||
else:
|
else:
|
||||||
LOGGER.info(f"---添加商品 {self.weight_to_whitelist_goods['GoodsInputcode']} "
|
LOGGER.info(f"---添加商品 {self.weight_to_whitelist_goods['GoodsInputcode']} "
|
||||||
f"到重量放通白名单失败")
|
f"到重量放通白名单失败")
|
||||||
|
raise Exception(f"---添加商品 {self.weight_to_whitelist_goods['GoodsInputcode']} "
|
||||||
|
f"到重量放通白名单失败")
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
@ -6,11 +6,12 @@
|
|||||||
import unittest,allure,time
|
import unittest,allure,time
|
||||||
from configs.globalObj import LOGGER
|
from configs.globalObj import LOGGER
|
||||||
from YiMao.businessFunc.ClientApiLib import YMClientApi
|
from YiMao.businessFunc.ClientApiLib import YMClientApi
|
||||||
|
from YiMao.data.WuShangSceneTestData import *
|
||||||
|
|
||||||
|
|
||||||
DescName = "001-购物车客户端-广告"
|
DescName = "NoLogin001-购物车客户端-广告"
|
||||||
@allure.story(f'[场景测试] {DescName}验证')
|
@allure.story(f'[场景测试] {DescName}验证')
|
||||||
class Test_C001(unittest.TestCase):
|
class Test_CNoLogin001(unittest.TestCase):
|
||||||
f'''@Date:: 2024/11/15
|
f'''@Date:: 2024/11/15
|
||||||
@Author:: Arthur Wu
|
@Author:: Arthur Wu
|
||||||
@Desc::
|
@Desc::
|
||||||
@ -18,9 +19,9 @@ class Test_C001(unittest.TestCase):
|
|||||||
'''
|
'''
|
||||||
def setUp(self) -> None:
|
def setUp(self) -> None:
|
||||||
self.timestamp = int(time.time())
|
self.timestamp = int(time.time())
|
||||||
self.ymc = YMClientApi()
|
self.ymc = YMClientApi(ShoppingCartMac)
|
||||||
|
|
||||||
def test_C001_NonLoginCheckADs(self):
|
def test_CNoLogin001_CheckADs(self):
|
||||||
allure.dynamic.description(f"描述:{DescName}")
|
allure.dynamic.description(f"描述:{DescName}")
|
||||||
AdListData = self.ymc.get_ads_list()
|
AdListData = self.ymc.get_ads_list()
|
||||||
if "error_msg" not in AdListData:
|
if "error_msg" not in AdListData:
|
@ -9,9 +9,9 @@ from YiMao.businessFunc.ClientApiLib import YMClientApi
|
|||||||
from YiMao.data.WuShangSceneTestData import *
|
from YiMao.data.WuShangSceneTestData import *
|
||||||
|
|
||||||
|
|
||||||
DescName = "016-游客转会员登录,加购购物袋,并结算"
|
DescName = "Vip001-游客转会员登录,加购购物袋,并结算"
|
||||||
@allure.story(f'[场景测试] {DescName}验证')
|
@allure.story(f'[场景测试] {DescName}验证')
|
||||||
class Test_C016_NonToVipAddShoppingBagAndSettlePayment(unittest.TestCase):
|
class Test_CVip001_AddShoppingBagAndSettlePayment(unittest.TestCase):
|
||||||
f'''@Date:: 2024/11/20
|
f'''@Date:: 2024/11/20
|
||||||
@Author:: Arthur Wu
|
@Author:: Arthur Wu
|
||||||
@Desc::
|
@Desc::
|
||||||
@ -21,12 +21,12 @@ class Test_C016_NonToVipAddShoppingBagAndSettlePayment(unittest.TestCase):
|
|||||||
'''
|
'''
|
||||||
def setUp(self) -> None:
|
def setUp(self) -> None:
|
||||||
self.timestamp = int(time.time())
|
self.timestamp = int(time.time())
|
||||||
self.ymc = YMClientApi()
|
self.ymc = YMClientApi(ShoppingCartMac)
|
||||||
self.vip_phone_num = VIPPhoneNumber
|
self.vip_phone_num = VIPPhoneNumber
|
||||||
self.goodsbag_mid = GoodsBagInputcode_mid
|
self.goodsbag_mid = GoodsBagInputcode_mid
|
||||||
self.goodsbag_max = GoodsBagInputcode_max
|
self.goodsbag_max = GoodsBagInputcode_max
|
||||||
|
|
||||||
def test_C01601_AddMidShoppingbagsForPurchase(self):
|
def test_CVip00101_AddMidShoppingbagsForPurchase(self):
|
||||||
allure.dynamic.description(f"描述:加购中号购物袋")
|
allure.dynamic.description(f"描述:加购中号购物袋")
|
||||||
allure.step("步骤1:session开始")
|
allure.step("步骤1:session开始")
|
||||||
self.ymc.session_start()
|
self.ymc.session_start()
|
||||||
@ -50,7 +50,7 @@ class Test_C016_NonToVipAddShoppingBagAndSettlePayment(unittest.TestCase):
|
|||||||
else:
|
else:
|
||||||
LOGGER.info(f"---购物袋 {self.goodsbag_mid} 不存在")
|
LOGGER.info(f"---购物袋 {self.goodsbag_mid} 不存在")
|
||||||
|
|
||||||
def test_C01602_AddMaxShoppingbagsForPurchase(self):
|
def test_CVip00102_AddMaxShoppingbagsForPurchase(self):
|
||||||
allure.dynamic.description("描述:加购大号购物袋")
|
allure.dynamic.description("描述:加购大号购物袋")
|
||||||
allure.step("步骤1:session开始")
|
allure.step("步骤1:session开始")
|
||||||
self.ymc.session_start()
|
self.ymc.session_start()
|
||||||
@ -73,9 +73,9 @@ class Test_C016_NonToVipAddShoppingBagAndSettlePayment(unittest.TestCase):
|
|||||||
self.ymc.request_order_settlement(LoginData)
|
self.ymc.request_order_settlement(LoginData)
|
||||||
else:
|
else:
|
||||||
LOGGER.info(f"---购物袋 {self.goodsbag_max} 不存在")
|
LOGGER.info(f"---购物袋 {self.goodsbag_max} 不存在")
|
||||||
|
raise Exception(f"购物袋 {self.goodsbag_max} 不存在")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main(verbosity=2)
|
unittest.main(verbosity=2)
|
||||||
|
|
||||||
|
|
@ -9,9 +9,9 @@ from YiMao.businessFunc.ClientApiLib import YMClientApi
|
|||||||
from YiMao.data.WuShangSceneTestData import *
|
from YiMao.data.WuShangSceneTestData import *
|
||||||
|
|
||||||
|
|
||||||
DescName = "017-游客转会员登录,加购普通商品,并结算"
|
DescName = "Vip002-游客转会员登录,加购普通商品,并结算"
|
||||||
@allure.story(f'[场景测试] {DescName}验证')
|
@allure.story(f'[场景测试] {DescName}验证')
|
||||||
class Test_C017(unittest.TestCase):
|
class Test_CVip002(unittest.TestCase):
|
||||||
f'''@Date:: 2024/11/15
|
f'''@Date:: 2024/11/15
|
||||||
@Author:: Arthur Wu
|
@Author:: Arthur Wu
|
||||||
@Desc:: test_C003_NonVipAddNonDiscountedProductsForPurchase
|
@Desc:: test_C003_NonVipAddNonDiscountedProductsForPurchase
|
||||||
@ -21,11 +21,11 @@ class Test_C017(unittest.TestCase):
|
|||||||
'''
|
'''
|
||||||
def setUp(self) -> None:
|
def setUp(self) -> None:
|
||||||
self.timestamp = int(time.time())
|
self.timestamp = int(time.time())
|
||||||
self.ymc = YMClientApi()
|
self.ymc = YMClientApi(ShoppingCartMac)
|
||||||
self.vip_phone_num = VIPPhoneNumber
|
self.vip_phone_num = VIPPhoneNumber
|
||||||
self.NormalGoodsInputcode01 = NormalGoodsInputcode01 # 乐事薯片
|
self.NormalGoodsInputcode01 = NormalGoodsInputcode01 # 乐事薯片
|
||||||
|
|
||||||
def test_C017_NonToVipAddNonDiscountedProductsForPurchase(self):
|
def test_CVip002_AddNonDiscountedProductsForPurchase(self):
|
||||||
allure.dynamic.description(f"描述:{DescName}")
|
allure.dynamic.description(f"描述:{DescName}")
|
||||||
allure.step("步骤1:session开始")
|
allure.step("步骤1:session开始")
|
||||||
self.ymc.session_start()
|
self.ymc.session_start()
|
||||||
@ -48,6 +48,7 @@ class Test_C017(unittest.TestCase):
|
|||||||
self.ymc.request_order_settlement(LoginData)
|
self.ymc.request_order_settlement(LoginData)
|
||||||
else:
|
else:
|
||||||
LOGGER.info(f"---商品 {self.NormalGoodsInputcode01} 不存在")
|
LOGGER.info(f"---商品 {self.NormalGoodsInputcode01} 不存在")
|
||||||
|
raise Exception(f"---商品 {self.NormalGoodsInputcode01} 不存在")
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
@ -9,9 +9,9 @@ from YiMao.businessFunc.ClientApiLib import YMClientApi
|
|||||||
from YiMao.data.WuShangSceneTestData import *
|
from YiMao.data.WuShangSceneTestData import *
|
||||||
|
|
||||||
|
|
||||||
DescName = "018-游客转会员登录,加购会员商品,并结算"
|
DescName = "Vip003-游客转会员登录,加购会员商品,并结算"
|
||||||
@allure.story(f'[场景测试] {DescName}验证')
|
@allure.story(f'[场景测试] {DescName}验证')
|
||||||
class Test_C018(unittest.TestCase):
|
class Test_CVip003(unittest.TestCase):
|
||||||
f'''@Date:: 2024/11/20
|
f'''@Date:: 2024/11/20
|
||||||
@Author:: Arthur Wu
|
@Author:: Arthur Wu
|
||||||
@Desc::
|
@Desc::
|
||||||
@ -21,12 +21,12 @@ class Test_C018(unittest.TestCase):
|
|||||||
'''
|
'''
|
||||||
def setUp(self) -> None:
|
def setUp(self) -> None:
|
||||||
self.timestamp = int(time.time())
|
self.timestamp = int(time.time())
|
||||||
self.ymc = YMClientApi()
|
self.ymc = YMClientApi(ShoppingCartMac)
|
||||||
# 会员有优惠商品暂未提供
|
# 会员有优惠商品暂未提供
|
||||||
self.vip_phone_num = VIPPhoneNumber
|
self.vip_phone_num = VIPPhoneNumber
|
||||||
self.vip_goods_inputcode = VipGoodsInputcode # 统一番茄牛肉面
|
self.vip_goods_inputcode = VipGoodsInputcode # 统一番茄牛肉面
|
||||||
|
|
||||||
def test_C018_NonToVipAddMemberPproductsForPurchase(self):
|
def test_CVip003_AddMemberProductsForPurchase(self):
|
||||||
allure.dynamic.description(f"描述:{DescName}")
|
allure.dynamic.description(f"描述:{DescName}")
|
||||||
allure.step("步骤1:session开始")
|
allure.step("步骤1:session开始")
|
||||||
self.ymc.session_start()
|
self.ymc.session_start()
|
||||||
@ -49,6 +49,7 @@ class Test_C018(unittest.TestCase):
|
|||||||
self.ymc.request_order_settlement(LoginData)
|
self.ymc.request_order_settlement(LoginData)
|
||||||
else:
|
else:
|
||||||
LOGGER.info(f"---商品 {self.vip_goods_inputcode} 不存在")
|
LOGGER.info(f"---商品 {self.vip_goods_inputcode} 不存在")
|
||||||
|
raise Exception(f"---商品 {self.vip_goods_inputcode} 不存在")
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
@ -9,9 +9,9 @@ from YiMao.businessFunc.ClientApiLib import YMClientApi
|
|||||||
from YiMao.data.WuShangSceneTestData import *
|
from YiMao.data.WuShangSceneTestData import *
|
||||||
|
|
||||||
|
|
||||||
DescName = "019-游客转会员登录,加购多件商品,并结算"
|
DescName = "Vip004-游客转会员登录,加购多件商品,并结算"
|
||||||
@allure.story(f'[场景测试] {DescName}验证')
|
@allure.story(f'[场景测试] {DescName}验证')
|
||||||
class Test_C019(unittest.TestCase):
|
class Test_CVip004(unittest.TestCase):
|
||||||
f'''@Date:: 2024/11/15
|
f'''@Date:: 2024/11/15
|
||||||
@Author:: Arthur Wu
|
@Author:: Arthur Wu
|
||||||
@Desc::
|
@Desc::
|
||||||
@ -20,12 +20,12 @@ class Test_C019(unittest.TestCase):
|
|||||||
'''
|
'''
|
||||||
def setUp(self) -> None:
|
def setUp(self) -> None:
|
||||||
self.timestamp = int(time.time())
|
self.timestamp = int(time.time())
|
||||||
self.ymc = YMClientApi()
|
self.ymc = YMClientApi(ShoppingCartMac)
|
||||||
self.vip_phone_num = VIPPhoneNumber
|
self.vip_phone_num = VIPPhoneNumber
|
||||||
self.goods_inputcode1 = NormalGoodsInputcode01 # 乐事薯片
|
self.goods_inputcode1 = NormalGoodsInputcode01 # 乐事薯片
|
||||||
self.goods_inputcode2 = NormalGoodsInputcode02 # 统一番茄牛肉面
|
self.goods_inputcode2 = NormalGoodsInputcode02 # 统一番茄牛肉面
|
||||||
|
|
||||||
def test_C019_NonToVipAddMultipleItemsForPurchase(self):
|
def test_CVip004_AddMultipleItemsForPurchase(self):
|
||||||
allure.dynamic.description(f"描述:{DescName}")
|
allure.dynamic.description(f"描述:{DescName}")
|
||||||
allure.step("步骤1:session开始")
|
allure.step("步骤1:session开始")
|
||||||
self.ymc.session_start()
|
self.ymc.session_start()
|
||||||
@ -53,8 +53,10 @@ class Test_C019(unittest.TestCase):
|
|||||||
self.ymc.request_order_settlement(LoginData)
|
self.ymc.request_order_settlement(LoginData)
|
||||||
else:
|
else:
|
||||||
LOGGER.info(f"---商品 {self.goods_inputcode2} 不存在")
|
LOGGER.info(f"---商品 {self.goods_inputcode2} 不存在")
|
||||||
|
raise AssertionError(f"---商品 {self.goods_inputcode2} 不存在")
|
||||||
else:
|
else:
|
||||||
LOGGER.info(f"---商品 {self.goods_inputcode1} 不存在")
|
LOGGER.info(f"---商品 {self.goods_inputcode1} 不存在")
|
||||||
|
raise AssertionError(f"---商品 {self.goods_inputcode1} 不存在")
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
@ -0,0 +1,56 @@
|
|||||||
|
# !/usr/bin/python
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# @Author:: Arthur Wu
|
||||||
|
# @Description:: 游客转会员登录,加购打折商品,并结算
|
||||||
|
# @Date:: 2024/11/21
|
||||||
|
import unittest,allure,time
|
||||||
|
from configs.globalObj import LOGGER
|
||||||
|
from YiMao.businessFunc.ClientApiLib import YMClientApi
|
||||||
|
from YiMao.data.WuShangSceneTestData import *
|
||||||
|
|
||||||
|
|
||||||
|
DescName = "Vip005-游客转会员登录,加购打折商品,并结算"
|
||||||
|
@allure.story(f'[场景测试] {DescName}验证')
|
||||||
|
class Test_CVip005(unittest.TestCase):
|
||||||
|
f'''@Date:: 2024/11/21
|
||||||
|
@Author:: Arthur Wu
|
||||||
|
@Desc::
|
||||||
|
[购物车客户端] {DescName}
|
||||||
|
1、武商测试环境,会员有优惠商品inputcode为:
|
||||||
|
!!!!折扣商品暂未提供
|
||||||
|
'''
|
||||||
|
def setUp(self) -> None:
|
||||||
|
self.timestamp = int(time.time())
|
||||||
|
self.ymc = YMClientApi(ShoppingCartMac)
|
||||||
|
# 折扣商品暂未提供
|
||||||
|
self.vip_phone_num = VIPPhoneNumber
|
||||||
|
self.sale_goods_inputCode = SaleGoodsInputCode # 乐事薯片
|
||||||
|
|
||||||
|
def test_CVip005_AddDiscountedProductsForPurchase(self):
|
||||||
|
allure.dynamic.description(f"描述:{DescName}")
|
||||||
|
allure.step("步骤1:session开始")
|
||||||
|
self.ymc.session_start()
|
||||||
|
allure.step("步骤2:匿名登录")
|
||||||
|
Payload01 = {"action": 0, "isAnon": True}
|
||||||
|
LoginData = self.ymc.login_app_v2(Payload01)
|
||||||
|
|
||||||
|
allure.step("步骤3:切换会员登录")
|
||||||
|
Payload02 = {"action": 1, "code": self.vip_phone_num, "isAnon": False}
|
||||||
|
self.ymc.login_app_v2(Payload02)
|
||||||
|
|
||||||
|
allure.step("步骤3:获取折扣商品信息")
|
||||||
|
GoodsInfoData = self.ymc.get_goods_info(InputCode=self.sale_goods_inputCode)
|
||||||
|
if GoodsInfoData['msg'] != '加购商品不存在':
|
||||||
|
allure.step("步骤4:加购折扣商品")
|
||||||
|
self.ymc.add_cart_goods(GoodsInfoData, 1, LoginData)
|
||||||
|
allure.step("步骤5:获取购物车商品信息")
|
||||||
|
self.ymc.get_cart_goods_info([GoodsInfoData])
|
||||||
|
allure.step("步骤6:请求订单结算")
|
||||||
|
self.ymc.request_order_settlement(LoginData)
|
||||||
|
else:
|
||||||
|
LOGGER.info(f"---商品 {self.sale_goods_inputCode} 不存在")
|
||||||
|
raise Exception(f"---商品 {self.sale_goods_inputCode} 不存在")
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
unittest.main(verbosity=2)
|
@ -0,0 +1,78 @@
|
|||||||
|
# !/usr/bin/python
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# @Author:: Arthur Wu
|
||||||
|
# @Description:: 游客转会员登录,加购促销白名单商品,并结算
|
||||||
|
# @Date:: 2024/11/21
|
||||||
|
import unittest,allure,time
|
||||||
|
from configs.globalObj import LOGGER
|
||||||
|
from YiMao.businessFunc.ClientApiLib import YMClientApi
|
||||||
|
from YiMao.businessFunc.ServiceApiLib import YMServiceApi
|
||||||
|
from YiMao.data.WuShangSceneTestData import *
|
||||||
|
|
||||||
|
|
||||||
|
DescName = "Vip006-游客转会员登录,加购促销白名单商品,并结算"
|
||||||
|
@allure.story(f'[场景测试] {DescName}验证')
|
||||||
|
class Test_CVip006(unittest.TestCase):
|
||||||
|
f'''@Date:: 2024/11/15
|
||||||
|
@Author:: Arthur Wu
|
||||||
|
@Desc::
|
||||||
|
[购物车客户端] {DescName}
|
||||||
|
1、武商测试环境,促销白名单商品inputcode为:
|
||||||
|
6925303796426
|
||||||
|
'''
|
||||||
|
def setUp(self) -> None:
|
||||||
|
self.timestamp = int(time.time())
|
||||||
|
self.ymc = YMClientApi(ShoppingCartMac)
|
||||||
|
self.yms = YMServiceApi()
|
||||||
|
# 促销白名单商品暂未提供
|
||||||
|
self.vip_phone_num = VIPPhoneNumber
|
||||||
|
self.promotional_whitelist_goods = PromotionalWhitelistGoods
|
||||||
|
self.market_and_store_info = {
|
||||||
|
"MarketId": MarketAndStoreDetails["putMarketId"],
|
||||||
|
"StoreId": MarketAndStoreDetails["putStoreId"][0]
|
||||||
|
}
|
||||||
|
|
||||||
|
def test_CVip006_AddPromotionalWhitelistProducts(self):
|
||||||
|
allure.dynamic.description(f"描述:{DescName}")
|
||||||
|
allure.step("[前置条件]:先调用管理平台接口,将指定商品添加到促销白名单中")
|
||||||
|
pre_respomse = self.yms.add_promotional_product_whitelist(
|
||||||
|
self.promotional_whitelist_goods, self.market_and_store_info
|
||||||
|
)
|
||||||
|
if pre_respomse['data'] is not None:
|
||||||
|
LOGGER.info(f"---商品 {self.promotional_whitelist_goods['GoodsInputcode']} "
|
||||||
|
f"已添加到促销白名单中")
|
||||||
|
allure.step("[业务步骤]:再调用客户端接口,执行加购操作")
|
||||||
|
allure.step("步骤1:session开始")
|
||||||
|
self.ymc.session_start()
|
||||||
|
allure.step("步骤2:匿名登录")
|
||||||
|
Payload01 = {"action": 0, "isAnon": True}
|
||||||
|
LoginData = self.ymc.login_app_v2(Payload01)
|
||||||
|
|
||||||
|
allure.step("步骤3:切换会员登录")
|
||||||
|
Payload02 = {"action": 1, "code": self.vip_phone_num, "isAnon": False}
|
||||||
|
self.ymc.login_app_v2(Payload02)
|
||||||
|
|
||||||
|
allure.step("步骤3:获取白名单商品信息")
|
||||||
|
GoodsInfoData1 = self.ymc.get_goods_info(self.promotional_whitelist_goods["GoodsInputcode"])
|
||||||
|
if GoodsInfoData1['msg'] != '加购商品不存在':
|
||||||
|
allure.step("步骤4:加购白名单商品")
|
||||||
|
self.ymc.add_cart_goods(GoodsInfoData1, 1, LoginData)
|
||||||
|
allure.step("步骤5:获取购物车商品信息")
|
||||||
|
self.ymc.get_cart_goods_info([GoodsInfoData1])
|
||||||
|
allure.step("步骤6:请求订单结算")
|
||||||
|
self.ymc.request_order_settlement(LoginData)
|
||||||
|
else:
|
||||||
|
LOGGER.info(f"---商品 {self.promotional_whitelist_goods["GoodsInputcode"]} 不存在")
|
||||||
|
raise Exception(f"商品 {self.promotional_whitelist_goods["GoodsInputcode"]}不存在")
|
||||||
|
|
||||||
|
allure.step("[后置处理]:删除添加的促销白名单商品")
|
||||||
|
self.yms.delete_whitelist_goods()
|
||||||
|
else:
|
||||||
|
LOGGER.info(f"---添加商品 {self.promotional_whitelist_goods['GoodsInputcode']} "
|
||||||
|
f"到促销白名单失败")
|
||||||
|
raise Exception(f"---添加商品 {self.promotional_whitelist_goods['GoodsInputcode']} "
|
||||||
|
f"到促销白名单失败")
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
unittest.main(verbosity=2)
|
@ -0,0 +1,79 @@
|
|||||||
|
# !/usr/bin/python
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# @Author:: Arthur Wu
|
||||||
|
# @Description:: 游客转会员登录,加购重量放通商品,并结算
|
||||||
|
# @Date:: 2024/11/21
|
||||||
|
import unittest,allure,time
|
||||||
|
from configs.globalObj import LOGGER
|
||||||
|
from YiMao.businessFunc.ClientApiLib import YMClientApi
|
||||||
|
from YiMao.businessFunc.ServiceApiLib import YMServiceApi
|
||||||
|
from YiMao.data.WuShangSceneTestData import *
|
||||||
|
|
||||||
|
|
||||||
|
DescName = "Vip007-游客转会员登录,加购重量放通商品,并结算"
|
||||||
|
@allure.story(f'[场景测试] {DescName}验证')
|
||||||
|
class Test_CVip007(unittest.TestCase):
|
||||||
|
f'''@Date:: 2024/11/15
|
||||||
|
@Author:: Arthur Wu
|
||||||
|
@Desc::
|
||||||
|
[购物车客户端] {DescName}
|
||||||
|
1、武商测试环境,重量放通商品inputcode为:
|
||||||
|
6924743915848
|
||||||
|
'''
|
||||||
|
def setUp(self) -> None:
|
||||||
|
self.timestamp = int(time.time())
|
||||||
|
self.ymc = YMClientApi(ShoppingCartMac)
|
||||||
|
self.yms = YMServiceApi()
|
||||||
|
# 重量放通白名单商品暂未提供
|
||||||
|
self.vip_phone_num = VIPPhoneNumber
|
||||||
|
self.weight_to_whitelist_goods = WeightToWhitelistGoods
|
||||||
|
self.market_and_store_info = {
|
||||||
|
"MarketId": MarketAndStoreDetails["putMarketId"],
|
||||||
|
"StoreId": MarketAndStoreDetails["putStoreId"][0]
|
||||||
|
}
|
||||||
|
|
||||||
|
def test_CVip007_AddWeightToTheProduct(self):
|
||||||
|
allure.dynamic.description(f"描述:{DescName}")
|
||||||
|
allure.step("[前置条件]:先调用管理平台接口,将指定商品添加到重量放通白名单中")
|
||||||
|
pre_respomse = self.yms.add_weight_to_whitelist(
|
||||||
|
self.weight_to_whitelist_goods, self.market_and_store_info
|
||||||
|
)
|
||||||
|
if pre_respomse['data'] is not None:
|
||||||
|
LOGGER.info(f"---商品 {self.weight_to_whitelist_goods['GoodsInputcode']} "
|
||||||
|
f"已添加到重量放通白名单中")
|
||||||
|
''' 2-再调用客户端接口,执行加购操作 '''
|
||||||
|
allure.step("[业务步骤]:再调用客户端接口,执行加购操作")
|
||||||
|
allure.step("步骤1:session开始")
|
||||||
|
self.ymc.session_start()
|
||||||
|
allure.step("步骤2:匿名登录")
|
||||||
|
Payload01 = {"action": 0, "isAnon": True}
|
||||||
|
LoginData = self.ymc.login_app_v2(Payload01)
|
||||||
|
|
||||||
|
allure.step("步骤3:切换会员登录")
|
||||||
|
Payload02 = {"action": 1, "code": self.vip_phone_num, "isAnon": False}
|
||||||
|
self.ymc.login_app_v2(Payload02)
|
||||||
|
|
||||||
|
allure.step("步骤3:获取白名单商品信息")
|
||||||
|
GoodsInfoData1 = self.ymc.get_goods_info(self.weight_to_whitelist_goods["GoodsInputcode"])
|
||||||
|
if GoodsInfoData1['msg'] != '加购商品不存在':
|
||||||
|
allure.step("步骤4:加购白名单商品")
|
||||||
|
self.ymc.add_cart_goods(GoodsInfoData1, 1, LoginData)
|
||||||
|
allure.step("步骤5:获取购物车商品信息")
|
||||||
|
self.ymc.get_cart_goods_info([GoodsInfoData1])
|
||||||
|
allure.step("步骤6:请求订单结算")
|
||||||
|
self.ymc.request_order_settlement(LoginData)
|
||||||
|
else:
|
||||||
|
LOGGER.info(f"---商品 {self.weight_to_whitelist_goods["GoodsInputcode"]} 不存在")
|
||||||
|
raise Exception(f"---商品 {self.weight_to_whitelist_goods["GoodsInputcode"]} 不存在")
|
||||||
|
|
||||||
|
allure.step("[后置处理]:删除添加的重量放通白名单商品")
|
||||||
|
self.yms.delete_weight_whitelist_goods()
|
||||||
|
else:
|
||||||
|
LOGGER.info(f"---添加商品 {self.weight_to_whitelist_goods['GoodsInputcode']} "
|
||||||
|
f"到重量放通白名单失败")
|
||||||
|
raise Exception(f"---添加商品 {self.weight_to_whitelist_goods['GoodsInputcode']} "
|
||||||
|
f"到重量放通白名单失败")
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
unittest.main(verbosity=2)
|
@ -0,0 +1,70 @@
|
|||||||
|
# !/usr/bin/python
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# @Author:: Arthur Wu
|
||||||
|
# @Description:: 游客转会员登录,加购2个购物袋,退购一个购物袋,并结算
|
||||||
|
# @Date:: 2024/11/21
|
||||||
|
import unittest,allure,time
|
||||||
|
from configs.globalObj import LOGGER
|
||||||
|
from YiMao.businessFunc.ClientApiLib import YMClientApi
|
||||||
|
from YiMao.data.WuShangSceneTestData import *
|
||||||
|
|
||||||
|
|
||||||
|
DescName = "Vip008-游客转会员登录,加购2个购物袋,退购一个购物袋,并结算"
|
||||||
|
@allure.story(f'[场景测试] {DescName}验证')
|
||||||
|
class Test_CVip008(unittest.TestCase):
|
||||||
|
f'''@Date:: 2024/11/20
|
||||||
|
@Author:: Arthur Wu
|
||||||
|
@Desc::
|
||||||
|
[购物车客户端] {DescName}
|
||||||
|
1、武商测试环境,购物袋的 inputcode 分别为:
|
||||||
|
'''
|
||||||
|
def setUp(self) -> None:
|
||||||
|
self.timestamp = int(time.time())
|
||||||
|
self.ymc = YMClientApi(ShoppingCartMac)
|
||||||
|
self.vip_phone_num = VIPPhoneNumber
|
||||||
|
self.shoppingbag_mid = GoodsBagInputcode_mid # 乐事薯片
|
||||||
|
self.shoppingbag_max = GoodsBagInputcode_max # 统一番茄牛肉面
|
||||||
|
|
||||||
|
def test_CVip008_ReturnShoppingBag(self):
|
||||||
|
allure.dynamic.description(f"描述:{DescName}")
|
||||||
|
allure.step("步骤1:session开始")
|
||||||
|
self.ymc.session_start()
|
||||||
|
allure.step("步骤2:匿名登录")
|
||||||
|
Payload01 = {"action": 0, "isAnon": True}
|
||||||
|
LoginData = self.ymc.login_app_v2(Payload01)
|
||||||
|
|
||||||
|
allure.step("步骤3:切换会员登录")
|
||||||
|
Payload02 = {"action": 1, "code": self.vip_phone_num, "isAnon": False}
|
||||||
|
self.ymc.login_app_v2(Payload02)
|
||||||
|
|
||||||
|
'''step1:加购商品x,分别加购x件'''
|
||||||
|
allure.step("步骤3:获取商品1信息")
|
||||||
|
GetGoodsInfoResp_01 = self.ymc.get_goods_info(InputCode=self.shoppingbag_mid)
|
||||||
|
if GetGoodsInfoResp_01['msg'] != '加购商品不存在':
|
||||||
|
allure.step("步骤4:添加商品1")
|
||||||
|
self.ymc.add_cart_goods(GetGoodsInfoResp_01, 2, LoginData)
|
||||||
|
allure.step("步骤5:获取商品2信息")
|
||||||
|
GetGoodsInfoResp_02 = self.ymc.get_goods_info(InputCode=self.shoppingbag_max)
|
||||||
|
if GetGoodsInfoResp_02['msg'] != '加购商品不存在':
|
||||||
|
allure.step("步骤6:添加商品2")
|
||||||
|
AddGoodsResp = self.ymc.add_cart_goods(GetGoodsInfoResp_02, 2, LoginData)
|
||||||
|
|
||||||
|
''' step2:随机退购一个商品,并结算 '''
|
||||||
|
allure.step("\n步骤7:退购一件商品")
|
||||||
|
GetGoodsInfoList = [GetGoodsInfoResp_01, GetGoodsInfoResp_02]
|
||||||
|
self.ymc.delete_shopping_bag(GetGoodsInfoList, LoginData, AddGoodsResp)
|
||||||
|
|
||||||
|
allure.step("步骤8:获取购物车商品信息")
|
||||||
|
self.ymc.get_cart_goods_info([GetGoodsInfoResp_01, GetGoodsInfoResp_02])
|
||||||
|
allure.step("步骤9:请求订单结算")
|
||||||
|
self.ymc.request_order_settlement(LoginData)
|
||||||
|
else:
|
||||||
|
LOGGER.info(f"---商品 {self.shoppingbag_max} 不存在")
|
||||||
|
raise AssertionError(f"---商品 {self.shoppingbag_max} 不存在")
|
||||||
|
else:
|
||||||
|
LOGGER.info(f"---商品 {self.shoppingbag_mid} 不存在")
|
||||||
|
raise AssertionError(f"---商品 {self.shoppingbag_mid} 不存在")
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
unittest.main(verbosity=2)
|
@ -0,0 +1,70 @@
|
|||||||
|
# !/usr/bin/python
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# @Author:: Arthur Wu
|
||||||
|
# @Description:: 游客转会员登录,加购2个普通商品,退购一个,并结算
|
||||||
|
# @Date:: 2024/11/21
|
||||||
|
import unittest,allure,time
|
||||||
|
from configs.globalObj import LOGGER
|
||||||
|
from YiMao.businessFunc.ClientApiLib import YMClientApi
|
||||||
|
from YiMao.data.WuShangSceneTestData import *
|
||||||
|
|
||||||
|
|
||||||
|
DescName = "Vip009-游客转会员登录,加购2个普通商品,退购一个,并结算"
|
||||||
|
@allure.story(f'[场景测试] {DescName}验证')
|
||||||
|
class Test_CVip009(unittest.TestCase):
|
||||||
|
f'''@Date:: 2024/11/20
|
||||||
|
@Author:: Arthur Wu
|
||||||
|
@Desc::
|
||||||
|
[购物车客户端] {DescName}
|
||||||
|
1、武商测试环境,2个普通商品 inputcode 分别为:
|
||||||
|
'''
|
||||||
|
def setUp(self) -> None:
|
||||||
|
self.timestamp = int(time.time())
|
||||||
|
self.ymc = YMClientApi(ShoppingCartMac)
|
||||||
|
self.vip_phone_num = VIPPhoneNumber
|
||||||
|
self.goods_01 = NormalGoodsInputcode01 # 乐事薯片
|
||||||
|
self.goods_02 = NormalGoodsInputcode02 # 统一番茄牛肉面
|
||||||
|
|
||||||
|
def test_CVip009_ReturnPurchaseOfOrdinaryGoods(self):
|
||||||
|
allure.dynamic.description(f"描述:{DescName}")
|
||||||
|
allure.step("步骤1:session开始")
|
||||||
|
self.ymc.session_start()
|
||||||
|
allure.step("步骤2:匿名登录")
|
||||||
|
Payload01 = {"action": 0, "isAnon": True}
|
||||||
|
LoginData = self.ymc.login_app_v2(Payload01)
|
||||||
|
|
||||||
|
allure.step("步骤3:切换会员登录")
|
||||||
|
Payload02 = {"action": 1, "code": self.vip_phone_num, "isAnon": False}
|
||||||
|
self.ymc.login_app_v2(Payload02)
|
||||||
|
|
||||||
|
'''step1:加购商品x,分别加购x件'''
|
||||||
|
allure.step("步骤3:获取商品1信息")
|
||||||
|
GetGoodsInfoResp_01 = self.ymc.get_goods_info(InputCode=self.goods_01)
|
||||||
|
if GetGoodsInfoResp_01['msg'] != '加购商品不存在':
|
||||||
|
allure.step("步骤4:添加商品1")
|
||||||
|
self.ymc.add_cart_goods(GetGoodsInfoResp_01, 1, LoginData)
|
||||||
|
allure.step("步骤5:获取商品2信息")
|
||||||
|
GetGoodsInfoResp_02 = self.ymc.get_goods_info(InputCode=self.goods_02)
|
||||||
|
if GetGoodsInfoResp_02['msg'] != '加购商品不存在':
|
||||||
|
allure.step("步骤6:添加商品2")
|
||||||
|
AddGoodsResp = self.ymc.add_cart_goods(GetGoodsInfoResp_02, 1, LoginData)
|
||||||
|
|
||||||
|
''' step2:随机退购一个商品,并结算 '''
|
||||||
|
allure.step("\n步骤7:退购一件商品")
|
||||||
|
GetGoodsInfoList = [GetGoodsInfoResp_01, GetGoodsInfoResp_02]
|
||||||
|
self.ymc.delete_cart_goods(GetGoodsInfoList, LoginData, AddGoodsResp)
|
||||||
|
|
||||||
|
allure.step("步骤8:获取购物车商品信息")
|
||||||
|
self.ymc.get_cart_goods_info([GetGoodsInfoResp_01, GetGoodsInfoResp_02])
|
||||||
|
allure.step("步骤9:请求订单结算")
|
||||||
|
self.ymc.request_order_settlement(LoginData)
|
||||||
|
else:
|
||||||
|
LOGGER.info(f"---商品 {self.goods_02} 不存在")
|
||||||
|
raise AssertionError(f"---商品 {self.goods_02} 不存在")
|
||||||
|
else:
|
||||||
|
LOGGER.info(f"---商品 {self.goods_01} 不存在")
|
||||||
|
raise AssertionError(f"---商品 {self.goods_01} 不存在")
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
unittest.main(verbosity=2)
|
@ -0,0 +1,70 @@
|
|||||||
|
# !/usr/bin/python
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# @Author:: Arthur Wu
|
||||||
|
# @Description:: 游客转会员登录,加购2个会员商品,退购一个,并结算
|
||||||
|
# @Date:: 2024/11/21
|
||||||
|
import unittest,allure,time
|
||||||
|
from configs.globalObj import LOGGER
|
||||||
|
from YiMao.businessFunc.ClientApiLib import YMClientApi
|
||||||
|
from YiMao.data.WuShangSceneTestData import *
|
||||||
|
|
||||||
|
|
||||||
|
DescName = "Vip010-游客转会员登录,加购2个会员商品,退购一个,并结算"
|
||||||
|
@allure.story(f'[场景测试] {DescName}验证')
|
||||||
|
class Test_CVip010(unittest.TestCase):
|
||||||
|
f'''@Date:: 2024/11/20
|
||||||
|
@Author:: Arthur Wu
|
||||||
|
@Desc::
|
||||||
|
[购物车客户端] {DescName}
|
||||||
|
1、武商测试环境,2个会员商品 inputcode 分别为:
|
||||||
|
'''
|
||||||
|
def setUp(self) -> None:
|
||||||
|
self.timestamp = int(time.time())
|
||||||
|
self.ymc = YMClientApi(ShoppingCartMac)
|
||||||
|
self.vip_phone_num = VIPPhoneNumber
|
||||||
|
self.vip_goods_01 = VipGoodsInputcode # 乐事薯片
|
||||||
|
self.vip_goods_02 = VipGoodsInputcode02 # 统一番茄牛肉面
|
||||||
|
|
||||||
|
def test_CVip010_ReturnOfMemberProducts(self):
|
||||||
|
allure.dynamic.description(f"描述:{DescName}")
|
||||||
|
allure.step("步骤1:session开始")
|
||||||
|
self.ymc.session_start()
|
||||||
|
allure.step("步骤2:匿名登录")
|
||||||
|
Payload01 = {"action": 0, "isAnon": True}
|
||||||
|
LoginData = self.ymc.login_app_v2(Payload01)
|
||||||
|
|
||||||
|
allure.step("步骤3:切换会员登录")
|
||||||
|
Payload02 = {"action": 1, "code": self.vip_phone_num, "isAnon": False}
|
||||||
|
self.ymc.login_app_v2(Payload02)
|
||||||
|
|
||||||
|
'''step1:加购商品x,分别加购x件'''
|
||||||
|
allure.step("步骤3:获取商品1信息")
|
||||||
|
GetGoodsInfoResp_01 = self.ymc.get_goods_info(InputCode=self.vip_goods_01)
|
||||||
|
if GetGoodsInfoResp_01['msg'] != '加购商品不存在':
|
||||||
|
allure.step("步骤4:添加商品1")
|
||||||
|
self.ymc.add_cart_goods(GetGoodsInfoResp_01, 3, LoginData)
|
||||||
|
allure.step("步骤5:获取商品2信息")
|
||||||
|
GetGoodsInfoResp_02 = self.ymc.get_goods_info(InputCode=self.vip_goods_02)
|
||||||
|
if GetGoodsInfoResp_02['msg'] != '加购商品不存在':
|
||||||
|
allure.step("步骤6:添加商品2")
|
||||||
|
AddGoodsResp = self.ymc.add_cart_goods(GetGoodsInfoResp_02, 1, LoginData)
|
||||||
|
|
||||||
|
''' step2:随机退购一个商品,并结算 '''
|
||||||
|
allure.step("\n步骤7:退购一件商品")
|
||||||
|
GetGoodsInfoList = [GetGoodsInfoResp_01, GetGoodsInfoResp_02]
|
||||||
|
self.ymc.delete_cart_goods(GetGoodsInfoList, LoginData, AddGoodsResp)
|
||||||
|
|
||||||
|
allure.step("步骤8:获取购物车商品信息")
|
||||||
|
self.ymc.get_cart_goods_info([GetGoodsInfoResp_01, GetGoodsInfoResp_02])
|
||||||
|
allure.step("步骤9:请求订单结算")
|
||||||
|
self.ymc.request_order_settlement(LoginData)
|
||||||
|
else:
|
||||||
|
LOGGER.info(f"---商品 {self.vip_goods_02} 不存在")
|
||||||
|
raise AssertionError(f"---商品 {self.vip_goods_02} 不存在")
|
||||||
|
else:
|
||||||
|
LOGGER.info(f"---商品 {self.vip_goods_01} 不存在")
|
||||||
|
raise AssertionError(f"---商品 {self.vip_goods_01} 不存在")
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
unittest.main(verbosity=2)
|
@ -0,0 +1,70 @@
|
|||||||
|
# !/usr/bin/python
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# @Author:: Arthur Wu
|
||||||
|
# @Description:: 游客转会员登录,加购多件商品,退购一个商品,并结算
|
||||||
|
# @Date:: 2024/11/21
|
||||||
|
import unittest,allure,time
|
||||||
|
from configs.globalObj import LOGGER
|
||||||
|
from YiMao.businessFunc.ClientApiLib import YMClientApi
|
||||||
|
from YiMao.data.WuShangSceneTestData import *
|
||||||
|
|
||||||
|
|
||||||
|
DescName = "Vip011-游客转会员登录,加购多件商品,退购一个商品,并结算"
|
||||||
|
@allure.story(f'[场景测试] {DescName}验证')
|
||||||
|
class Test_CVip011(unittest.TestCase):
|
||||||
|
f'''@Date:: 2024/11/20
|
||||||
|
@Author:: Arthur Wu
|
||||||
|
@Desc::
|
||||||
|
[购物车客户端] {DescName}
|
||||||
|
1、武商测试环境,多件商品的 inputcode 分别为:
|
||||||
|
'''
|
||||||
|
def setUp(self) -> None:
|
||||||
|
self.timestamp = int(time.time())
|
||||||
|
self.ymc = YMClientApi(ShoppingCartMac)
|
||||||
|
self.vip_phone_num = VIPPhoneNumber
|
||||||
|
self.goods_inputcode1 = NormalGoodsInputcode01 # 乐事薯片
|
||||||
|
self.goods_inputcode2 = NormalGoodsInputcode02 # 统一番茄牛肉面
|
||||||
|
|
||||||
|
def test_CVip011_ReturnOneItemFromMultiplePurchases(self):
|
||||||
|
allure.dynamic.description(f"描述:{DescName}")
|
||||||
|
allure.step("步骤1:session开始")
|
||||||
|
self.ymc.session_start()
|
||||||
|
allure.step("步骤2:匿名登录")
|
||||||
|
Payload01 = {"action": 0, "isAnon": True}
|
||||||
|
LoginData = self.ymc.login_app_v2(Payload01)
|
||||||
|
|
||||||
|
allure.step("步骤3:切换会员登录")
|
||||||
|
Payload02 = {"action": 1, "code": self.vip_phone_num, "isAnon": False}
|
||||||
|
self.ymc.login_app_v2(Payload02)
|
||||||
|
|
||||||
|
'''step1:加购商品x,分别加购x件'''
|
||||||
|
allure.step("步骤3:获取商品1信息")
|
||||||
|
GetGoodsInfoResp_01 = self.ymc.get_goods_info(InputCode=self.goods_inputcode1)
|
||||||
|
if GetGoodsInfoResp_01['msg'] != '加购商品不存在':
|
||||||
|
allure.step("步骤4:添加商品1")
|
||||||
|
self.ymc.add_cart_goods(GetGoodsInfoResp_01, 2, LoginData)
|
||||||
|
allure.step("步骤5:获取商品2信息")
|
||||||
|
GetGoodsInfoResp_02 = self.ymc.get_goods_info(InputCode=self.goods_inputcode2)
|
||||||
|
if GetGoodsInfoResp_02['msg'] != '加购商品不存在':
|
||||||
|
allure.step("步骤6:添加商品2")
|
||||||
|
AddGoodsResp = self.ymc.add_cart_goods(GetGoodsInfoResp_02, 2, LoginData)
|
||||||
|
|
||||||
|
''' step2:随机退购一个商品,并结算 '''
|
||||||
|
allure.step("\n步骤7:退购一件商品")
|
||||||
|
GetGoodsInfoList = [GetGoodsInfoResp_01, GetGoodsInfoResp_02]
|
||||||
|
self.ymc.delete_cart_goods(GetGoodsInfoList, LoginData, AddGoodsResp)
|
||||||
|
|
||||||
|
allure.step("步骤8:获取购物车商品信息")
|
||||||
|
self.ymc.get_cart_goods_info([GetGoodsInfoResp_01, GetGoodsInfoResp_02])
|
||||||
|
allure.step("步骤9:请求订单结算")
|
||||||
|
self.ymc.request_order_settlement(LoginData)
|
||||||
|
else:
|
||||||
|
LOGGER.info(f"---商品 {self.goods_inputcode2} 不存在")
|
||||||
|
raise AssertionError(f"---商品 {self.goods_inputcode2} 不存在")
|
||||||
|
else:
|
||||||
|
LOGGER.info(f"---商品 {self.goods_inputcode1} 不存在")
|
||||||
|
raise AssertionError(f"---商品 {self.goods_inputcode1} 不存在")
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
unittest.main(verbosity=2)
|
@ -0,0 +1,61 @@
|
|||||||
|
# !/usr/bin/python
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# @Author:: Arthur Wu
|
||||||
|
# @Description:: 游客转会员登录,加购2个打折商品,退购一个,并结算
|
||||||
|
# @Date:: 2024/11/21
|
||||||
|
import unittest,allure,time
|
||||||
|
from configs.globalObj import LOGGER
|
||||||
|
from YiMao.businessFunc.ClientApiLib import YMClientApi
|
||||||
|
from YiMao.data.WuShangSceneTestData import *
|
||||||
|
|
||||||
|
|
||||||
|
DescName = "Vip012-游客转会员登录,加购2个打折商品,退购一个,并结算"
|
||||||
|
@allure.story(f'[场景测试] {DescName}验证')
|
||||||
|
class Test_CVip012(unittest.TestCase):
|
||||||
|
f'''@Date:: 2024/11/20
|
||||||
|
@Author:: Arthur Wu
|
||||||
|
@Desc::
|
||||||
|
[购物车客户端] {DescName}
|
||||||
|
1、武商测试环境,2个打折商品 inputcode 分别为:
|
||||||
|
'''
|
||||||
|
def setUp(self) -> None:
|
||||||
|
self.timestamp = int(time.time())
|
||||||
|
self.ymc = YMClientApi(ShoppingCartMac)
|
||||||
|
self.vip_phone_num = VIPPhoneNumber
|
||||||
|
self.sale_goods_inputCode = SaleGoodsInputCode # 乐事薯片
|
||||||
|
|
||||||
|
def test_CVip012_ReturnOfDiscountedProducts(self):
|
||||||
|
allure.dynamic.description(f"描述:{DescName}")
|
||||||
|
allure.step("步骤1:session开始")
|
||||||
|
self.ymc.session_start()
|
||||||
|
allure.step("步骤2:匿名登录")
|
||||||
|
Payload01 = {"action": 0, "isAnon": True}
|
||||||
|
LoginData = self.ymc.login_app_v2(Payload01)
|
||||||
|
|
||||||
|
allure.step("步骤3:切换会员登录")
|
||||||
|
Payload02 = {"action": 1, "code": self.vip_phone_num, "isAnon": False}
|
||||||
|
self.ymc.login_app_v2(Payload02)
|
||||||
|
|
||||||
|
'''step1:加购商品x,分别加购x件'''
|
||||||
|
allure.step("步骤3:获取商品1信息")
|
||||||
|
GetGoodsInfoResp_01 = self.ymc.get_goods_info(InputCode=self.sale_goods_inputCode)
|
||||||
|
if GetGoodsInfoResp_01['msg'] != '加购商品不存在':
|
||||||
|
allure.step("步骤4:添加商品1")
|
||||||
|
AddGoodsResp = self.ymc.add_cart_goods(GetGoodsInfoResp_01, 2, LoginData)
|
||||||
|
|
||||||
|
''' step2:随机退购一个商品,并结算 '''
|
||||||
|
allure.step("\n步骤5:退购一件商品")
|
||||||
|
GetGoodsInfoList = [GetGoodsInfoResp_01]
|
||||||
|
self.ymc.delete_cart_goods(GetGoodsInfoList, LoginData, AddGoodsResp)
|
||||||
|
|
||||||
|
allure.step("步骤6:获取购物车商品信息")
|
||||||
|
self.ymc.get_cart_goods_info([GetGoodsInfoResp_01])
|
||||||
|
allure.step("步骤7:请求订单结算")
|
||||||
|
self.ymc.request_order_settlement(LoginData)
|
||||||
|
else:
|
||||||
|
LOGGER.info(f"---商品 {self.sale_goods_inputCode} 不存在")
|
||||||
|
raise AssertionError(f"---商品 {self.sale_goods_inputCode} 不存在")
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
unittest.main(verbosity=2)
|
@ -0,0 +1,88 @@
|
|||||||
|
# !/usr/bin/python
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# @Author:: Arthur Wu
|
||||||
|
# @Description:: 游客转会员登录,加购2个促销白名单商品,退购一个,并结算
|
||||||
|
# @Date:: 2024/11/21
|
||||||
|
import unittest,allure,time
|
||||||
|
from configs.globalObj import LOGGER
|
||||||
|
from YiMao.businessFunc.ClientApiLib import YMClientApi
|
||||||
|
from YiMao.businessFunc.ServiceApiLib import YMServiceApi
|
||||||
|
from YiMao.data.WuShangSceneTestData import *
|
||||||
|
|
||||||
|
|
||||||
|
DescName = "Vip013-游客转会员登录,加购2个促销白名单商品,退购一个,并结算"
|
||||||
|
@allure.story(f'[场景测试] {DescName}验证')
|
||||||
|
class Test_CVip013(unittest.TestCase):
|
||||||
|
f'''@Date:: 2024/11/20
|
||||||
|
@Author:: Arthur Wu
|
||||||
|
@Desc::
|
||||||
|
[购物车客户端] {DescName}
|
||||||
|
1、武商测试环境,促销白名单商品 inputcode 分别为:
|
||||||
|
'''
|
||||||
|
def setUp(self) -> None:
|
||||||
|
self.timestamp = int(time.time())
|
||||||
|
self.ymc = YMClientApi(ShoppingCartMac)
|
||||||
|
self.yms = YMServiceApi()
|
||||||
|
# 促销白名单商品暂未提供
|
||||||
|
self.vip_phone_num = VIPPhoneNumber
|
||||||
|
self.promotional_whitelist_goods = PromotionalWhitelistGoods
|
||||||
|
self.market_and_store_info = {
|
||||||
|
"MarketId": MarketAndStoreDetails["putMarketId"],
|
||||||
|
"StoreId": MarketAndStoreDetails["putStoreId"][0]
|
||||||
|
}
|
||||||
|
|
||||||
|
def test_CVip013_ReturnPromotionWhitelistProducts(self):
|
||||||
|
allure.dynamic.description(f"描述:{DescName}")
|
||||||
|
allure.step("[前置条件]:先调用管理平台接口,将指定商品添加到促销白名单中")
|
||||||
|
pre_respomse = self.yms.add_promotional_product_whitelist(
|
||||||
|
self.promotional_whitelist_goods, self.market_and_store_info
|
||||||
|
)
|
||||||
|
if pre_respomse['data'] is not None:
|
||||||
|
LOGGER.info(f"---商品 {self.promotional_whitelist_goods['GoodsInputcode']} "
|
||||||
|
f"已添加到促销白名单中")
|
||||||
|
allure.step("[业务步骤]:再调用客户端接口,执行加购操作")
|
||||||
|
allure.step("步骤1:session开始")
|
||||||
|
self.ymc.session_start()
|
||||||
|
allure.step("步骤2:匿名登录")
|
||||||
|
Payload01 = {"action": 0, "isAnon": True}
|
||||||
|
LoginData = self.ymc.login_app_v2(Payload01)
|
||||||
|
|
||||||
|
allure.step("步骤3:切换会员登录")
|
||||||
|
Payload02 = {"action": 1, "code": self.vip_phone_num, "isAnon": False}
|
||||||
|
self.ymc.login_app_v2(Payload02)
|
||||||
|
|
||||||
|
'''step1:加购商品x,分别加购x件'''
|
||||||
|
allure.step("步骤3:获取促销白名单商品信息")
|
||||||
|
GoodsInfoData1 = self.ymc.get_goods_info(self.promotional_whitelist_goods["GoodsInputcode"])
|
||||||
|
LOGGER.info(f"---获取的商品信息为:{GoodsInfoData1}")
|
||||||
|
if GoodsInfoData1['data']['weight'] == 0:
|
||||||
|
GoodsInfoData1['data']['weight'] = 300
|
||||||
|
if GoodsInfoData1['msg'] != '加购商品不存在':
|
||||||
|
allure.step("步骤4:加购白名单商品")
|
||||||
|
AddGoodsResp = self.ymc.add_cart_goods(GoodsInfoData1, 1, LoginData)
|
||||||
|
LOGGER.info(f"---加购商品返回结果:{AddGoodsResp}")
|
||||||
|
|
||||||
|
''' step2:随机退购一个商品,并结算 '''
|
||||||
|
allure.step("\n步骤5:退购一件商品")
|
||||||
|
GetGoodsInfoList = [GoodsInfoData1]
|
||||||
|
self.ymc.delete_cart_goods(GetGoodsInfoList, LoginData, AddGoodsResp)
|
||||||
|
|
||||||
|
allure.step("步骤6:获取购物车商品信息")
|
||||||
|
self.ymc.get_cart_goods_info([GoodsInfoData1])
|
||||||
|
allure.step("步骤7:请求订单结算")
|
||||||
|
self.ymc.request_order_settlement(LoginData)
|
||||||
|
else:
|
||||||
|
LOGGER.info(f"---商品 {self.promotional_whitelist_goods["GoodsInputcode"]} 不存在")
|
||||||
|
raise Exception(f"---商品 {self.promotional_whitelist_goods["GoodsInputcode"]} 不存在")
|
||||||
|
|
||||||
|
allure.step("[后置处理]:删除添加的促销白名单商品")
|
||||||
|
self.yms.delete_whitelist_goods()
|
||||||
|
else:
|
||||||
|
LOGGER.info(f"---添加商品 {self.promotional_whitelist_goods['GoodsInputcode']} "
|
||||||
|
f"到促销白名单失败")
|
||||||
|
raise Exception(f"---添加商品 {self.promotional_whitelist_goods['GoodsInputcode']} "
|
||||||
|
f"到促销白名单失败")
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
unittest.main(verbosity=2)
|
@ -0,0 +1,88 @@
|
|||||||
|
# !/usr/bin/python
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# @Author:: Arthur Wu
|
||||||
|
# @Description:: 游客转会员登录,加购2个重量放通商品,退购一个,并结算
|
||||||
|
# @Date:: 2024/11/21
|
||||||
|
import unittest,allure,time
|
||||||
|
from configs.globalObj import LOGGER
|
||||||
|
from YiMao.businessFunc.ClientApiLib import YMClientApi
|
||||||
|
from YiMao.businessFunc.ServiceApiLib import YMServiceApi
|
||||||
|
from YiMao.data.WuShangSceneTestData import *
|
||||||
|
|
||||||
|
|
||||||
|
DescName = "Vip014-游客转会员登录,加购2个重量放通商品,退购一个,并结算"
|
||||||
|
@allure.story(f'[场景测试] {DescName}验证')
|
||||||
|
class Test_CVip014(unittest.TestCase):
|
||||||
|
f'''@Date:: 2024/11/20
|
||||||
|
@Author:: Arthur Wu
|
||||||
|
@Desc::
|
||||||
|
[购物车客户端] {DescName}
|
||||||
|
1、武商测试环境,重量放通白名单商品 inputcode 分别为:
|
||||||
|
'''
|
||||||
|
def setUp(self) -> None:
|
||||||
|
self.timestamp = int(time.time())
|
||||||
|
self.ymc = YMClientApi(ShoppingCartMac)
|
||||||
|
self.yms = YMServiceApi()
|
||||||
|
# 重量放通白名单商品暂未提供
|
||||||
|
self.vip_phone_num = VIPPhoneNumber
|
||||||
|
self.weight_to_whitelist_goods = WeightToWhitelistGoods
|
||||||
|
self.market_and_store_info = {
|
||||||
|
"MarketId": MarketAndStoreDetails["putMarketId"],
|
||||||
|
"StoreId": MarketAndStoreDetails["putStoreId"][0]
|
||||||
|
}
|
||||||
|
|
||||||
|
def test_CVip014_ReturnWeightOfTheProducte(self):
|
||||||
|
allure.dynamic.description(f"描述:{DescName}")
|
||||||
|
allure.step("[前置条件]:先调用管理平台接口,将指定商品添加到重量放通白名单中")
|
||||||
|
pre_respomse = self.yms.add_weight_to_whitelist(
|
||||||
|
self.weight_to_whitelist_goods, self.market_and_store_info
|
||||||
|
)
|
||||||
|
if pre_respomse['data'] is not None:
|
||||||
|
LOGGER.info(f"---商品 {self.weight_to_whitelist_goods['GoodsInputcode']} "
|
||||||
|
f"已添加到重量放通白名单中")
|
||||||
|
''' 2-再调用客户端接口,执行加购操作 '''
|
||||||
|
allure.step("[业务步骤]:再调用客户端接口,执行加购操作")
|
||||||
|
allure.step("步骤1:session开始")
|
||||||
|
self.ymc.session_start()
|
||||||
|
allure.step("步骤2:匿名登录")
|
||||||
|
Payload01 = {"action": 0, "isAnon": True}
|
||||||
|
LoginData = self.ymc.login_app_v2(Payload01)
|
||||||
|
|
||||||
|
allure.step("步骤3:切换会员登录")
|
||||||
|
Payload02 = {"action": 1, "code": self.vip_phone_num, "isAnon": False}
|
||||||
|
self.ymc.login_app_v2(Payload02)
|
||||||
|
|
||||||
|
allure.step("步骤3:获取重量放通白名单商品信息")
|
||||||
|
GoodsInfoData1 = self.ymc.get_goods_info(self.weight_to_whitelist_goods["GoodsInputcode"])
|
||||||
|
LOGGER.info(f"---获取的商品信息为:{GoodsInfoData1}")
|
||||||
|
if GoodsInfoData1['data']['weight'] == 0:
|
||||||
|
GoodsInfoData1['data']['weight'] = 400
|
||||||
|
if GoodsInfoData1['msg'] != '加购商品不存在':
|
||||||
|
allure.step("步骤4:加购白名单商品")
|
||||||
|
AddGoodsResp = self.ymc.add_cart_goods(GoodsInfoData1, 1, LoginData)
|
||||||
|
LOGGER.info(f"---加购商品返回结果:{AddGoodsResp}")
|
||||||
|
|
||||||
|
''' step2:随机退购一个商品,并结算 '''
|
||||||
|
allure.step("\n步骤5:退购一件商品")
|
||||||
|
GetGoodsInfoList = [GoodsInfoData1]
|
||||||
|
self.ymc.delete_cart_goods(GetGoodsInfoList, LoginData, AddGoodsResp)
|
||||||
|
|
||||||
|
allure.step("步骤6:获取购物车商品信息")
|
||||||
|
self.ymc.get_cart_goods_info([GoodsInfoData1])
|
||||||
|
allure.step("步骤7:请求订单结算")
|
||||||
|
self.ymc.request_order_settlement(LoginData)
|
||||||
|
else:
|
||||||
|
LOGGER.info(f"---商品 {self.weight_to_whitelist_goods["GoodsInputcode"]} 不存在")
|
||||||
|
raise Exception(f"---商品 {self.weight_to_whitelist_goods['GoodsInputcode']} 不存在")
|
||||||
|
|
||||||
|
allure.step("[后置处理]:删除添加的重量放通白名单商品")
|
||||||
|
self.yms.delete_weight_whitelist_goods()
|
||||||
|
else:
|
||||||
|
LOGGER.info(f"---添加商品 {self.weight_to_whitelist_goods['GoodsInputcode']} "
|
||||||
|
f"到重量放通白名单失败")
|
||||||
|
raise Exception(f"---添加商品 {self.weight_to_whitelist_goods['GoodsInputcode']} "
|
||||||
|
f"到重量放通白名单失败")
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
unittest.main(verbosity=2)
|
@ -97,8 +97,8 @@ class NotificationModule():
|
|||||||
"Debug": "7aedbee7239870e3e653748a2889d8bf063c61efa9213c7099bd57476066dc86",
|
"Debug": "7aedbee7239870e3e653748a2889d8bf063c61efa9213c7099bd57476066dc86",
|
||||||
"Formal": "80b026022a28166cfc9eebaf8f6a880cc06f56a14b8803e8d67e7fb3cb05844e"
|
"Formal": "80b026022a28166cfc9eebaf8f6a880cc06f56a14b8803e8d67e7fb3cb05844e"
|
||||||
}
|
}
|
||||||
# self.urlInfo = f'https://oapi.dingtalk.com/robot/send?access_token={datainfo["Debug"]}'
|
self.urlInfo = f'https://oapi.dingtalk.com/robot/send?access_token={datainfo["Debug"]}'
|
||||||
self.urlInfo = f'https://oapi.dingtalk.com/robot/send?access_token={datainfo["Formal"]}'
|
# self.urlInfo = f'https://oapi.dingtalk.com/robot/send?access_token={datainfo["Formal"]}'
|
||||||
self.ReportUrl = ProCfgData["ReportsURL"]
|
self.ReportUrl = ProCfgData["ReportsURL"]
|
||||||
self.ExecutionEnvironment = ProCfgData["ExecutionEnv"]
|
self.ExecutionEnvironment = ProCfgData["ExecutionEnv"]
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ class SignatureYM():
|
|||||||
return headers
|
return headers
|
||||||
|
|
||||||
class SignatureYM2():
|
class SignatureYM2():
|
||||||
def __init__(self, Mac= '70:f7:54:07:a6:c0'):
|
def __init__(self, ShoppingCartMac= '70:f7:54:07:a6:c0'):
|
||||||
def __sission_id():
|
def __sission_id():
|
||||||
import random, time
|
import random, time
|
||||||
def generate_24_digit_random_integer():
|
def generate_24_digit_random_integer():
|
||||||
@ -45,7 +45,7 @@ class SignatureYM2():
|
|||||||
random_integer = generate_24_digit_random_integer()
|
random_integer = generate_24_digit_random_integer()
|
||||||
return str(random_integer)
|
return str(random_integer)
|
||||||
self.SessionId = __sission_id()
|
self.SessionId = __sission_id()
|
||||||
self.Mac = Mac
|
self.Mac = ShoppingCartMac
|
||||||
|
|
||||||
def _headers(self):
|
def _headers(self):
|
||||||
headers = {
|
headers = {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user