Commit 804a15b2 authored by 张慧's avatar 张慧

商祥页-推荐商品列表-新接口-748以上

parent 1dac21fd
...@@ -89,6 +89,13 @@ class janus_request(BaseRequest): ...@@ -89,6 +89,13 @@ class janus_request(BaseRequest):
self.params["tab_id"] = tab_id self.params["tab_id"] = tab_id
return self.api_send(self.data["product_coupon_my_list"]) return self.api_send(self.data["product_coupon_my_list"])
# 商祥页-商品推荐-新接口-748以上
def service_promotion_related_service_data(self, service_id, page, current_city_id):
self.params["service_id"] = service_id
self.params["page"] = page
self.params["current_city_id"] = current_city_id
return self.api_send(self.data["service_promotion_related_service_data"])
# 品类聚合页面商品列表 # 品类聚合页面商品列表
def tag_service(self, size, tag_ids, offset, tag_id, version, device_id): def tag_service(self, size, tag_ids, offset, tag_id, version, device_id):
print("fgx") print("fgx")
...@@ -296,33 +303,33 @@ if __name__ == '__main__': ...@@ -296,33 +303,33 @@ if __name__ == '__main__':
#打印购物车-猜你喜欢列表接口返回 #打印购物车-猜你喜欢列表接口返回
# print(janus_request().mine_guess_you_like()) # print(janus_request().mine_guess_you_like())
#打印商祥页-详情接口返回 #打印商祥页-详情接口返回
print(janus_request().product_detail("5857263", "618788", "7.43.0")) # print(janus_request().product_detail("5857263", "618788", "7.43.0"))
#打印商祥页-sku信息接口返回 # #打印商祥页-sku信息接口返回
print(janus_request().sku_info("5857263", "618788")) # print(janus_request().sku_info("5857263", "618788"))
#打印商祥页-美券列表-我的美券点击-744版本及以后-新接口返回 # #打印商祥页-美券列表-我的美券点击-744版本及以后-新接口返回
print(janus_request().product_coupon_my_list(0, 0)) # print(janus_request().product_coupon_my_list(0, 0))
#
#品类聚合页面商品列表接口返回 # #品类聚合页面商品列表接口返回
# print(janus_request().tag_service()) # # print(janus_request().tag_service())
print("fgx") # print("fgx")
#
#品类聚合页面标签和专场 # #品类聚合页面标签和专场
# print(janus_request().polymer()) # # print(janus_request().polymer())
print("fgx") # print("fgx")
#
#打印次卡-确认订单接口返回 # #打印次卡-确认订单接口返回
print(janus_request().beauty_card_order_confirm("10176", 1, 1, 0)) # print(janus_request().beauty_card_order_confirm("10176", 1, 1, 0))
#打印次卡-确认订单页面-修改手机号接口返回 # #打印次卡-确认订单页面-修改手机号接口返回
print(janus_request().beauty_card_update_phone("+8612348543876", 1, "084430")) # print(janus_request().beauty_card_update_phone("+8612348543876", 1, "084430"))
#打印次卡-提交订单接口返回 # #打印次卡-提交订单接口返回
print(janus_request().beauty_card_order_submit("12345678912", "10176", 1, 1, 0, 0)) # print(janus_request().beauty_card_order_submit("12345678912", "10176", 1, 1, 0, 0))
#打印次卡-支付平台接口返回 # #打印次卡-支付平台接口返回
print(janus_request().beauty_card_payment_method("101670448736595")) # print(janus_request().beauty_card_payment_method("101670448736595"))
#
print(janus_request().product_my_list(0, 0)) # print(janus_request().product_my_list(0, 0))
#
# 次卡商详页-适应机构 # # 次卡商详页-适应机构
print(janus_request().beauty_card_service_hospital("10046", 20, 0, 1)) # print(janus_request().beauty_card_service_hospital("10046", 20, 0, 1))
# #打印购物车-猜你喜欢列表接口返回 # #打印购物车-猜你喜欢列表接口返回
# print(janus_request().mine_guess_you_like()) # print(janus_request().mine_guess_you_like())
# #打印商祥页-详情接口返回 # #打印商祥页-详情接口返回
...@@ -366,13 +373,14 @@ if __name__ == '__main__': ...@@ -366,13 +373,14 @@ if __name__ == '__main__':
# #直播-点击【设置封面】 # #直播-点击【设置封面】
# print("直播-点击【设置封面】") # print("直播-点击【设置封面】")
# print(janus_request().page_rules("744.2", "beijing", "post_add_pic")) # print(janus_request().page_rules("744.2", "beijing", "post_add_pic"))
#直播-点击【设置封面】 # #直播-点击【设置封面】
print("直播-点击【设置封面】") # print("直播-点击【设置封面】")
print(janus_request().page_rules("744.2", "beijing", "post_add_pic")) # print(janus_request().page_rules("744.2", "beijing", "post_add_pic"))
#直播-主播获取美颜 # #直播-主播获取美颜
print("meiyan") # print("meiyan")
print(janus_request().beauty("739")) # print(janus_request().beauty("739"))
#直播-主播修改美颜 # #直播-主播修改美颜
print("change meiyan") # print("change meiyan")
print(janus_request().beauty_post("739","true","0.60","0.40","0.70")) # print(janus_request().beauty_post("739","true","0.60","0.40","0.70"))
# 商祥页-推荐商品-新接口
print(janus_request().service_promotion_related_service_data('5828374', 1, 'beijing'))
...@@ -69,6 +69,21 @@ product_coupon_my_list: ...@@ -69,6 +69,21 @@ product_coupon_my_list:
json: {} json: {}
isLogin: 1 isLogin: 1
#商祥页-推荐商品-新接口-748以上
service_promotion_related_service_data:
method: get
url: /api/janus/service/promotion/related_service/_data
params:
service_id: ${service_id}
page: ${page}
current_city_id: ${current_city_id}
version: "7.48.0"
lat: "39.983161"
lng: "116.488078"
data: {}
json: {}
isLogin: 1
#品类聚合页面商品列表的 #品类聚合页面商品列表的
tag_service: tag_service:
method: GET method: GET
......
...@@ -369,6 +369,8 @@ PRODUCT_COUPON_MY_LIST = os.path.join(BASE_DIR, "backend_auto/test_backend_data/ ...@@ -369,6 +369,8 @@ PRODUCT_COUPON_MY_LIST = os.path.join(BASE_DIR, "backend_auto/test_backend_data/
#商祥页-推荐商品列表 #商祥页-推荐商品列表
HYBRID_PROMOTION_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "hybrid_promotion_request.yaml") HYBRID_PROMOTION_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "hybrid_promotion_request.yaml")
RELATED_SERVICE_DATA = os.path.join(BASE_DIR, "backend_auto/test_backend_data/hybrid_promotion_data", "related_service_data.yaml") RELATED_SERVICE_DATA = os.path.join(BASE_DIR, "backend_auto/test_backend_data/hybrid_promotion_data", "related_service_data.yaml")
# 商祥页-推荐商品列表-新接口-748以上
SERVICE_PROMOTION_RELATED_SERVICE_DATA = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_data", "service_promotion_related_service_data.yaml")
#次卡-确认订单 #次卡-确认订单
BEAUTY_CARD_ORDER_CONFIRM = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_data", "beauty_card_order_confirm.yaml") BEAUTY_CARD_ORDER_CONFIRM = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_data", "beauty_card_order_confirm.yaml")
......
import pytest
from all_backend_api.janus_request import janus_request
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
class TestServicePromotionRelatedServiceData:
data = BaseRequest().api_load(path_setting.SERVICE_PROMOTION_RELATED_SERVICE_DATA)
service_promotion_related_service_data_case, service_promotion_related_service_data_data = \
get_ids(data, "service_promotion_related_service_data")
@pytest.mark.parametrize("param", service_promotion_related_service_data_data,
ids=service_promotion_related_service_data_case)
def test_service_promotion_related_service_data_case(self, param):
r = janus_request().service_promotion_related_service_data(param["service_id"], param["page"],
param["current_city_id"])
if param["page"] == 1:
assert len(r["data"]["services"]) == param["assert_page1_len"]
if param["page"] == 2:
assert len(r["data"]["services"]) == param["assert_page2_len"]
if r["error"] == 0:
assert r["data"]["services"][0]["title"] is not None
assert r["data"]["services"][0]["price_info"] is not None
assert r["data"]["services"][0]["sell_num_desc"] is not None
assert r["data"]["services"][0]["doctor_hospital_name"] is not None
assert r["data"]["services"][0]["distance"] is not None
service_promotion_related_service_data:
-
case: "校验第一页返回数据2条case"
service_id: "5828374"
page: 1
current_city_id: "beijing"
assert_page1_len: 2
-
case: "校验第二页返回数据10条case"
service_id: "5828374"
page: 2
current_city_id: "beijing"
assert_page2_len: 10
-
case: "校验必要字段接口返回不为空"
service_id: "5828374"
page: 2
current_city_id: "beijing"
assert_page1_len: 2
assert_page2_len: 10
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment