Commit 46430401 authored by 张慧's avatar 张慧

自定义专题商品列表接口

parent 312a0424
......@@ -6,8 +6,15 @@ class visual_request(BaseRequest):
def __init__(self):
self.data = self.api_load(path_setting.VISUAL_CONFIG)
# 签到--其他tab 美购feed
def service_list(self, unit_id, current_city_id='beijing'):
# 签到--其他tab 美购feed——自定义专题
def service_list(self, unit_id, page, current_city_id, order_by, area, tag_ids):
self.params["unit_id"] = unit_id
self.params["page"] = page
self.params["current_city_id"] = current_city_id
return self.api_send(self.data['service_list'])
\ No newline at end of file
self.params["order_by"] = order_by
self.params["area"] = area
self.params["tag_ids"] = tag_ids
return self.api_send(self.data['service_list'])
if __name__ == '__main__':
print(visual_request().service_list(20236, 0, "beijing", 0, "worldwide", [66]))
\ No newline at end of file
#签到--其他tab 美购feed
#签到--其他tab 美购feed——自定义专题
service_list:
method: GET
url: /api/visual/service_list
url: /api/visual/service_list
params:
#组件id
unit_id : ${unit_id}
current_city_id : ${current_city_id}
unit_id: ${unit_id}
page: ${page}
current_city_id: ${current_city_id}
order_by: ${order_by}
area: ${area}
tag_ids: ${tag_ids}
data: {}
json: {}
is_Login: 1
is_Login: 1
\ No newline at end of file
......@@ -156,7 +156,7 @@ SIGN_EXCHANGED = os.path.join(BASE_DIR, "backend_auto/test_backend_data/user_dat
SIGN_CALENDAR = os.path.join(BASE_DIR, "backend_auto/test_backend_data/user_data", "sign_calendar.yaml")
# 签到--其他 tab feed --也是总的 visual 配置项
# 签到--其他 tab feed --自定义专题商品列表
VISUAL_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "visual_request.yaml")
VISUAL_SERVICE_LIST = os.path.join(BASE_DIR, "backend_auto/test_backend_data/visual_data", "service_list.yaml")
......
......@@ -9,11 +9,21 @@ from in_common.base_request import BaseRequest
class TestServiceList:
data = BaseRequest().api_load(path_setting.VISUAL_SERVICE_LIST)
service_list_case, service_list_data = get_ids(data, "service_list")
#
@pytest.mark.parametrize("param", service_list_data, ids=service_list_case)
def test_service_list(self, param):
r = visual_request().service_list(param["unit_id"])
assert r["error"] == 0
list = r.get("data").get("services",[])
assert len(list) == param["len"]
r = visual_request().service_list(param["unit_id"], param["page"], param["current_city_id"],
param["order_by"], param["area"], param["tag_ids"])
assert r["error"] == param["assert"]
assert len(r["data"]["services"]) > 0
assert r["data"]["services"][0]["spu_id"] is not None
assert r["data"]["services"][0]["sku_id"] is not None
assert r["data"]["services"][0]["doctor_hospital_name"] is not None
assert r["data"]["services"][0]["gm_url"] is not None
assert r["data"]["services"][0]["has_coupon"] is not None
assert r["data"]["services"][0]["has_video"] is not None
assert r["data"]["services"][0]["short_description"] is not None
assert r["data"]["services"][0]["sell_num"] is not None
assert r["data"]["services"][0]["price_info"] is not None
assert r["data"]["services"][0]["activity_tag"] is not None
\ No newline at end of file
#签到--其他tab 美购feed
#签到--其他tab 美购feed——自定义专题
service_list:
-
case: "签到--其他tab 美购feed 校验返回数据数"
case: "自定义专题商品列表-默认排序"
unit_id: 20236
page: 0
current_city_id: "beijing"
order_by: 0
area: "worldwide"
tag_ids: []
assert: 0
len: 10
unit_id: 17923
\ No newline at end of file
-
case: "自定义专题商品列表-城市筛选"
unit_id: 20236
page: 0
current_city_id: "beijing"
order_by: 0
area: "592"
tag_ids: []
assert: 0
-
case: "自定义专题商品列表-品类筛选"
unit_id: 20236
page: 0
current_city_id: "beijing"
order_by: 0
area: "worldwide"
tag_ids: [66]
assert: 0
-
case: "自定义专题商品列表-只能排序"
unit_id: 20236
page: 0
current_city_id: "beijing"
order_by: 9
area: "worldwide"
tag_ids: []
assert: 0
-
case: "自定义专题商品列表-销量最高"
unit_id: 20236
page: 0
current_city_id: "beijing"
order_by: 4
area: "worldwide"
tag_ids: []
assert: 0
-
case: "自定义专题商品列表-价格最低"
unit_id: 20236
page: 0
current_city_id: "beijing"
order_by: 5
area: "worldwide"
tag_ids: []
assert: 0
-
case: "自定义专题商品列表-价格最高"
unit_id: 20236
page: 0
current_city_id: "beijing"
order_by: 21
area: "worldwide"
tag_ids: []
assert: 0
-
case: "自定义专题商品列表-案例最多"
unit_id: 20236
page: 0
current_city_id: "beijing"
order_by: 7
area: "worldwide"
tag_ids: []
assert: 0
-
case: "自定义专题商品列表-离我最近"
unit_id: 20236
page: 0
current_city_id: "beijing"
order_by: 12
area: "worldwide"
tag_ids: []
assert: 0
-
case: "自定义专题商品列表-评价最高"
unit_id: 20236
page: 0
current_city_id: "beijing"
order_by: 13
area: "worldwide"
tag_ids: []
assert: 0
-
case: "自定义专题商品列表-召回数据正常"
unit_id: 20236
page: 0
current_city_id: "beijing"
order_by: 13
area: "worldwide"
tag_ids: []
assert: 0
-
case: "自定义专题商品列表-接口返回字段正常"
unit_id: 20236
page: 0
current_city_id: "beijing"
order_by: 13
area: "worldwide"
tag_ids: []
assert: 0
\ 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