Arthur-Wu committed this file on 2024-11-26
This commit is contained in:
@ -3,3 +3,159 @@
|
||||
# @Author:: Arthur Wu
|
||||
# @Description:: 加购1件重量待核验商品,无法结算
|
||||
# @Date:: 2024/11/22
|
||||
|
||||
|
||||
cart_list_response = {
|
||||
"code": 0,
|
||||
"msg": "成功",
|
||||
"data": {
|
||||
"data": [
|
||||
{
|
||||
"id": 1477,
|
||||
"createdAt": "2024-11-26 18:11:21",
|
||||
"updatedAt": "2024-11-26 18:11:21",
|
||||
"storeCartNo": "97",
|
||||
"marketDeviceNo": null,
|
||||
"cartModelId": 2,
|
||||
"mac": "b8:2d:28:04:c7:5c",
|
||||
"appVersion": null,
|
||||
"firmwareVersion": null,
|
||||
"serialNum": "123",
|
||||
"motherboardType": "3588",
|
||||
"rfid": "0104baf00003032401000000",
|
||||
"status": 1,
|
||||
"activationDate": null,
|
||||
"storeId": 69,
|
||||
"store": {
|
||||
"id": 69,
|
||||
"createdAt": "2024-11-19 09:14:46",
|
||||
"updatedAt": "2024-11-26 17:50:25",
|
||||
"createdBy": "2o1KQ1KvztKWox8qG0um6QiEiE",
|
||||
"updatedBy": "DOpCDWerLYeWox8qG0um6QiEiE",
|
||||
"createdUser": {
|
||||
"id": null,
|
||||
"createdAt": null,
|
||||
"updatedAt": null,
|
||||
"casdoorId": "2o1KQ1KvztKWox8qG0um6QiEiE",
|
||||
"owner": null,
|
||||
"name": null,
|
||||
"displayName": "Leo",
|
||||
"avatar": null,
|
||||
"email": null,
|
||||
"phone": null,
|
||||
"casdoorUserRoleList": [],
|
||||
"roleIds": null,
|
||||
"admin": false
|
||||
},
|
||||
"updatedUser": {
|
||||
"id": null,
|
||||
"createdAt": null,
|
||||
"updatedAt": null,
|
||||
"casdoorId": "DOpCDWerLYeWox8qG0um6QiEiE",
|
||||
"owner": null,
|
||||
"name": null,
|
||||
"displayName": "Sam",
|
||||
"avatar": null,
|
||||
"email": null,
|
||||
"phone": null,
|
||||
"casdoorUserRoleList": [],
|
||||
"roleIds": null,
|
||||
"admin": false
|
||||
},
|
||||
"code": "812901",
|
||||
"shortCode": "8129",
|
||||
"name": "武商超市(梦时代广场)",
|
||||
"province": 17,
|
||||
"city": 203,
|
||||
"address": null,
|
||||
"region": 3,
|
||||
"onlineStatus": 2,
|
||||
"onlineDate": null,
|
||||
"mapType": 0,
|
||||
"mapId": null,
|
||||
"gateAreaId": null,
|
||||
"marketId": 50,
|
||||
"market": {
|
||||
"id": 50,
|
||||
"createdAt": "2024-08-09 10:06:01",
|
||||
"updatedAt": "2024-11-22 10:24:35",
|
||||
"createdBy": "2o1KQ1KvztKWox8qG0um6QiEiE",
|
||||
"updatedBy": "DOpCDWerLYeWox8qG0um6QiEiE",
|
||||
"createdUser": null,
|
||||
"updatedUser": null,
|
||||
"name": "武商超市",
|
||||
"country": 1,
|
||||
"cooperateMode": 1,
|
||||
"cooperateStatus": 2,
|
||||
"cooperateStartDate": "2024-08-09",
|
||||
"beanName": "wsShoppingAPIService",
|
||||
"isRegister": null,
|
||||
"code": "ws",
|
||||
"logo": "market/logo/4c12beab-339c-4954-a880-48ae04377968.png"
|
||||
},
|
||||
"goodsWeightRule": {
|
||||
"id": 41,
|
||||
"createdAt": "2024-11-19 10:02:34",
|
||||
"updatedAt": "2024-11-21 18:06:20",
|
||||
"marketId": 50,
|
||||
"storeId": 69,
|
||||
"weightGetType": 1,
|
||||
"thresholdGetType": 1
|
||||
},
|
||||
"extra": "{\"operators\":\"3002\",\"cashierNo\":\"3002\"}",
|
||||
"elecTicket": 2,
|
||||
"outPic": "store/out-guide/31650c6d-6f07-4d8f-bb79-f6fca0dd0630.png",
|
||||
"imageEdgeServer": null,
|
||||
"guideVideoUrl": null,
|
||||
"memberType": "[9]",
|
||||
"verifyWhenNoWeightAtFirstPurchase": 0
|
||||
},
|
||||
"cartModel": {
|
||||
"id": 2,
|
||||
"createdAt": "2024-01-02 20:41:03",
|
||||
"updatedAt": "2024-04-18 13:46:04",
|
||||
"createdBy": "tg5RAFsa79v2Jn2zBjCFvQiEiE",
|
||||
"updatedBy": "js6e1PM8GtGWox8qG0um6QiEiE",
|
||||
"createdUser": {
|
||||
"id": null,
|
||||
"createdAt": null,
|
||||
"updatedAt": null,
|
||||
"casdoorId": "tg5RAFsa79v2Jn2zBjCFvQiEiE",
|
||||
"owner": null,
|
||||
"name": null,
|
||||
"displayName": "刘坤",
|
||||
"avatar": null,
|
||||
"email": null,
|
||||
"phone": null,
|
||||
"casdoorUserRoleList": [],
|
||||
"roleIds": null,
|
||||
"admin": false
|
||||
},
|
||||
"updatedUser": {
|
||||
"id": null,
|
||||
"createdAt": null,
|
||||
"updatedAt": null,
|
||||
"casdoorId": "js6e1PM8GtGWox8qG0um6QiEiE",
|
||||
"owner": null,
|
||||
"name": null,
|
||||
"displayName": "王金",
|
||||
"avatar": null,
|
||||
"email": null,
|
||||
"phone": null,
|
||||
"casdoorUserRoleList": [],
|
||||
"roleIds": null,
|
||||
"admin": false
|
||||
},
|
||||
"name": "7075S型",
|
||||
"coverUrl": "8d5b85e3-949d-427e-b3b3-7ccb3a6363e5.jpg",
|
||||
"info": null
|
||||
},
|
||||
"extra": null,
|
||||
"plugin": null
|
||||
}
|
||||
],
|
||||
"limit": 10,
|
||||
"page": 1,
|
||||
"total": 1
|
||||
}
|
||||
}
|
@ -110,6 +110,28 @@ class YMServiceApi(object):
|
||||
logging.info(f"---接口返回状态码为:: {response.status_code}")
|
||||
logging.info(f"---接口返回体为:: {response.json()}\n\n")
|
||||
|
||||
def get_markets_of_this_cart(self):
|
||||
logging.info("========== [获取购物车的商超信息] ==========")
|
||||
url = self.Domain + "dmin/cart/list"
|
||||
payload = json.dumps({
|
||||
"page": 1,
|
||||
"limit": 10,
|
||||
"query": {
|
||||
"order": {
|
||||
"createdAt": "desc"
|
||||
},
|
||||
"where": {
|
||||
"mac": {
|
||||
"include": "b8:2d:28:04:c7:5c"
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
response = requests.request("POST", url, headers=self.headerss, data=payload)
|
||||
logging.info(f"-----------接口返回状态码:{response.status_code}")
|
||||
logging.info(f"-----------接口返回数据:{response.json()}\n\n")
|
||||
return response.json()
|
||||
|
||||
def update_the_store_to_which_the_shopping_cart_belongs(self, CartId, CartMac, NewStoreId):
|
||||
'''
|
||||
NewStoreInfo={
|
||||
|
@ -7,7 +7,7 @@
|
||||
#adsAreaId-6: 支付后广告
|
||||
#adsAreaId-7: 小票广告
|
||||
|
||||
MarketName: 武商梦时代门店
|
||||
MarketName: 武商超市(梦时代广场)
|
||||
|
||||
# 1-购物车Mac地址
|
||||
ShoppingCartMac: 70:f7:54:07:a6:c0
|
||||
|
@ -1,6 +1,6 @@
|
||||
# which is the data file for Wu Shang.
|
||||
|
||||
MarketName: 永辉龙湖天街店
|
||||
MarketName: 龙湖天街店
|
||||
|
||||
# 1-购物车Mac地址
|
||||
#ShoppingCartMac: b8:2d:28:04:c7:5c
|
||||
|
Binary file not shown.
@ -6,7 +6,6 @@
|
||||
import unittest,allure,time,pytest,ddt
|
||||
from configs.globalParams import DataInit
|
||||
from YiMao.businessFunc.ClientApiLib import YMClientApi
|
||||
from YiMao.businessFunc.ServiceApiLib import YMServiceApi
|
||||
DescName = "Anon001-非会员加购购物袋并试算"
|
||||
|
||||
@ddt.ddt
|
||||
@ -22,16 +21,6 @@ class Test_CAnon001_AddShoppingBagAndSettlePayment(unittest.TestCase):
|
||||
allure.dynamic.story(f'[{data['MarketName']}-场景测试] {DescName}验证')
|
||||
allure.dynamic.description(f"描述:{data['MarketName']}-{DescName}\n")
|
||||
ymc = YMClientApi(data["ShoppingCartMac"])
|
||||
# yms = YMServiceApi()
|
||||
# CartId = data["CartId"]
|
||||
# CartMac = data["ShoppingCartMac"]
|
||||
# NewStoreId = data["MarketAndStoreDetails"]["putStoreId"][0]
|
||||
# print(f"---切换购物车商超信息为:\n"
|
||||
# f"CartId: {CartId}\n "
|
||||
# f"CartMac: {CartMac}\n "
|
||||
# f"NewStoreId: {NewStoreId}\n")
|
||||
# yms.update_the_store_to_which_the_shopping_cart_belongs(CartId, CartMac, NewStoreId)
|
||||
# time.sleep(1)
|
||||
goodsbag_mid = data["ShoppingBag"]["mid"]
|
||||
|
||||
allure.step("步骤1:session开始")
|
||||
@ -56,16 +45,6 @@ class Test_CAnon001_AddShoppingBagAndSettlePayment(unittest.TestCase):
|
||||
allure.dynamic.story(f'[{data['MarketName']}-场景测试] {DescName}验证')
|
||||
allure.dynamic.description(f"描述:{data['MarketName']}-{DescName}\n")
|
||||
ymc = YMClientApi(data["ShoppingCartMac"])
|
||||
# yms = YMServiceApi()
|
||||
# CartId = data["CartId"]
|
||||
# CartMac = data["ShoppingCartMac"]
|
||||
# NewStoreId = data["MarketAndStoreDetails"]["putStoreId"][0]
|
||||
# print(f"---切换购物车商超信息为:\n"
|
||||
# f"CartId: {CartId}\n"
|
||||
# f"CartMac: {CartMac}\n"
|
||||
# f"NewStoreId: {NewStoreId}\n")
|
||||
# yms.update_the_store_to_which_the_shopping_cart_belongs(CartId, CartMac, NewStoreId)
|
||||
# time.sleep(1)
|
||||
goodsbag_max = data["ShoppingBag"]["max"]
|
||||
|
||||
allure.step("步骤1:session开始")
|
||||
|
Reference in New Issue
Block a user