Beispiel #1
0
 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)
Beispiel #2
0
 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("没有待评价的商品")
Beispiel #3
0
 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)
Beispiel #4
0
 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'
Beispiel #5
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'
Beispiel #6
0
 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)
Beispiel #7
0
 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)
Beispiel #8
0
 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'
Beispiel #10
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)
Beispiel #11
0
 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)
Beispiel #12
0
 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)
Beispiel #13
0
 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']
Beispiel #14
0
 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'
Beispiel #15
0
 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'
Beispiel #16
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'
Beispiel #17
0
 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'
Beispiel #18
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)
Beispiel #19
0
 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)
Beispiel #20
0
 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'
Beispiel #21
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)
Beispiel #22
0
 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)
Beispiel #23
0
 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)
Beispiel #24
0
 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)
Beispiel #25
0
 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)
Beispiel #26
0
 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)
Beispiel #27
0
 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)
Beispiel #28
0
 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']
Beispiel #29
0
 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)
Beispiel #30
0
 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']