diff --git a/YiMao/businessFunc/ClientApiLib.py b/YiMao/businessFunc/ClientApiLib.py index f985b88..e9c673f 100644 --- a/YiMao/businessFunc/ClientApiLib.py +++ b/YiMao/businessFunc/ClientApiLib.py @@ -63,13 +63,13 @@ class YMClientApi(object): logging.info(f"-----------接口返回数据:{response.json()}\n\n") return response.json() - def add_retire_purchase(self, GoodsInfoData, LoginData): + def add_retire_purchase(self, GoodsInfoData, AddPurchaseQuantity, LoginData): logging.info("========== [加入购物车] add_retire_purchase ==========") payload = json.dumps({ "addGoods":[{ "inputCode": GoodsInfoData["data"]["inputCode"], "isNormalAddPurchase": True, - "qty": GoodsInfoData["data"]["qty"], + "qty": int(AddPurchaseQuantity), # AddPurchaseQuantity,GoodsInfoData["data"]["qty"] "weight": int(GoodsInfoData["data"]["weight"]), }], "autoSelectCoupon": True, @@ -146,11 +146,8 @@ class YMClientApi(object): POST https://api.test.yimaogo.com/cart/v2/shopping/add/retire/purchase - payload = {"addGoods":[{"inputCode":"6942728414063","isNormalAddPurchase":true,"qty":1,"weight":0}],"autoSelectCoupon":true,"coupons":[],"deleteGoods":[],"existGoods":[],"orderNo":"1857003957307801600"} ''' - - ''' 2- without sessionid ''' def get_ads_list(self): logging.info("========== [获取广告列表] get_ads_list ==========") @@ -174,25 +171,23 @@ class YMClientApi(object): return response.json() - - - if __name__ == '__main__': - ym = YMClientApi() + ymc = YMClientApi() ''' 01- ''' - ym.session_start() # step1:session开始 + ymc.session_start() # step1:session开始 Payload01 = {"action": 0, "isAnon": True} - LoginData = ym.login_app_v2(Payload01) # step2:匿名登录 - ym.get_login_type() # step3:获取登录方式 + LoginData = ymc.login_app_v2(Payload01) # step2:匿名登录 + + ymc.get_login_type() # step3:获取登录方式 Payload02 = {"action": 1, "code": "18052753212", "isAnon": False} - ym.login_app_v2(Payload02) # step4:切换会员登录 - GoodsInfoData = ym.get_goods_info(InputCode=6924882486100) # step5:获取商品信息 - CouponListData = ym.get_coupon_list() # step6:获取优惠券列表 - ym.receive_coupon(CouponListData) # step7:领取优惠券 - ym.query_coupon_list_user() # step8:查询用户持有的优惠券列表 - ym.add_retire_purchase(GoodsInfoData, LoginData) # step9:加购商品 - ym.get_cart_goods_info(GoodsInfoData) # step10:获取购物车商品信息 - ym.request_order_settlement(LoginData) # step11:请求订单结算 + ymc.login_app_v2(Payload02) # step4:切换会员登录 + GoodsInfoData = ymc.get_goods_info(InputCode=6924882486100) # step5:获取商品信息 ------ 6924882486100 + CouponListData = ymc.get_coupon_list() # step6:获取优惠券列表 + ymc.receive_coupon(CouponListData) # step7:领取优惠券 + ymc.query_coupon_list_user() # step8:查询用户持有的优惠券列表 + ymc.add_retire_purchase(GoodsInfoData, 1, LoginData) # step9:加购商品 ------ 6924882486100 + ymc.get_cart_goods_info(GoodsInfoData) # step10:获取购物车商品信息 + ymc.request_order_settlement(LoginData) # step11:请求订单结算 - ym.session_end() + ymc.session_end() diff --git a/YiMao/data/前后端联测业务场景梳理.xlsx b/YiMao/data/前后端联测业务场景梳理.xlsx index 863598c..fdbc83a 100644 Binary files a/YiMao/data/前后端联测业务场景梳理.xlsx and b/YiMao/data/前后端联测业务场景梳理.xlsx differ diff --git a/YiMao/debugLib/demo1024.py b/YiMao/debugLib/demo1024.py index e69de29..3f2ff2d 100644 --- a/YiMao/debugLib/demo1024.py +++ b/YiMao/debugLib/demo1024.py @@ -0,0 +1,5 @@ + + + + + diff --git a/YiMao/debugLib/test_C005_NonVipAddMultipleItemsForPurchase.py b/YiMao/debugLib/test_C005_NonVipAddMultipleItemsForPurchase.py new file mode 100644 index 0000000..fb5a0bf --- /dev/null +++ b/YiMao/debugLib/test_C005_NonVipAddMultipleItemsForPurchase.py @@ -0,0 +1,5 @@ +# !/usr/bin/python +# -*- coding: utf-8 -*- +# @Author:: Arthur Wu +# @Description:: 游客登录,加购多件商品,并结算 +# @Date:: 2021-05-10 16:30:23 \ No newline at end of file diff --git a/YiMao/debugLib/test_C006_NonVipAddDiscountedProductsForPurchase.py b/YiMao/debugLib/test_C006_NonVipAddDiscountedProductsForPurchase.py new file mode 100644 index 0000000..716cc90 --- /dev/null +++ b/YiMao/debugLib/test_C006_NonVipAddDiscountedProductsForPurchase.py @@ -0,0 +1,5 @@ +# !/usr/bin/python +# -*- coding: utf-8 -*- +# @Author:: Arthur Wu +# @Description:: 游客登录,加购打折商品,并结算 +# @Date:: 2021-05-10 16:30:22 \ No newline at end of file diff --git a/YiMao/debugLib/test_C007_NonVipAddPromotionalWhitelistProducts.py b/YiMao/debugLib/test_C007_NonVipAddPromotionalWhitelistProducts.py new file mode 100644 index 0000000..38bebae --- /dev/null +++ b/YiMao/debugLib/test_C007_NonVipAddPromotionalWhitelistProducts.py @@ -0,0 +1,5 @@ +# !/usr/bin/python +# -*- coding: utf-8 -*- +# @Author:: Arthur Wu +# @Description:: 游客登录,加购促销白名单商品,并结算 +# @Date:: 2021-05-10 16:30:23 \ No newline at end of file diff --git a/YiMao/debugLib/test_C008_NonVipAddWeightToTheProduct.py b/YiMao/debugLib/test_C008_NonVipAddWeightToTheProduct.py new file mode 100644 index 0000000..29ee56c --- /dev/null +++ b/YiMao/debugLib/test_C008_NonVipAddWeightToTheProduct.py @@ -0,0 +1,5 @@ +# !/usr/bin/python +# -*- coding: utf-8 -*- +# @Author:: Arthur Wu +# @Description:: 游客登录,加购重量放通商品,并结算 +# @Date:: 2021-05-10 16:30:22 diff --git a/YiMao/debugLib/test_C009_NonVipReturnShoppingBag.py b/YiMao/debugLib/test_C009_NonVipReturnShoppingBag.py new file mode 100644 index 0000000..4b646dc --- /dev/null +++ b/YiMao/debugLib/test_C009_NonVipReturnShoppingBag.py @@ -0,0 +1,5 @@ +# !/usr/bin/python +# -*- coding: utf-8 -*- +# @Author:: Arthur Wu +# @Description:: 游客登录,加购2个购物袋,退购一个购物袋,并结算 +# @Date:: 2021-05-10 16:30:22 \ No newline at end of file diff --git a/YiMao/debugLib/test_C010_NonVipReturnPurchaseOfOrdinaryGoods.py b/YiMao/debugLib/test_C010_NonVipReturnPurchaseOfOrdinaryGoods.py new file mode 100644 index 0000000..b817180 --- /dev/null +++ b/YiMao/debugLib/test_C010_NonVipReturnPurchaseOfOrdinaryGoods.py @@ -0,0 +1,5 @@ +# !/usr/bin/python +# -*- coding: utf-8 -*- +# @Author:: Arthur Wu +# @Description:: 游客登录,加购2个普通商品,退购一个,并结算 +# @Date:: 2021-05-10 16:00:00 \ No newline at end of file diff --git a/YiMao/debugLib/test_C011_NonVipReturnOfMemberProducts.py b/YiMao/debugLib/test_C011_NonVipReturnOfMemberProducts.py new file mode 100644 index 0000000..fe2f087 --- /dev/null +++ b/YiMao/debugLib/test_C011_NonVipReturnOfMemberProducts.py @@ -0,0 +1,5 @@ +# !/usr/bin/python +# -*- coding: utf-8 -*- +# @Author:: Arthur Wu +# @Description:: 游客登录,加购2个会员商品,退购一个,并结算 +# @Date:: 2021-05-10 16:27:22 \ No newline at end of file diff --git a/YiMao/debugLib/test_C012_NonVipReturnOneItemFromMultiplePurchases.py b/YiMao/debugLib/test_C012_NonVipReturnOneItemFromMultiplePurchases.py new file mode 100644 index 0000000..ecccd0c --- /dev/null +++ b/YiMao/debugLib/test_C012_NonVipReturnOneItemFromMultiplePurchases.py @@ -0,0 +1,5 @@ +# !/usr/bin/python +# -*- coding: utf-8 -*- +# @Author:: Arthur Wu +# @Description:: 游客登录,加购多件商品,退购一个商品,并结算 +# @Date:: 2021-05-10 16:30:23 \ No newline at end of file diff --git a/YiMao/debugLib/test_C013_NonVipReturnOfDiscountedProducts.py b/YiMao/debugLib/test_C013_NonVipReturnOfDiscountedProducts.py new file mode 100644 index 0000000..aa8ca93 --- /dev/null +++ b/YiMao/debugLib/test_C013_NonVipReturnOfDiscountedProducts.py @@ -0,0 +1,5 @@ +# !/usr/bin/python +# -*- coding: utf-8 -*- +# @Author:: Arthur Wu +# @Description:: 游客登录,加购2个打折商品,退购一个,并结算 +# @Date:: 2021-05-10 16:30:22 \ No newline at end of file diff --git a/YiMao/debugLib/test_C014_NonVipReturnPromotionWhitelistProducts.py b/YiMao/debugLib/test_C014_NonVipReturnPromotionWhitelistProducts.py new file mode 100644 index 0000000..a48ea72 --- /dev/null +++ b/YiMao/debugLib/test_C014_NonVipReturnPromotionWhitelistProducts.py @@ -0,0 +1,5 @@ +# !/usr/bin/python +# -*- coding: utf-8 -*- +# @Author:: Arthur Wu +# @Description:: 游客登录,加购2个促销白名单商品,退购一个,并结算 +# @Date:: 2021-05-10 16:00:00 \ No newline at end of file diff --git a/YiMao/debugLib/test_C015_NonVipReturnWeightOfTheProducte.py b/YiMao/debugLib/test_C015_NonVipReturnWeightOfTheProducte.py new file mode 100644 index 0000000..2a1ed59 --- /dev/null +++ b/YiMao/debugLib/test_C015_NonVipReturnWeightOfTheProducte.py @@ -0,0 +1,5 @@ +# !/usr/bin/python +# -*- coding: utf-8 -*- +# @Author:: Arthur Wu +# @Description:: 游客登录,加购2个重量放通商品,退购一个,并结算 +# @Date:: 2021/04/01 16:00:00 \ No newline at end of file diff --git a/YiMao/debugLib/test_C016_NonToVipAddShoppingBagAndSettlePayment.py b/YiMao/debugLib/test_C016_NonToVipAddShoppingBagAndSettlePayment.py new file mode 100644 index 0000000..a9cbeed --- /dev/null +++ b/YiMao/debugLib/test_C016_NonToVipAddShoppingBagAndSettlePayment.py @@ -0,0 +1,5 @@ +# !/usr/bin/python +# -*- coding: utf-8 -*- +# @Author:: Arthur Wu +# @Description:: 游客转会员登录,加购购物袋,并结算 +# @Date:: 2021-05-10 16:30:22 \ No newline at end of file diff --git a/YiMao/debugLib/test_C017_NonToVipAddNonDiscountedProductsForPurchase.py b/YiMao/debugLib/test_C017_NonToVipAddNonDiscountedProductsForPurchase.py new file mode 100644 index 0000000..8fb87f6 --- /dev/null +++ b/YiMao/debugLib/test_C017_NonToVipAddNonDiscountedProductsForPurchase.py @@ -0,0 +1,4 @@ +# !/usr/bin/python +# -*- coding: utf-8 -*- +# @Author:: Arthur Wu +# @Description:: 游客转会员登录,加购普通商品,并结算 diff --git a/YiMao/debugLib/test_C018_NonToVipAddMemberPproductsForPurchase.py b/YiMao/debugLib/test_C018_NonToVipAddMemberPproductsForPurchase.py new file mode 100644 index 0000000..03495cd --- /dev/null +++ b/YiMao/debugLib/test_C018_NonToVipAddMemberPproductsForPurchase.py @@ -0,0 +1,5 @@ +# !/usr/bin/python +# -*- coding: utf-8 -*- +# @Author:: Arthur Wu +# @Description:: 游客转会员登录,加购会员商品,并结算 +# @Date:: 2021-05-10 16:30:23 \ No newline at end of file diff --git a/YiMao/debugLib/test_C019_NonToVipAddMultipleItemsForPurchase.py b/YiMao/debugLib/test_C019_NonToVipAddMultipleItemsForPurchase.py new file mode 100644 index 0000000..e3a45b7 --- /dev/null +++ b/YiMao/debugLib/test_C019_NonToVipAddMultipleItemsForPurchase.py @@ -0,0 +1,5 @@ +# !/usr/bin/python +# -*- coding: utf-8 -*- +# @Author:: Arthur Wu +# @Description:: 游客转会员登录,加购多件商品,并结算 +# @Date:: 2021-05-10 16:30:23 \ No newline at end of file diff --git a/YiMao/debugLib/test_C020_NonToVipAddDiscountedProductsForPurchase.py b/YiMao/debugLib/test_C020_NonToVipAddDiscountedProductsForPurchase.py new file mode 100644 index 0000000..af743ee --- /dev/null +++ b/YiMao/debugLib/test_C020_NonToVipAddDiscountedProductsForPurchase.py @@ -0,0 +1,5 @@ +# !/usr/bin/python +# -*- coding: utf-8 -*- +# @Author:: Arthur Wu +# @Description:: 游客转会员登录,加购打折商品,并结算 +# @Date:: 2021-05-10 16:30:23 \ No newline at end of file diff --git a/YiMao/debugLib/test_C021_NonToVipAddPromotionalWhitelistProducts.py b/YiMao/debugLib/test_C021_NonToVipAddPromotionalWhitelistProducts.py new file mode 100644 index 0000000..a594839 --- /dev/null +++ b/YiMao/debugLib/test_C021_NonToVipAddPromotionalWhitelistProducts.py @@ -0,0 +1,5 @@ +# !/usr/bin/python +# -*- coding: utf-8 -*- +# @Author:: Arthur Wu +# @Description:: 游客转会员登录,加购促销白名单商品,并结算 +# @Date:: 2021-05-10 16:30:22 \ No newline at end of file diff --git a/YiMao/debugLib/test_C022_NonToVipAddWeightToTheProduct.py b/YiMao/debugLib/test_C022_NonToVipAddWeightToTheProduct.py new file mode 100644 index 0000000..8b23613 --- /dev/null +++ b/YiMao/debugLib/test_C022_NonToVipAddWeightToTheProduct.py @@ -0,0 +1,4 @@ +# !/usr/bin/python +# -*- coding: utf-8 -*- +# @Author:: Arthur Wu +# @Description:: 游客转会员登录,加购重量放通商品,并结算 diff --git a/YiMao/debugLib/test_C023_NonToVipReturnShoppingBag.py b/YiMao/debugLib/test_C023_NonToVipReturnShoppingBag.py new file mode 100644 index 0000000..d7dd3a1 --- /dev/null +++ b/YiMao/debugLib/test_C023_NonToVipReturnShoppingBag.py @@ -0,0 +1,5 @@ +# !/usr/bin/python +# -*- coding: utf-8 -*- +# @Author:: Arthur Wu +# @Description:: 游客转会员登录,加购2个购物袋,退购一个购物袋,并结算 +# @Date:: 2021-05-10 15:30:27 \ No newline at end of file diff --git a/YiMao/debugLib/test_C024_NonToVipReturnPurchaseOfOrdinaryGoods.py b/YiMao/debugLib/test_C024_NonToVipReturnPurchaseOfOrdinaryGoods.py new file mode 100644 index 0000000..991c74c --- /dev/null +++ b/YiMao/debugLib/test_C024_NonToVipReturnPurchaseOfOrdinaryGoods.py @@ -0,0 +1,5 @@ +# !/usr/bin/python +# -*- coding: utf-8 -*- +# @Author:: Arthur Wu +# @Description:: 游客转会员登录,加购2个普通商品,退购一个,并结算 +# @Date:: 2021-05-10 15:30:27 \ No newline at end of file diff --git a/YiMao/debugLib/test_C025_NonToVipReturnOfMemberProducts.py b/YiMao/debugLib/test_C025_NonToVipReturnOfMemberProducts.py new file mode 100644 index 0000000..906b215 --- /dev/null +++ b/YiMao/debugLib/test_C025_NonToVipReturnOfMemberProducts.py @@ -0,0 +1,5 @@ +# !/usr/bin/python +# -*- coding: utf-8 -*- +# @Author:: Arthur Wu +# @Description:: 游客转会员登录,加购2个会员商品,退购一个,并结算 +# @Date:: 2021-05-10 15:30:27 \ No newline at end of file diff --git a/YiMao/debugLib/test_C026_NonToVipReturnOneItemFromMultiplePurchases.py b/YiMao/debugLib/test_C026_NonToVipReturnOneItemFromMultiplePurchases.py new file mode 100644 index 0000000..2eb1ab1 --- /dev/null +++ b/YiMao/debugLib/test_C026_NonToVipReturnOneItemFromMultiplePurchases.py @@ -0,0 +1,4 @@ +# !/usr/bin/python +# -*- coding: utf-8 -*- +# @Author:: Arthur Wu +# @Description:: 游客转会员登录,加购多件商品,退购一个商品,并结算 diff --git a/YiMao/debugLib/test_C027_NonToVipReturnOfDiscountedProducts.py b/YiMao/debugLib/test_C027_NonToVipReturnOfDiscountedProducts.py new file mode 100644 index 0000000..022df6a --- /dev/null +++ b/YiMao/debugLib/test_C027_NonToVipReturnOfDiscountedProducts.py @@ -0,0 +1,5 @@ +# !/usr/bin/python +# -*- coding: utf-8 -*- +# @Author:: Arthur Wu +# @Description:: 游客转会员登录,加购2个打折商品,退购一个,并结算 +# @Date:: 2021-05-10 15:30:22 \ No newline at end of file diff --git a/YiMao/debugLib/test_C028_NonToVipReturnPromotionWhitelistProducts.py b/YiMao/debugLib/test_C028_NonToVipReturnPromotionWhitelistProducts.py new file mode 100644 index 0000000..d32cd06 --- /dev/null +++ b/YiMao/debugLib/test_C028_NonToVipReturnPromotionWhitelistProducts.py @@ -0,0 +1,5 @@ +# !/usr/bin/python +# -*- coding: utf-8 -*- +# @Author:: Arthur Wu +# @Description:: 游客转会员登录,加购2个促销白名单商品,退购一个,并结算 +# @Date:: 2021-05-10 16:30:22 \ No newline at end of file diff --git a/YiMao/debugLib/test_C029_NonToVipReturnWeightOfTheProducte.py b/YiMao/debugLib/test_C029_NonToVipReturnWeightOfTheProducte.py new file mode 100644 index 0000000..ff4fdb5 --- /dev/null +++ b/YiMao/debugLib/test_C029_NonToVipReturnWeightOfTheProducte.py @@ -0,0 +1,5 @@ +# !/usr/bin/python +# -*- coding: utf-8 -*- +# @Author:: Arthur Wu +# @Description:: 游客转会员登录,加购2个重量放通商品,退购一个,并结算 +# @Date:: 2021-05-10 15:30:23 \ No newline at end of file diff --git a/YiMao/debugLib/test_C030_VipReceiveCoupon.py b/YiMao/debugLib/test_C030_VipReceiveCoupon.py new file mode 100644 index 0000000..a3566fc --- /dev/null +++ b/YiMao/debugLib/test_C030_VipReceiveCoupon.py @@ -0,0 +1,4 @@ +# !/usr/bin/python +# -*- coding: utf-8 -*- +# @Author:: Arthur Wu +# @Description:: 会员登录,领取优惠券 diff --git a/YiMao/debugLib/test_C032_VipAddNonDiscountedProductsForPurchase.py b/YiMao/debugLib/test_C032_VipAddNonDiscountedProductsForPurchase.py new file mode 100644 index 0000000..fedd8ed --- /dev/null +++ b/YiMao/debugLib/test_C032_VipAddNonDiscountedProductsForPurchase.py @@ -0,0 +1,5 @@ +# !/usr/bin/python +# -*- coding: utf-8 -*- +# @Author:: Arthur Wu +# @Description:: 会员登录,加购普通商品,并结算 +# @Date:: 2021-05-10 15:30:22 \ No newline at end of file diff --git a/YiMao/debugLib/test_C033_VipAddMemberPproductsForPurchase.py b/YiMao/debugLib/test_C033_VipAddMemberPproductsForPurchase.py new file mode 100644 index 0000000..0b43c46 --- /dev/null +++ b/YiMao/debugLib/test_C033_VipAddMemberPproductsForPurchase.py @@ -0,0 +1,4 @@ +# !/usr/bin/python +# -*- coding: utf-8 -*- +# @Author:: Arthur Wu +# @Description:: 会员登录,加购会员商品,并结算 diff --git a/YiMao/debugLib/test_C034_VipAddMultipleItemsForPurchase.py b/YiMao/debugLib/test_C034_VipAddMultipleItemsForPurchase.py new file mode 100644 index 0000000..eae4066 --- /dev/null +++ b/YiMao/debugLib/test_C034_VipAddMultipleItemsForPurchase.py @@ -0,0 +1,5 @@ +# !/usr/bin/python +# -*- coding: utf-8 -*- +# @Author:: Arthur Wu +# @Description:: 会员登录,加购多件商品,并结算 +# @Date:: 2021-05-10 15:40:32 \ No newline at end of file diff --git a/YiMao/debugLib/test_C035_VipAddDiscountedProductsForPurchase.py b/YiMao/debugLib/test_C035_VipAddDiscountedProductsForPurchase.py new file mode 100644 index 0000000..7432edc --- /dev/null +++ b/YiMao/debugLib/test_C035_VipAddDiscountedProductsForPurchase.py @@ -0,0 +1,5 @@ +# !/usr/bin/python +# -*- coding: utf-8 -*- +# @Author:: Arthur Wu +# @Description:: 会员登录,加购打折商品,并结算 +# @Date:: 2021-05-10 16:00:00 \ No newline at end of file diff --git a/YiMao/debugLib/test_C036_VipAddPromotionalWhitelistProducts.py b/YiMao/debugLib/test_C036_VipAddPromotionalWhitelistProducts.py new file mode 100644 index 0000000..9fcb271 --- /dev/null +++ b/YiMao/debugLib/test_C036_VipAddPromotionalWhitelistProducts.py @@ -0,0 +1,5 @@ +# !/usr/bin/python +# -*- coding: utf-8 -*- +# @Author:: Arthur Wu +# @Description:: 会员登录,加购促销白名单商品,并结算 +# @Date:: 2021-05-10 16:30:22 \ No newline at end of file diff --git a/YiMao/debugLib/test_C037_VipAddWeightToTheProduct.py b/YiMao/debugLib/test_C037_VipAddWeightToTheProduct.py new file mode 100644 index 0000000..f3167ef --- /dev/null +++ b/YiMao/debugLib/test_C037_VipAddWeightToTheProduct.py @@ -0,0 +1,5 @@ +# !/usr/bin/python +# -*- coding: utf-8 -*- +# @Author:: Arthur Wu +# @Description:: 会员登录,加购重量放通商品,并结算 +# @Date:: 2021-05-10 15:30:22 \ No newline at end of file diff --git a/YiMao/debugLib/test_C038_VipReturnShoppingBag.py b/YiMao/debugLib/test_C038_VipReturnShoppingBag.py new file mode 100644 index 0000000..99cba91 --- /dev/null +++ b/YiMao/debugLib/test_C038_VipReturnShoppingBag.py @@ -0,0 +1,5 @@ +# !/usr/bin/python +# -*- coding: utf-8 -*- +# @Author:: Arthur Wu +# @Description:: 会员登录,加购2个购物袋,退购一个购物袋,并结算 +# @Date:: 2021-05-20 15:30:23 \ No newline at end of file diff --git a/YiMao/debugLib/test_C039_VipReturnPurchaseOfOrdinaryGoods.py b/YiMao/debugLib/test_C039_VipReturnPurchaseOfOrdinaryGoods.py new file mode 100644 index 0000000..ea456e8 --- /dev/null +++ b/YiMao/debugLib/test_C039_VipReturnPurchaseOfOrdinaryGoods.py @@ -0,0 +1,5 @@ +# !/usr/bin/python +# -*- coding: utf-8 -*- +# @Author:: Arthur Wu +# @Description:: 会员登录,加购2个普通商品,退购一个,并结算 +# @Date:: 2021-05-10 15:30:22 \ No newline at end of file diff --git a/YiMao/debugLib/test_C040_VipReturnOfMemberProducts.py b/YiMao/debugLib/test_C040_VipReturnOfMemberProducts.py new file mode 100644 index 0000000..b3c029d --- /dev/null +++ b/YiMao/debugLib/test_C040_VipReturnOfMemberProducts.py @@ -0,0 +1,5 @@ +# !/usr/bin/python +# -*- coding: utf-8 -*- +# @Author:: Arthur Wu +# @Description:: 会员登录,加购2个会员商品,退购一个,并结算 +# @Date:: 2021-05-10 16:30:23 \ No newline at end of file diff --git a/YiMao/debugLib/test_C041_VipReturnOneItemFromMultiplePurchases.py b/YiMao/debugLib/test_C041_VipReturnOneItemFromMultiplePurchases.py new file mode 100644 index 0000000..794925c --- /dev/null +++ b/YiMao/debugLib/test_C041_VipReturnOneItemFromMultiplePurchases.py @@ -0,0 +1,4 @@ +# !/usr/bin/python +# -*- coding: utf-8 -*- +# @Author:: Arthur Wu +# @Description:: 会员登录,加购多件商品,退购一个商品,并结算 diff --git a/YiMao/debugLib/test_C042_VipReturnOfDiscountedProducts.py b/YiMao/debugLib/test_C042_VipReturnOfDiscountedProducts.py new file mode 100644 index 0000000..8cef511 --- /dev/null +++ b/YiMao/debugLib/test_C042_VipReturnOfDiscountedProducts.py @@ -0,0 +1,5 @@ +# !/usr/bin/python +# -*- coding: utf-8 -*- +# @Author:: Arthur Wu +# @Description:: 会员登录,加购2个打折商品,退购一个,并结算 +# @Date:: 2021-05-10 15:30:22 \ No newline at end of file diff --git a/YiMao/debugLib/test_C043_VipReturnPromotionWhitelistProducts.py b/YiMao/debugLib/test_C043_VipReturnPromotionWhitelistProducts.py new file mode 100644 index 0000000..1904a64 --- /dev/null +++ b/YiMao/debugLib/test_C043_VipReturnPromotionWhitelistProducts.py @@ -0,0 +1,5 @@ +# !/usr/bin/python +# -*- coding: utf-8 -*- +# @Author:: Arthur Wu +# @Description:: 会员登录,加购2个促销白名单商品,退购一个,并结算 +# @Date:: 2021-05-10 16:30:23 \ No newline at end of file diff --git a/YiMao/debugLib/test_C044_VipReturnWeightOfTheProducte.py b/YiMao/debugLib/test_C044_VipReturnWeightOfTheProducte.py new file mode 100644 index 0000000..bff8733 --- /dev/null +++ b/YiMao/debugLib/test_C044_VipReturnWeightOfTheProducte.py @@ -0,0 +1,5 @@ +# !/usr/bin/python +# -*- coding: utf-8 -*- +# @Author:: Arthur Wu +# @Description:: 会员登录,加购2个重量放通商品,退购一个,并结算 +# @Date:: 2021-05-10 16:30:22 \ No newline at end of file diff --git a/YiMao/scripts/BusiScenarios/__init__.py b/YiMao/scripts/BusiScenarios/__init__.py new file mode 100644 index 0000000..337dfe6 --- /dev/null +++ b/YiMao/scripts/BusiScenarios/__init__.py @@ -0,0 +1,5 @@ +# !/usr/bin/python +# -*- coding: utf-8 -*- +# @Author:: Arthur Wu +# @Date:: 2024/11/18-11:49 +# @Description:: diff --git a/YiMao/scripts/BusiScenarios/test_C002_AddShoppingBagAndSettlePayment.py b/YiMao/scripts/BusiScenarios/test_C002_AddShoppingBagAndSettlePayment.py new file mode 100644 index 0000000..689698a --- /dev/null +++ b/YiMao/scripts/BusiScenarios/test_C002_AddShoppingBagAndSettlePayment.py @@ -0,0 +1,59 @@ +# !/usr/bin/python +# -*- coding: utf-8 -*- +# @Author:: Arthur Wu +# @Date:: 2024/11/18-9:38 +# @Description:: +import unittest,allure,time +from configs.globalObj import LOGGER +from YiMao.businessFunc.ClientApiLib import YMClientApi + + +class Test_C002_AddShoppingBagAndSettlePayment(unittest.TestCase): + '''@Date:: 2024/11/15 + @Author:: Arthur Wu + @Desc:: + [购物车客户端] 加购购物袋并试算验证 + 1、武商测试环境,购物袋inputcode为: + 6971648922990、6971648922983 + ''' + def setUp(self) -> None: + self.timestamp = int(time.time()) + self.ymc = YMClientApi() + + @allure.story('[购物车客户端] 加购购物袋并试算验证-01') + def test_C00201_AddShoppingBagAndSettlePayment(self): + allure.dynamic.description("描述:加购中号购物袋") + 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(InputCode=6971648922990) + allure.step("步骤4:添加购物袋") + self.ymc.add_retire_purchase(GoodsInfoData, 2, LoginData) + allure.step("步骤5:获取购物车商品信息") + self.ymc.get_cart_goods_info(GoodsInfoData) + allure.step("步骤6:请求订单结算") + self.ymc.request_order_settlement(LoginData) + + @allure.story('[购物车客户端] 加购购物袋并试算验证-02') + def test_C00202_AddShoppingBagAndSettlePayment(self): + allure.dynamic.description("描述:加购大号购物袋") + 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(InputCode=6971648922983) + allure.step("步骤4:添加购物袋") + self.ymc.add_retire_purchase(GoodsInfoData, 2, LoginData) + allure.step("步骤5:获取购物车商品信息") + self.ymc.get_cart_goods_info(GoodsInfoData) + allure.step("步骤6:请求订单结算") + self.ymc.request_order_settlement(LoginData) + + +if __name__ == '__main__': + unittest.main(verbosity=2) \ No newline at end of file diff --git a/YiMao/scripts/BusiScenarios/test_C003_NonVipAddNonDiscountedProductsForPurchase.py b/YiMao/scripts/BusiScenarios/test_C003_NonVipAddNonDiscountedProductsForPurchase.py new file mode 100644 index 0000000..75cd414 --- /dev/null +++ b/YiMao/scripts/BusiScenarios/test_C003_NonVipAddNonDiscountedProductsForPurchase.py @@ -0,0 +1,42 @@ +# !/usr/bin/python +# -*- coding: utf-8 -*- +# @Author:: Arthur Wu +# @Date:: 2024/11/18-10:49 +# @Description:: +import unittest,allure,time +from configs.globalObj import LOGGER +from YiMao.businessFunc.ClientApiLib import YMClientApi + + +class Test_C002_AddShoppingBagAndSettlePayment(unittest.TestCase): + '''@Date:: 2024/11/15 + @Author:: Arthur Wu + @Desc:: + [购物车客户端] 加购无优惠商品并试算验证 + 1、武商测试环境,普通无优惠商品inputcode为: + 6924743915848 + ''' + def setUp(self) -> None: + self.timestamp = int(time.time()) + self.ymc = YMClientApi() + + @allure.story('[购物车客户端] 加购无优惠商品并试算验证-01') + def test_C00201_AddShoppingBagAndSettlePayment(self): + allure.dynamic.description("描述:加购无优惠商品") + 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(InputCode=6924743915848) + allure.step("步骤4:添加无优惠商品") + self.ymc.add_retire_purchase(GoodsInfoData, 5, LoginData) + allure.step("步骤5:获取购物车商品信息") + self.ymc.get_cart_goods_info(GoodsInfoData) + allure.step("步骤6:请求订单结算") + self.ymc.request_order_settlement(LoginData) + + +if __name__ == '__main__': + unittest.main(verbosity=2) \ No newline at end of file diff --git a/YiMao/scripts/BusiScenarios/test_C004_NonVipAddMemberPproductsForPurchase.py b/YiMao/scripts/BusiScenarios/test_C004_NonVipAddMemberPproductsForPurchase.py new file mode 100644 index 0000000..a1d98c0 --- /dev/null +++ b/YiMao/scripts/BusiScenarios/test_C004_NonVipAddMemberPproductsForPurchase.py @@ -0,0 +1,5 @@ +# !/usr/bin/python +# -*- coding: utf-8 -*- +# @Author:: Arthur Wu +# @Description:: 游客登录,加购会员商品,并结算 +# @Date:: 2021-05-10 16:30:23 \ No newline at end of file diff --git a/commons/EngineX.py b/commons/EngineX.py index e004a5c..5c98b39 100644 --- a/commons/EngineX.py +++ b/commons/EngineX.py @@ -84,8 +84,8 @@ class Engine(): indexh5path = self.__execute() self.__set_overview_title(indexh5path, self.newName) returnList = [] - # lastReportPath = self.__move_file() - # returnList.append(lastReportPath) + lastReportPath = self.__move_file() + returnList.append(lastReportPath) self.__delete_txt_files(txtPath) self.__delete_pycache_dirs(self.rootpath) return returnList