Commit 11ed509f authored by 邓莹莹's avatar 邓莹莹

新增3个接口

parent f6ab5789
......@@ -197,6 +197,17 @@ class janus_request(BaseRequest):
return self.api_send(self.data["service_hospital"])
# 首页(灰度)feed-推荐商品类型tab[除必要参数外其余参数使用默认参数形式方便之后调整]
def feed_service(self, tab_value, first_load, version='7.42.2', device_id='androidid_49973caa1b578d85',
current_city_id='beijing'):
self.params['version'] = version
self.params['device_id'] = device_id
self.params['tab_value'] = tab_value
self.params['current_city_id'] = current_city_id
self.params['first_load'] = first_load
return self.api_send(self.data["feed_service"])
# 直播-点击【设置封面】
def page_rules(self, version, current_city_id, page_name, device_id = '97B6764B-2135-4761-9911-701C38CBC272'):
self.params['version'] = version
......
......@@ -285,6 +285,20 @@ beauty_card_order_detail:
json: {}
isLogin: 1
#首页(灰度)feed-推荐商品类型tab[除必要参数外其余参数使用默认参数形式方便之后调整]
feed_service:
method: get
url: /api/janus/product/mall/service_home_feed
params:
version: ${version}
device_id: ${device_id}
current_city_id: ${current_city_id}
tab_value: ${tab_value}
first_load: ${first_load}
data: {}
json: {}
isLogin: 0
#直播-点击【设置封面】
page_rules:
method: GET
......
......@@ -15,6 +15,14 @@ class service_request(BaseRequest):
def service_favor(self):
return self.api_send(self.data["service_favor"])
# 首页(灰度)feed-推荐机构&推荐医生tab[除必要参数外其余参数使用默认参数形式方便之后调整]
def feed_home(self, tab_value, input_type, version = '7.42.2' , device_id = 'androidid_49973caa1b578d85', current_city_id = 'beijing'):
self.params['version'] = version
self.params['device_id'] = device_id
self.params['tab_value'] = tab_value
self.params['current_city_id'] = current_city_id
self.params['input_type'] = input_type
return self.api_send(self.data["feed_home"])
if __name__ == '__main__':
print(service_request().home_v5())
......
......@@ -15,4 +15,17 @@ service_favor:
params: {}
data: {}
json: {}
isLogin: 1
\ No newline at end of file
isLogin: 1
#首页(灰度)feed-推荐机构&推荐医生tab[除必要参数外其余参数使用默认参数形式方便之后调整]
feed_home:
method: get
url: /api/service/home/feed
params:
version: ${version}
device_id: ${device_id}
current_city_id: ${current_city_id}
tab_value: ${tab_value}
input_type: ${input_type}
data: {}
json: {}
import path_setting
from in_common.base_request import BaseRequest
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'):
self.params["unit_id"] = unit_id
self.params["current_city_id"] = current_city_id
return self.api_send(self.data['service_list'])
\ No newline at end of file
#签到--其他tab 美购feed
service_list:
method: GET
url: /api/visual/service_list
params:
#组件id
unit_id : ${unit_id}
current_city_id : ${current_city_id}
data: {}
json: {}
is_Login: 1
_gtid=9025f29e058e11ec9fb57e560ecdb5bc804;sessionid=cjmm2op613qiesltkxnye2pf4lqcj9ny
\ No newline at end of file
_gtid=9dfb609e0a3111ecbe53ce20f19931a34194;sessionid=nbvqfb0p9k8hqdhdr7r7bdlfn4j8dbqk
\ No newline at end of file
......@@ -78,8 +78,12 @@ TOPIC_DETAIL = os.path.join(BASE_DIR, "on_line_product/test_backend_data/topic_d
# 日记贴-点赞&取消点赞--详情页内部
TOPIC_VOTE = os.path.join(BASE_DIR, "on_line_product/test_backend_data/topic_data", "vote.yaml")
# 首页feed流tab切换--推荐商品类型tab[除必要参数外其余参数使用默认参数形式方便之后调整]
FEED_TAB_SERVICE = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_data", "product_mall_service_home_feed.yaml")
# 签到--其他 tab feed --也是总的 visual 配置项
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")
# 帖子详情页内容--也是总的tractate接口的配置
TRACTATE_CONFIG = os.path.join(BASE_DIR, "on_line_product/all_backend_api", "tractate_request.yaml")
......@@ -221,6 +225,9 @@ GMAI_PLASTIC_CHECCK_STYLE_CLASSTIFY_DATA = os.path.join(BASE_DIR, "on_line_produ
# 3D变脸
GMAI_PLASTIC_ANALYSIS_V2_DATA = os.path.join(BASE_DIR, "on_line_product/test_backend_data/gmai_data", "plastic_analysis_v2.yaml")
# 首页(灰度)feed-推荐机构&推荐医生tab[除必要参数外其余参数使用默认参数形式方便之后调整]
FEED_TAB_SERVICE_DOCTORS = os.path.join(BASE_DIR, "backend_auto/test_backend_data/service_data", "home_feed.yaml")
# 新版本我的美券列表
JANUS_PRODUCT_MY_LIST_DATA = os.path.join(BASE_DIR, "on_line_product/test_backend_data/janus_data", "product_my_list.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 TestProductMallServiceHomeFeed:
data = BaseRequest().api_load(path_setting.FEED_TAB_SERVICE)
productmallservicehomefeed_case, productmallservicehomefeed_data = get_ids(data, "feed_service")
@pytest.mark.parametrize("param", productmallservicehomefeed_data, ids=productmallservicehomefeed_case)
def test_product_mall_service_home_feed(self,param):
r = janus_request().feed_service(param["tab_value"], param["first_load"])
assert r["error"] == 0
if r["error"] == 0:
features = r.get("data").get("result",[])
print(len(features))
assert len(features) > param["assert"]
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.service_request import service_request
class TestProductMallServiceHomeFeed:
data = BaseRequest().api_load(path_setting.FEED_TAB_SERVICE_DOCTORS)
productmallservicehomefeed_case, productmallservicehomefeed_data = get_ids(data, "home_feed")
@pytest.mark.parametrize("param", productmallservicehomefeed_data, ids=productmallservicehomefeed_case)
def test_product_mall_service_home_feed(self,param):
r = service_request().feed_home(param["tab_value"], param["input_type"])
assert r["error"] == 0
if r["error"] == 0:
s = param["tab_value"] + "s"
features = r["data"][s]
assert len(features) > param["assert"]
import pytest
import path_setting
from all_backend_api.visual_request import visual_request
from ids_list import get_ids
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"]
feed_service:
#成功登录case
-
case: "请求成功,有数据返回"
current_city_id: "beijing"
tab_value: "choice"
version: "7.42.2"
first_load: 1
assert: 0
- case: "推荐内容/接口请求成功,有数据返回"
current_city_id: "beijing"
tab_value: "home_video"
version: "7.42.2"
first_load: 1
assert: 0
- case: "直播tab接口请求成功,有数据返回"
current_city_id: "beijing"
tab_value: "customize_commodity"
first_load: 1
version: "7.42.2"
assert: 0
\ No newline at end of file
home_feed:
#成功登录case
-
case: "推荐医生.接口请求成功,有数据返回"
current_city_id: "beijing"
tab_value: "doctor"
version: "7.42.2"
input_type: 3
assert: 0
- case: "推荐医院,接口请求成功,有数据返回"
current_city_id: "beijing"
tab_value: "hospital"
version: "7.42.2"
input_type: 3
assert: 0
#签到--其他tab 美购feed
service_list:
-
case: "签到--其他tab 美购feed 校验返回数据数"
assert: 0
len: 10
unit_id: 17923
\ 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