Arthur-Wu committed this file on 2024-11-21
This commit is contained in:
16
MAIN_YM.py
16
MAIN_YM.py
@ -32,7 +32,23 @@ import time
|
|||||||
# if __name__ == "__main__":
|
# if __name__ == "__main__":
|
||||||
# main()
|
# main()
|
||||||
|
|
||||||
|
''' 加购重量待核验商品
|
||||||
|
1、修改商品信息,将重量全改为0,制造成加购时重量待核验物品
|
||||||
|
https://api.test.yimaogo.com/admin/goods/8690
|
||||||
|
{
|
||||||
|
"id": 8690,
|
||||||
|
"barcode": "6925303796426",
|
||||||
|
"name": "统一茄皇蕃茄牛肉面",
|
||||||
|
"goodsBrand": "统一",
|
||||||
|
"measureProperty": 0,
|
||||||
|
"standardWeight": 0, # 165
|
||||||
|
"minWeight": 0, # 155
|
||||||
|
"maxWeight": 0, # 175
|
||||||
|
"weightSource": 1,
|
||||||
|
"pic": "https://ieemoo-storage.obs.cn-east-3.myhuaweicloud.com/lhpic/6925303796426.jpg"
|
||||||
|
}
|
||||||
|
|
||||||
|
'''
|
||||||
|
|
||||||
|
|
||||||
def print_hi(name):
|
def print_hi(name):
|
||||||
|
50
YiMao/ZeroLib/test_CAnon015_.py
Normal file
50
YiMao/ZeroLib/test_CAnon015_.py
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
# !/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 = "Anon015-匿名加购计件商品,并结算"
|
||||||
|
@allure.story(f'[场景测试] {DescName}验证')
|
||||||
|
class Test_CAnon003(unittest.TestCase):
|
||||||
|
f'''@Date:: 2024/11/15
|
||||||
|
@Author:: Arthur Wu
|
||||||
|
@Desc::
|
||||||
|
[购物车客户端] {DescName}
|
||||||
|
1、武商测试环境,计件商品inputcode为:
|
||||||
|
|
||||||
|
'''
|
||||||
|
def setUp(self) -> None:
|
||||||
|
self.timestamp = int(time.time())
|
||||||
|
self.ymc = YMClientApi(ShoppingCartMac)
|
||||||
|
# 会员有优惠商品暂未提供
|
||||||
|
self.vip_goods_inputcode = VipGoodsInputcode # 统一番茄牛肉面
|
||||||
|
|
||||||
|
def test_CAnon003_AddMemberProductsForPurchase(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:获取商品信息")
|
||||||
|
GoodsInfoData = self.ymc.get_goods_info(self.vip_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.vip_goods_inputcode} 不存在")
|
||||||
|
raise AssertionError(f"商品 {self.vip_goods_inputcode} 不存在")
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
unittest.main(verbosity=2)
|
5
YiMao/ZeroLib/test_CAnon016_.py
Normal file
5
YiMao/ZeroLib/test_CAnon016_.py
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
# !/usr/bin/python
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# @Author:: Arthur Wu
|
||||||
|
# @Description:: 加购计件商品,并退购
|
||||||
|
# @Date:: 2024/11/21
|
5
YiMao/ZeroLib/test_CAnon017_.py
Normal file
5
YiMao/ZeroLib/test_CAnon017_.py
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
# !/usr/bin/python
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# @Author:: Arthur Wu
|
||||||
|
# @Description:: 加购计重商品,并结算
|
||||||
|
# @Date:: 2024/11/21
|
5
YiMao/ZeroLib/test_CAnon018_.py
Normal file
5
YiMao/ZeroLib/test_CAnon018_.py
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
# !/usr/bin/python
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# @Author:: Arthur Wu
|
||||||
|
# @Description:: 加购计重商品,并退购
|
||||||
|
# @Date:: 2024/11/21
|
5
YiMao/ZeroLib/test_CAnon019_.py
Normal file
5
YiMao/ZeroLib/test_CAnon019_.py
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
# !/usr/bin/python
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# @Author:: Arthur Wu
|
||||||
|
# @Description:: 加购1件重量待核验商品,无法结算
|
||||||
|
# @Date:: 2024/11/21
|
5
YiMao/ZeroLib/test_CVip015_.py
Normal file
5
YiMao/ZeroLib/test_CVip015_.py
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
# !/usr/bin/python
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# @Author:: Arthur Wu
|
||||||
|
# @Description:: 加购计件商品,并结算
|
||||||
|
# @Date:: 2024/11/21
|
5
YiMao/ZeroLib/test_CVip016_.py
Normal file
5
YiMao/ZeroLib/test_CVip016_.py
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
# !/usr/bin/python
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# @Author:: Arthur Wu
|
||||||
|
# @Description:: 加购计件商品,并退购
|
||||||
|
# @Date:: 2024/11/21
|
5
YiMao/ZeroLib/test_CVip017_.py
Normal file
5
YiMao/ZeroLib/test_CVip017_.py
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
# !/usr/bin/python
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# @Author:: Arthur Wu
|
||||||
|
# @Description:: 加购计重商品,并结算
|
||||||
|
# @Date:: 2024/11/21
|
5
YiMao/ZeroLib/test_CVip018_.py
Normal file
5
YiMao/ZeroLib/test_CVip018_.py
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
# !/usr/bin/python
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# @Author:: Arthur Wu
|
||||||
|
# @Description:: 加购计重商品,并退购
|
||||||
|
# @Date:: 2024/11/21
|
5
YiMao/ZeroLib/test_CVip019_.py
Normal file
5
YiMao/ZeroLib/test_CVip019_.py
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
# !/usr/bin/python
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# @Author:: Arthur Wu
|
||||||
|
# @Description:: 加购1件重量待核验商品,无法结算
|
||||||
|
# @Date:: 2024/11/21
|
5
YiMao/ZeroLib/test_C_.py
Normal file
5
YiMao/ZeroLib/test_C_.py
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
# !/usr/bin/python
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# @Author:: Arthur Wu
|
||||||
|
# @Description:: 会员登录,领取优惠券
|
||||||
|
# @Date:: 2024/11/21
|
Binary file not shown.
@ -38,3 +38,9 @@ class Common():
|
|||||||
random_integer = generate_24_digit_random_integer()
|
random_integer = generate_24_digit_random_integer()
|
||||||
return random_integer
|
return random_integer
|
||||||
|
|
||||||
|
def return_timestamp(self):
|
||||||
|
timestamp_seconds = time.time()
|
||||||
|
timestamp_milliseconds = int(timestamp_seconds * 1000)
|
||||||
|
return str(timestamp_milliseconds)
|
||||||
|
|
||||||
|
|
||||||
|
@ -94,11 +94,12 @@ class NotificationModule():
|
|||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.__headers = {'Content-Type': 'application/json;charset=utf-8'}
|
self.__headers = {'Content-Type': 'application/json;charset=utf-8'}
|
||||||
datainfo = {
|
datainfo = {
|
||||||
|
"Domain": "https://oapi.dingtalk.com/robot/send?access_token=",
|
||||||
"Debug": "7aedbee7239870e3e653748a2889d8bf063c61efa9213c7099bd57476066dc86",
|
"Debug": "7aedbee7239870e3e653748a2889d8bf063c61efa9213c7099bd57476066dc86",
|
||||||
"Formal": "80b026022a28166cfc9eebaf8f6a880cc06f56a14b8803e8d67e7fb3cb05844e"
|
"Formal": "80b026022a28166cfc9eebaf8f6a880cc06f56a14b8803e8d67e7fb3cb05844e"
|
||||||
}
|
}
|
||||||
self.urlInfo = f'https://oapi.dingtalk.com/robot/send?access_token={datainfo["Debug"]}'
|
# self.urlInfo = datainfo["Domain"] + datainfo["Debug"]
|
||||||
# self.urlInfo = f'https://oapi.dingtalk.com/robot/send?access_token={datainfo["Formal"]}'
|
self.urlInfo = datainfo["Domain"] + datainfo["Formal"]
|
||||||
self.ReportUrl = ProCfgData["ReportsURL"]
|
self.ReportUrl = ProCfgData["ReportsURL"]
|
||||||
self.ExecutionEnvironment = ProCfgData["ExecutionEnv"]
|
self.ExecutionEnvironment = ProCfgData["ExecutionEnv"]
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user