Commit 588e153f authored by 张慧's avatar 张慧

次卡商祥页-适用机构列表接口case完善

parent c000a00b
......@@ -19,9 +19,6 @@ class janus_request(BaseRequest):
#医生医院sug列表
self.data = self.api_load(path_setting.KEYWORDTIP_CONFIG)
#次卡商详页
self.data = self.api_load(path_setting.BEAUTY_CARD_DETAIL_CONFIG)
#直播polling循环
self.data = self.api_load(path_setting.POLLING_CONFIG)
......@@ -199,16 +196,13 @@ class janus_request(BaseRequest):
return self.api_send(self.data["beauty_card_detail"])
# 次卡商详-适应机构列表
def service_hospital(self, offset, sku_id, size, version, current_city_id, lat, lng):
self.params['offset'] = offset
def beauty_card_service_hospital(self, sku_id, size, offset, sort_type):
self.params['sku_id'] = sku_id
self.params['size'] = size
self.params['version'] = version
self.params['current_city_id'] = current_city_id
self.params['lat'] = lat
self.params['lng'] = lng
self.params['offset'] = offset
self.params['sort_type'] = sort_type
return self.api_send(self.data["service_hospital"])
return self.api_send(self.data["beauty_card_service_hospital"])
# 首页(灰度)feed-推荐商品类型tab[除必要参数外其余参数使用默认参数形式方便之后调整]
def feed_service(self, tab_value, first_load, version = '7.42.2' , device_id = 'androidid_49973caa1b578d85', current_city_id = 'beijing'):
......@@ -238,37 +232,37 @@ class janus_request(BaseRequest):
if __name__ == '__main__':
#打印购物车-猜你喜欢列表接口返回
print(janus_request().mine_guess_you_like())
#打印商祥页-详情接口返回
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())
print("fgx")
#品类聚合页面标签和专场
print(janus_request().polymer())
print("fgx")
#打印次卡-确认订单接口返回
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_order_submit("12345678912", "10176", 1, 1, 0, 0))
#打印次卡-支付平台接口返回
print(janus_request().beauty_card_payment_method("101670448736595"))
print(janus_request().product_my_list(0, 0))
# #打印购物车-猜你喜欢列表接口返回
# print(janus_request().mine_guess_you_like())
# #打印商祥页-详情接口返回
# 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())
# print("fgx")
#
# #品类聚合页面标签和专场
# print(janus_request().polymer())
# print("fgx")
#
# #打印次卡-确认订单接口返回
# 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_order_submit("12345678912", "10176", 1, 1, 0, 0))
# #打印次卡-支付平台接口返回
# print(janus_request().beauty_card_payment_method("101670448736595"))
#
# print(janus_request().product_my_list(0, 0))
# # 次卡商详页
# print(janus_request().beauty_card_detail("100018", "10046", "100018", "7.44.0", "beijing", "40.001879", "116.487194"))
# 次卡商详页-适应机构
print(janus_request().beauty_card_detail("100018", "10046", "100018", "7.44.0", "beijing", "40.001879", "116.487194"))
# 次卡商详页
print(janus_request().service_hospital("0", "10046", "1", "7.44.0", "beijing", "40.001879", "116.487194"))
print(janus_request().beauty_card_service_hospital("10046", 20, 0, 1))
# #打印购物车-猜你喜欢列表接口返回
# print(janus_request().mine_guess_you_like())
# #打印商祥页-详情接口返回
......@@ -304,12 +298,12 @@ if __name__ == '__main__':
# print(janus_request().beauty_card_payment_delete("101353630959868"))
# #打印次卡-申请退款接口返回
# print(janus_request().beauty_card_refund_info("102217820485006"))
#打印次卡-提交退款申请接口返回
# #打印次卡-提交退款申请接口返回
# print(janus_request().beauty_card_refund_submit("102813852173916", 3, "个人身体原因", 0))
print(janus_request().beauty_card_order_detail(102247770691611))
# print(janus_request().beauty_card_order_detail(102247770691611))
# print(janus_request().product_my_list(0, 0))
#直播-点击【设置封面】
print("直播-点击【设置封面】")
print(janus_request().page_rules("744.2", "beijing", "post_add_pic"))
# #直播-点击【设置封面】
# print("直播-点击【设置封面】")
# print(janus_request().page_rules("744.2", "beijing", "post_add_pic"))
......@@ -145,17 +145,14 @@ beauty_card_detail:
#次卡商详页-适应机构列表
service_hospital:
beauty_card_service_hospital:
method: GET
url: /api/janus/beauty_card/service_hospital
params:
offset: ${offset}
sku_id: ${sku_id}
size: ${size}
version: ${version}
current_city_id: ${current_city_id}
lat: ${lat}
lng: ${lng}
offset: ${offset}
sort_type: ${sort_type}
data: { }
json: { }
......
......@@ -518,12 +518,10 @@ CHECK_SPU_IDS = os.path.join(BASE_DIR, "backend_auto/test_om_data/beautycard_dat
#次卡商详页
BEAUTY_CARD_DETAIL_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "janus_request.yaml")
BEAUTY_CARD_DETAIL = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_data", "beauty_card_detail.yaml")
#次卡商详页-适应机构列表
SERVICE_HOSPITAL_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "janus_request.yaml")
SERVICE_HOSPITAL = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_data", "service_hospital.yaml")
BEAUTY_CARD_SERVICE_HOSPITAL = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_data", "beauty_card_service_hospital.yaml")
#免费招募背景图片
FREE_RECRUIT_BANNER_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "feed_request.yaml")
......
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.janus_request import janus_request
class TestServiceHospital:
data = BaseRequest().api_load(path_setting.BEAUTY_CARD_SERVICE_HOSPITAL)
beauty_card_service_hospital_case, beauty_card_service_hospital_data = get_ids(data, "beauty_card_service_hospital")
@pytest.mark.parametrize("param", beauty_card_service_hospital_data, ids=beauty_card_service_hospital_case)
def test_beauty_card_service_hospital(self, param):
r = janus_request().beauty_card_service_hospital(param["sku_id"], param["size"],
param["offset"], param["sort_type"])
if param["sort_type"] == 1: #智能排序
assert len(r["data"]["service_hospital_list"]) > 0
if param["sort_type"] == 2: #离我最近
assert len(r["data"]["service_hospital_list"]) > 0
if param["sort_type"] == 3: #好评优先
assert len(r["data"]["service_hospital_list"]) > 0
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.janus_request import janus_request
class TestServiceHospital:
data = BaseRequest().api_load(path_setting.SERVICE_HOSPITAL)
service_hospital_case, service_hospital_data = get_ids(data, "service_hospital")
@pytest.mark.parametrize("param", service_hospital_data, ids=service_hospital_case)
def test_service_hospital(self, param):
r = janus_request().service_hospital(param["offset"], param["sku_id"], param["size"], param["version"], param["current_city_id"], param["lat"], param["lng"])
if r["error"] == 0:
assert len(r["data"]["service_hospital_list"]) > param["assert"]
beauty_card_service_hospital:
#次卡商详页-适用机构列表
-
case: "校验次卡适用机构列表接口-智能排序case"
sku_id: 10046
size: 20
offset: 0
sort_type: 1
assert_error: 0
-
case: "校验次卡适用机构列表接口-离我最近case"
sku_id: 10046
size: 20
offset: 0
sort_type: 2
assert_error: 0
-
case: "校验次卡适用机构列表接口-好评优先case"
sku_id: 10046
size: 20
offset: 0
sort_type: 3
assert_error: 0
service_hospital:
#次卡商详页-适用机构列表
-
case: "次卡适用机构列表spuid=100018"
assert: 0
offset: 0
sku_id: 10046
size: 1
version: 7.44.0
current_city_id: beijing
lat: 40.001879
lng: 116.487194
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