Commit b27ee191 authored by 张慧's avatar 张慧

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

parent 0e0c0159
......@@ -10,7 +10,7 @@ class visual_beauty_card_request(BaseRequest):
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["current_city_id"] = current_city_id
self.params["page"] = page
......@@ -20,7 +20,7 @@ class visual_beauty_card_request(BaseRequest):
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["current_city_id"] = current_city_id
self.params["version"] = version
......@@ -28,7 +28,7 @@ class visual_beauty_card_request(BaseRequest):
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["tag_id"] = tag_id
self.params["area"] = area
......@@ -36,4 +36,4 @@ class visual_beauty_card_request(BaseRequest):
self.params["page"] = page
self.params["page_size"] = page_size
return self.api_send(self.data['beautycard_skus'])
\ No newline at end of file
return self.api_send(self.data['beautycard_skus'])
......@@ -12,8 +12,32 @@ class TestVisualBeautyCardServices:
@pytest.mark.parametrize("param", visual_beauty_card_services_data, ids=visual_beauty_card_services_case)
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"])
if r["data"]["beautycards"]:
print('次卡橱窗有商品')
assert len(r["data"]["beautycards"]) != param["assert"]
\ No newline at end of file
if param["unit_id"] == "20105":
assert len(r["data"]["beautycards"]) > param["assert_spu"]
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
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:
-
#更美次卡橱窗-按SPU导入,定位北京,商品正常召回
case: "更美次卡橱窗-按SPU导入,定位北京,商品正常召回"
case: "更美次卡橱窗-按SPU导入,定位北京,商品正常召回case"
unit_id: "20105"
current_city_id: "beijing"
page: "0"
page_size: "50"
version: "743.0"
assert: 0
version: "7.43.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导入,定位北京,商品正常召回
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"
current_city_id: "beijing"
page: "0"
page_size: "50"
version: "743.0"
assert: 0
\ No newline at end of file
version: "7.43.0"
assert_sku: 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