Commit abf4910d authored by 陈雪's avatar 陈雪

Merge branch 'common_dev' of http://git.wanmeizhensuo.com/dengyingying/backend_auto into common_dev

parents 72bbe9d9 e9999a6d
import path_setting
from in_common.base_request import BaseRequest
class hybrid_promotion_request(BaseRequest):
def __init__(self):
self.data = self.api_load(path_setting.HYBRID_PROMOTION_CONFIG)
#商祥页-sku信息
def related_service_data(self, service_id, page):
self.params["service_id"] = service_id
self.params["page"] = page
return self.api_send(self.data["related_service_data"])
if __name__ == '__main__':
#打印商祥页-推荐商品列表接口返回
print(hybrid_promotion_request().related_service_data("5815040", 1))
#商祥页-推荐商品列表
related_service_data:
method: get
url: /hybrid/promotion/related_service/_data
params:
service_id: ${service_id}
page: ${page}
data: {}
json: {}
\ No newline at end of file
......@@ -74,6 +74,12 @@ class janus_request(BaseRequest):
self.params["service_item_id"] = service_item_id
return self.api_send(self.data["sku_info"])
#商祥页-美券列表-我的美券点击-744版本及以后-新接口
def product_coupon_my_list(self, start_num, tab_id):
self.params["start_num"] = start_num
self.params["tab_id"] = tab_id
return self.api_send(self.data["product_coupon_my_list"])
# 品类聚合页面商品列表
def tag_service(self, size, tag_ids, offset, tag_id, version, device_id):
print("fgx")
......@@ -104,6 +110,14 @@ class janus_request(BaseRequest):
return self.api_send(self.data['keyword_tip'])
#次卡-确认订单
def beauty_card_confirm(self, sku_id, number, use_bc_coupon, bc_coupon_id):
self.params["sku_id"] = sku_id
self.params["number"] = number
self.params["use_bc_coupon"] = use_bc_coupon
self.params["bc_coupon_id"] = bc_coupon_id
return self.api_send(self.data["beauty_card_confirm"])
# 新版本我的美券列表
def product_my_list(self,start_num,tab_id):
self.params['start_num'] = start_num
......@@ -118,6 +132,8 @@ if __name__ == '__main__':
print(janus_request().product_detail("5857263", "618788", "7.43.0"))
#打印商祥页-sku信息接口返回
print(janus_request().sku_info("5857263", "618788"))
#打印商祥页-美券列表-我的美券点击-744版本及以后-新接口返回
print(janus_request().product_coupon_my_list(0, 0))
#品类聚合页面商品列表接口返回
print(janus_request().tag_service())
......@@ -127,4 +143,9 @@ if __name__ == '__main__':
print(janus_request().polymer())
print("fgx")
#打印次卡-确认订单接口返回
print(janus_request().beauty_card_confirm("10176", 1, 1, 0))
print(janus_request().product_my_list(0, 0))
......@@ -58,6 +58,17 @@ sku_info:
data: {}
json: {}
#商祥页-美券列表-我的美券点击-744版本及以后-新接口
product_coupon_my_list:
method: get
url: /api/janus/product/coupon/my_list
params:
start_num: ${start_num}
tab_id: ${tab_id}
data: {}
json: {}
isLogin: 1
#品类聚合页面商品列表的
tag_service:
method: GET
......@@ -96,6 +107,20 @@ keyword_tip:
data: {}
json: {}
#次卡-确认订单
beauty_card_confirm:
method: post
url: /api/janus/beauty_card/order/confirm
params: {}
data:
sku_id: ${sku_id}
number: ${number}
bctraceid: ""
use_bc_coupon: ${use_bc_coupon}
bc_coupon_id: ${bc_coupon_id}
json: {}
isLogin: 1
#新版本我的美券
......
......@@ -245,6 +245,15 @@ GIFT_LIST_DATA = os.path.join(BASE_DIR, "backend_auto/test_backend_data/hybrid_g
#商祥页-优惠券列表-领取
HYBRID_GET_GIFT_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "hybrid_get_gift_request.yaml")
GET_GIFT_DATA = os.path.join(BASE_DIR, "backend_auto/test_backend_data/hybrid_get_gift_data", "get_gift_data.yaml")
#商祥页-美券列表-我的美券点击-744版本及以后-新接口
PRODUCT_COUPON_MY_LIST = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_data", "product_coupon_my_list.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")
#次卡-确认订单
BEAUTY_CARD_CONFIRM = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_data", "beauty_card_confirm.yaml")
#捜索结果页-医生/医院tab
CONTENTV6_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "search_request.yaml")
CONTENTV6 = os.path.join(BASE_DIR, "backend_auto/test_backend_data/search_data", "content_v6.yaml")
......
import pytest
from all_backend_api.hybrid_promotion_request import hybrid_promotion_request
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
class TestTelatedServiceData:
data = BaseRequest().api_load(path_setting.RELATED_SERVICE_DATA)
related_service_data_case, related_service_data_data = get_ids(data, "related_service_data")
@pytest.mark.parametrize("param", related_service_data_data, ids=related_service_data_case)
def test_related_service_data(self, param):
r = hybrid_promotion_request().related_service_data(param["service_id"], param["page"])
if r["error"] == 0:
assert r["error"] == param["assert_error"]
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 TestBeautyCardConfirm:
data = BaseRequest().api_load(path_setting.BEAUTY_CARD_CONFIRM)
beauty_card_confirm_case, beauty_card_confirm_data = get_ids(data, "beauty_card_confirm")
@pytest.mark.parametrize("param", beauty_card_confirm_data, ids=beauty_card_confirm_case)
def test_beauty_card_confirm(self, param):
r = janus_request().beauty_card_confirm(param["sku_id"], param["number"], param["use_bc_coupon"], param["bc_coupon_id"])
if r["error"] == 0:
assert r["error"] == param["assert_error"]
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 TestProductCouponMyList:
data = BaseRequest().api_load(path_setting.PRODUCT_COUPON_MY_LIST)
product_coupon_my_list_case, product_coupon_my_list_data = get_ids(data, "product_coupon_my_list")
@pytest.mark.parametrize("param", product_coupon_my_list_data, ids=product_coupon_my_list_case)
def test_product_coupon_my_list(self, param):
r = janus_request().product_coupon_my_list(param["start_num"], param["tab_id"])
if r["error"] == 0:
assert r["error"] == param["assert_error"]
related_service_data:
-
case: "商祥页-推荐商品列表-接口调用成功case"
service_id: "5815040"
page: 1
assert_error: 0
\ No newline at end of file
beauty_card_confirm:
-
case: "次卡-确认订单-接口调用成功case"
sku_id: "10176"
number: 1
use_bc_coupon: 1
bc_coupon_id: 0
assert_error: 0
product_coupon_my_list:
-
case: "我的美券列表(新)-校验接口返回成功case"
start_num: 0
tab_id: 0
assert_error: 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