Commit b27ee191 authored by 张慧's avatar 张慧

次卡橱窗商品列表接口case完善

parent 0e0c0159
...@@ -10,7 +10,7 @@ class visual_beauty_card_request(BaseRequest): ...@@ -10,7 +10,7 @@ class visual_beauty_card_request(BaseRequest):
self.data = self.api_load(path_setting.BEAUTYCARD_FILTERS_CONFIG) self.data = self.api_load(path_setting.BEAUTYCARD_FILTERS_CONFIG)
#自定义专题-更美次卡橱窗组件商品 #自定义专题-更美次卡橱窗组件商品
def visual_beauty_card_services(self, unit_id, current_city_id, page, page_size, version, device_id = '97B6764B-2135-4761-9911-701C38CBC272'): def visual_beauty_card_services(self, unit_id, current_city_id, page, page_size, version):
self.params["unit_id"] = unit_id self.params["unit_id"] = unit_id
self.params["current_city_id"] = current_city_id self.params["current_city_id"] = current_city_id
self.params["page"] = page self.params["page"] = page
...@@ -20,7 +20,7 @@ class visual_beauty_card_request(BaseRequest): ...@@ -20,7 +20,7 @@ class visual_beauty_card_request(BaseRequest):
return self.api_send(self.data['visual_beauty_card_services']) return self.api_send(self.data['visual_beauty_card_services'])
#自定义专题-更美次卡商品列表筛选器 #自定义专题-更美次卡商品列表筛选器
def beautycard_filters(self, unit_id, current_city_id, version, device_id = '97B6764B-2135-4761-9911-701C38CBC272'): def beautycard_filters(self, unit_id, current_city_id, version):
self.params["unit_id"] = unit_id self.params["unit_id"] = unit_id
self.params["current_city_id"] = current_city_id self.params["current_city_id"] = current_city_id
self.params["version"] = version self.params["version"] = version
...@@ -28,7 +28,7 @@ class visual_beauty_card_request(BaseRequest): ...@@ -28,7 +28,7 @@ class visual_beauty_card_request(BaseRequest):
return self.api_send(self.data['beautycard_filters']) return self.api_send(self.data['beautycard_filters'])
#自定义专题-更美次卡商品列表组件商品 #自定义专题-更美次卡商品列表组件商品
def beautycard_skus(self, unit_id, tag_id, area, sort_type, page, page_size, device_id = '97B6764B-2135-4761-9911-701C38CBC272'): def beautycard_skus(self, unit_id, tag_id, area, sort_type, page, page_size):
self.params["unit_id"] = unit_id self.params["unit_id"] = unit_id
self.params["tag_id"] = tag_id self.params["tag_id"] = tag_id
self.params["area"] = area self.params["area"] = area
......
...@@ -12,8 +12,32 @@ class TestVisualBeautyCardServices: ...@@ -12,8 +12,32 @@ class TestVisualBeautyCardServices:
@pytest.mark.parametrize("param", visual_beauty_card_services_data, ids=visual_beauty_card_services_case) @pytest.mark.parametrize("param", visual_beauty_card_services_data, ids=visual_beauty_card_services_case)
def test_visual_beauty_card_services(self, param): def test_visual_beauty_card_services(self, param):
print('次卡橱窗')
r = visual_beauty_card_request().visual_beauty_card_services(param["unit_id"], param["current_city_id"], param["page"], param["page_size"], param["version"]) r = visual_beauty_card_request().visual_beauty_card_services(param["unit_id"], param["current_city_id"], param["page"], param["page_size"], param["version"])
if r["data"]["beautycards"]: if param["unit_id"] == "20105":
print('次卡橱窗有商品') assert len(r["data"]["beautycards"]) > param["assert_spu"]
assert len(r["data"]["beautycards"]) != param["assert"] assert r["data"]["beautycards"][0]["bc_spu_id"] is not None
\ No newline at end of file assert r["data"]["beautycards"][0]["bc_spu_name"] is not None
assert r["data"]["beautycards"][0]["bc_sku_id"] is not None
assert r["data"]["beautycards"][0]["bc_sku_name"] is not None
assert r["data"]["beautycards"][0]["bc_image"] is not None
assert r["data"]["beautycards"][0]["bc_origin_price"] is not None
assert r["data"]["beautycards"][0]["bc_gengmei_price"] is not None
assert r["data"]["beautycards"][0]["sales_amount"] is not None
assert r["data"]["beautycards"][0]["gm_url"] is not None
assert r["data"]["beautycards"][0]["rank"] is not None
assert r["data"]["beautycards"][0]["has_discount"] is not None
assert r["data"]["beautycards"][0]["bc_discount_total_payment"] is not None
if param["unit_id"] == "20106":
assert len(r["data"]["beautycards"]) > param["assert_sku"]
assert r["data"]["beautycards"][0]["bc_spu_id"] is not None
assert r["data"]["beautycards"][0]["bc_spu_name"] is not None
assert r["data"]["beautycards"][0]["bc_sku_id"] is not None
assert r["data"]["beautycards"][0]["bc_sku_name"] is not None
assert r["data"]["beautycards"][0]["bc_image"] is not None
assert r["data"]["beautycards"][0]["bc_origin_price"] is not None
assert r["data"]["beautycards"][0]["bc_gengmei_price"] is not None
assert r["data"]["beautycards"][0]["sales_amount"] is not None
assert r["data"]["beautycards"][0]["gm_url"] is not None
assert r["data"]["beautycards"][0]["rank"] is not None
assert r["data"]["beautycards"][0]["has_discount"] is not None
assert r["data"]["beautycards"][0]["bc_discount_total_payment"] is not None
\ No newline at end of file
visual_beauty_card_services: visual_beauty_card_services:
- -
#更美次卡橱窗-按SPU导入,定位北京,商品正常召回 #更美次卡橱窗-按SPU导入,定位北京,商品正常召回
case: "更美次卡橱窗-按SPU导入,定位北京,商品正常召回" case: "更美次卡橱窗-按SPU导入,定位北京,商品正常召回case"
unit_id: "20105" unit_id: "20105"
current_city_id: "beijing" current_city_id: "beijing"
page: "0" page: "0"
page_size: "50" page_size: "50"
version: "743.0" version: "7.43.0"
assert: 0 assert_spu: 0
-
#更美次卡橱窗-按SPU导入,定位北京,接口字段返回正常
case: "更美次卡橱窗-按SPU导入,定位北京,接口字段返回正常case"
unit_id: "20105"
current_city_id: "beijing"
page: "0"
page_size: "50"
version: "7.43.0"
assert_spu: 0
- -
#更美次卡橱窗-按SKU导入,定位北京,商品正常召回 #更美次卡橱窗-按SKU导入,定位北京,商品正常召回
case: "更美次卡橱窗-按SKU导入,定位北京,商品正常召回" case: "更美次卡橱窗-按SKU导入,定位北京,商品正常召回case"
unit_id: "20106"
current_city_id: "beijing"
page: "0"
page_size: "50"
version: "7.43.0"
assert_sku: 0
-
#更美次卡橱窗-按SKU导入,定位北京,接口字段返回正常
case: "更美次卡橱窗-按SKU导入,定位北京,接口字段返回正常case"
unit_id: "20106" unit_id: "20106"
current_city_id: "beijing" current_city_id: "beijing"
page: "0" page: "0"
page_size: "50" page_size: "50"
version: "743.0" version: "7.43.0"
assert: 0 assert_sku: 0
\ No newline at end of file \ 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