def test_delete_cart(self, login): host = "http://app.51zheli.com" path = "/cart/delete" headers = {"osType": "h5", "token": login['token']} data = {"skuIds": 19834, "userId": login['userId']} r = runMethod().post(host + path, headers, data) print(r)
def test_order_listWaitevaluate(self,login): host = "http://app.51zheli.com" path = "/order/list" path = "/order/list" headers = { "osType": "h5", "token": login['token'] } data = { "key": "waitevaluate", "page": 1, "size": 100, "userId": login['userId'] } r = runMethod().post(host + path, headers, data) # print() assert r['code']== '0' assert r['msg'] == 'success' list = r['data'][0]['orderDetails'] for i in list: for key, value in i.items(): if key =='orderDetailId': return value else: print("没有待评价的商品")
def test_cart_num(self, login): host = "http://app.51zheli.com" path = "/cart/findNum" headers = {"osType": "h5", "token": login['token']} params = {"userId": login['userId']} r = runMethod().get(host + path, headers, params) print(r)
def test_product_serverinfo(self, login): host = "http://app.51zheli.com" path = "/product/getProductServiceWriterConfig" parames = {"userId": login['userId']} headers = {"osType": "h5", "token": login['token']} repon = runMethod().get(host + path, headers, parames) assert repon['msg'] == 'success' assert repon['code'] == '0'
def test_product_index(self, login): host = "http://app.51zheli.com" path = "/product/index" parames = {"productCategoryId": 2, "userId": login['userId']} headers = {"osType": "h5", "token": login['token']} reon = runMethod().get(host + path, headers, parames) assert reon['code'] == '0' assert reon['msg'] == 'success'
def test_address_EDI(self, login): host = "http://app.51zheli.com" path = "/address/find2" url = host + path headers = {"osType": "h5", "token": login['token']} params = {"page": 1, "size": 10, "userId": login['userId']} r = runMethod().get(url, headers, params) print(r)
def test_goods_tings(self, login): host = "http://app.51zheli.com" path = "/goodThings/productAboutGoodThingsRecommend" parames = {"productId": 110355} headers = {"osType": "h5", "token": login['token']} repon = runMethod().get(host + path, headers, parames) assert repon['code'] == '0' assert repon['msg'] == 'success' print(repon)
def test_product_video(self, login): host = "http://app.51zheli.com" path = "/videoProd/searchPlus" parames = {"page": 1, "size": 100} headers = {"osType": "h5", "token": login['token']} repon = runMethod().get(host + path, headers, parames) assert repon['msg'] == 'success' assert repon['code'] == '0' print(repon)
def test_product_description(self, login): host = "http://app.51zheli.com" path = "/product/description/{productId}".format( productId=self.test_seach_goods(login)) parames = {"userId": login['data']['userId']} headers = {"osType": "h5", "token": login['data']['token']} repon = runMethod().get(host + path, headers, parames) assert repon['msg'] == 'success' assert repon['code'] == '0'
def test_user_group_cart(self, login): host = "http://app.51zheli.com" path = "/cart/findUserShoppingCart" headers = {"osType": "h5", "token": login['token']} params = {"userId": login['userId']} r = runMethod().get(host + path, headers, params) list = r['data'] for i in list: print(i)
def test_product_deletefun(self, login): host = "http://app.51zheli.com" path = "/productCollection/delete" data = {"productIds": [110348, 110060], "userId": login['userId']} headers = {"osType": "h5", "token": login['token']} repon = runMethod().post(host + path, headers, data) assert repon['code'] == '0' assert repon['msg'] == 'success' print(repon)
def test_product_couponList(self, login): host = "http://app.51zheli.com" path = "/cardCoupons/coupon/list" params = { "productId": self.test_product_seach(login), "userId": login['userId'] } headers = {"osType": "h5", "token": login['token']} r = runMethod().get(host + path, headers, params) print(r)
def test_goods_tings(self, login): host = "http://app.51zheli.com" path = "/goodThings/productAboutGoodThingsRecommend" parames = { "productId": self.test_seach_goods(login), "userId": login['data']['userId'] } headers = {"osType": "h5", "token": login['data']['token']} repon = runMethod().get(host + path, headers, parames) return repon['data']['goodThingsRecommends']['product']['categoryId']
def test_product_info(self, login): host = "http://app.51zheli.com" # host = hosts['host']['ip'] path = "/product/info/{productId}".format( productId=self.test_product_seach(login)) parames = {"userId": login['userId']} headers = {"osType": "h5", "token": login['token']} repon = runMethod().get(host + path, headers, parames) assert repon['code'] == '0' assert repon['msg'] == 'success'
def test_store(self, login): host = "http://app.51zheli.com" path = "/store/findStoreByUserId" parames = { "storeId": self.test_goods(login), "userId": login['data']['userId'] } headers = {"osType": "h5", "token": login['data']['token']} repon = runMethod().get(host + path, headers, parames) assert repon['msg'] == 'success' assert repon['code'] == '0'
def test_address_add(self, login): host = "http://app.51zheli.com" path = "/address/delete" headers = {"osType": "h5", "token": login['token']} data = { "addressId": self.test_address_list(login), "userId": login['userId'] } r = runMethod().post(host + path, headers, data) assert r['code'] == '0' assert r['msg'] == 'success'
def test_product_recommend(self, login): host = "http://app.51zheli.com" path = "/productRecommend/find" parames = { "recommendKey": "cartHot" # "userId": login['userId'] } headers = {"osType": "h5", "token": login['token']} repon = runMethod().get(host + path, headers, parames) assert repon['msg'] == 'success' assert repon['code'] == '0'
def test_find_cart(self, login): host = "http://app.51zheli.com" path = "/cart/find" headers = {"osType": "h5", "token": login['token']} params = { "page": 1, "size": 100, "status": 0, "userId": login['userId'] } r = runMethod().get(host + path, headers, params) print(r)
def test_userCoupon_info(self, login): host = "http://app.51zheli.com" path = "/userCardCoupons/info" parames = { "couponId": "2c928ae97106c49b0171077d975d018c", "status": 0 #0未领 1 领取 } headers = {"osType": "h5", "token": login['token']} repon = runMethod().get(host + path, headers, parames) assert repon['code'] == '0' assert repon['msg'] == 'success' print(repon)
def test_cardCoupon(self, login): host = "http://app.51zheli.com" path = "/cardCoupons/show/coupon/entry" parames = { "productId": self.test_product_seach(login), "storeId": self.test_product_classify(login), "userId": login['userId'] } headers = {"osType": "h5", "token": login['token']} repon = runMethod().get(host + path, headers, parames) assert repon['msg'] == 'success' assert repon['code'] == '0'
def test_agentRule(self, login): host = "http://app.51zheli.com" path = "/agentRule/rePurchaseRemind " headers = {"osType": "h5", "token": login['token']} data = { "orderDetailId": "2c928ae9720824d201720c16a6b60021", "productIds": "110112", "rePurchaseType": 3, #1:相同商品复购提示 2:相同二级品类复购提示 3:相同品类商品提示(一键推荐商品) "tagetUserIds": "2c928ae9720824d201720c0e4ff3001a", "userId": login['userId'] } r = runMethod().post(host + path, headers, data) print(r)
def test_order_info(self,login): host = "http://app.51zheli.com" path = "/order/info/{orderId}".format(orderId=self.test_order_createOnekey(login)) headers={ "osType": "h5", "token": login['token'] } data = { "orderId":self.test_order_createOnekey(login), "userId":login['userId'] } r = runMethod().post(host+path,headers,data) print(r)
def test_order_postage(self,login): host = "http://app.51zheli.com" path = "/order/postageCalculate" headers = { "osType": "h5", "token": login['token'] } data = { "orderJson":"", "userId": login['userId'] } r = runMethod().post(host + path, headers, data) print(r)
def test_add_cart(self, login): host = "http://app.51zheli.com" path = "/cart/save" headers = {"osType": "h5", "token": login['token']} data = { "count": 1, "productId": 110348, "skuId": 19834, "storeId": 15, "userId": login['userId'] } r = runMethod().post(host + path, headers, data) print(r)
def test_userCoupon_polymerization(self, login): host = "http://app.51zheli.com" path = "/product/coupons/polymerization" parames = { "code": "2c928ae97106c49b0171078343d5018d", "page": 1, "size": 100, "userId": login['userId'] } headers = {"osType": "h5", "token": login['token']} repon = runMethod().get(host + path, headers, parames) assert repon['code'] == '0' assert repon['msg'] == 'success' print(repon)
def test_address_seach(self, login): host = "http://app.51zheli.com" path = "/address/find" headers = {"osType": "h5", "token": login['token']} params = { "page": 1, "size": 100, "keyWord": "", "userId": login['userId'] } r = runMethod().get(host + path, headers, params) assert r['code'] == '0' assert r['msg'] == 'success' print(r)
def test_product_videolist(self, login): host = "http://app.51zheli.com" path = "/videoRec/productRecommendVideoList" parames = { "productId": self.test_seach_goods(login), "page": 1, "size": 20, "userId": login['data']['userId'] } headers = {"osType": "h5", "token": login['data']['token']} repon = runMethod().get(host + path, headers, parames) assert repon['msg'] == 'success' assert repon['code'] == '0' print(repon)
def test_order_serial(self,login): host = "http://app.51zheli.com" path="/order/serial" headers= { "osType": "h5", "token": login['token'] } params={ "userId":login['userId'] } r = runMethod().get(host+path,headers,params) assert r['code'] == '0' assert r['msg'] =='success' return r['data']
def test_productFAQ(self, login): host = "http://app.51zheli.com" path = "/productFAQ/findList" params = { "productId": self.test_product_seach(login), "page": 1, "size": 100, "userId": login['userId'] } headers = {"osType": "h5", "token": login['token']} r = runMethod().get(host + path, headers, params) assert r['code'] == '0' assert r['msg'] == 'success' print(r)
def test_product_classify(self, login): host = "http://app.51zheli.com" path = "/product/findCategory" parames = { "productCategoryId": 292, "page": 1, "size": 10, "userId": login['userId'] } headers = {"osType": "h5", "token": login['token']} repon = runMethod().get(host + path, headers, parames) assert repon['msg'] == 'success' assert repon['code'] == '0' return repon['data'][0]['storeId']