Commit 8daadceb authored by aha's avatar aha

医院/医生tab捜索结果

parents 6c5bb1d0 bde756a2
...@@ -53,6 +53,19 @@ class janus_request(BaseRequest): ...@@ -53,6 +53,19 @@ class janus_request(BaseRequest):
def mine_guess_you_like(self): def mine_guess_you_like(self):
return self.api_send(self.data["mine_guess_you_like"]) return self.api_send(self.data["mine_guess_you_like"])
#商祥页-详情
def product_detail(self, service_id, service_item_id, version):
self.params["service_id"] = service_id
self.params["service_item_id"] = service_item_id
self.params["version"] = version
return self.api_send(self.data["product_detail"])
#商祥页-sku信息
def sku_info(self, service_id, service_item_id):
self.params["service_id"] = service_id
self.params["service_item_id"] = service_item_id
return self.api_send(self.data["sku_info"])
# 品类聚合页面商品列表 # 品类聚合页面商品列表
def tag_service(self, size, tag_ids, offset, tag_id, version, device_id): def tag_service(self, size, tag_ids, offset, tag_id, version, device_id):
print("fgx") print("fgx")
...@@ -66,10 +79,13 @@ class janus_request(BaseRequest): ...@@ -66,10 +79,13 @@ class janus_request(BaseRequest):
return self.api_send(self.data["tag_service"]) return self.api_send(self.data["tag_service"])
if __name__ == '__main__': if __name__ == '__main__':
#打印购物车-猜你喜欢列表接口返回 #打印购物车-猜你喜欢列表接口返回
print(janus_request().mine_guess_you_like()) 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"))
#品类聚合页面商品列表接口返回 #品类聚合页面商品列表接口返回
print(janus_request().tag_service()) print(janus_request().tag_service())
......
...@@ -37,6 +37,27 @@ mine_guess_you_like: ...@@ -37,6 +37,27 @@ mine_guess_you_like:
json: {} json: {}
isLogin: 1 isLogin: 1
#商祥页-详情
product_detail:
method: get
url: /api/janus/product/detail
params:
service_id: ${service_id}
service_item_id: ${service_item_id}
version: ${version}
data: {}
json: {}
#商祥页-sku信息
sku_info:
method: get
url: /api/janus/product/detail/sku_info
params:
service_id: ${service_id}
service_item_id: ${service_item_id}
data: {}
json: {}
#品类聚合页面商品列表的 #品类聚合页面商品列表的
tag_service: tag_service:
method: GET method: GET
......
...@@ -11,6 +11,13 @@ class service_request(BaseRequest): ...@@ -11,6 +11,13 @@ class service_request(BaseRequest):
return self.api_send(self.data["home_v5"]) return self.api_send(self.data["home_v5"])
#商祥页-收藏
def service_favor(self):
return self.api_send(self.data["service_favor"])
if __name__ == '__main__': if __name__ == '__main__':
print(service_request().home_v5()) print(service_request().home_v5())
#打印商祥页-收藏接口返回
print(service_request().service_favor())
\ No newline at end of file
...@@ -6,3 +6,13 @@ home_v5: ...@@ -6,3 +6,13 @@ home_v5:
data: {} data: {}
json: {} json: {}
#商祥页-收藏
service_favor:
method: post
url: /api/service/favor/5857263/
params: {}
data: {}
json: {}
isLogin: 1
\ No newline at end of file
import path_setting
from in_common.base_request import BaseRequest
class services_request(BaseRequest):
def __init__(self):
self.data = self.api_load(path_setting.SERVICES_CONFIG)
#商祥页-分享
def share_data(self, p_id, u_id):
self.params["p_id"] = p_id
self.params["u_id"] = u_id
return self.api_send(self.data["share_data"])
if __name__ == '__main__':
#打印商祥页-分享接口返回
print(services_request().share_data("5857263", "618788"))
\ No newline at end of file
#商祥页-分享
share_data:
method: get
url: /api/services/share_data
params:
p_id: ${p_id}
u_id: ${u_id}
data: {}
json: {}
\ No newline at end of file
...@@ -127,6 +127,16 @@ UNREAD = os.path.join(BASE_DIR, "backend_auto/test_backend_data/notification_dat ...@@ -127,6 +127,16 @@ UNREAD = os.path.join(BASE_DIR, "backend_auto/test_backend_data/notification_dat
#标记为已读 #标记为已读
READALL = os.path.join(BASE_DIR, "backend_auto/test_backend_data/notification_data", "readall.yaml") READALL = os.path.join(BASE_DIR, "backend_auto/test_backend_data/notification_data", "readall.yaml")
#商祥页-详情
JANUS_PRODUCT_DETAIL = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_data", "product_detail.yaml")
#商祥页-sku信息
JANUS_SKU_INFO = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_data", "sku_info.yaml")
#商祥页-收藏
SERVICE_FAVOR = os.path.join(BASE_DIR, "backend_auto/test_backend_data/service_data", "service_favor.yaml")
#商祥页-分享
SERVICES_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "services_request.yaml")
SERVICES_SHARE_DATA = os.path.join(BASE_DIR, "backend_auto/test_backend_data/services_data", "share_data.yaml")
#捜索结果页-医生/医院tab #捜索结果页-医生/医院tab
CONTENTV6_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "search_request.yaml") 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") CONTENTV6 = os.path.join(BASE_DIR, "backend_auto/test_backend_data/search_data", "content_v6.yaml")
......
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 TestProductDetail:
data = BaseRequest().api_load(path_setting.JANUS_PRODUCT_DETAIL)
product_detail_case, product_detail_data = get_ids(data, "product_detail")
@pytest.mark.parametrize("param", product_detail_data, ids=product_detail_case)
def test_product_detail(self, param):
r = janus_request().product_detail(param["service_id"], param["service_item_id"], param["version"])
if r["error"] == 0:
assert r["error"] == param["assert_error"]
if r["error"] == 1:
assert r["message"] == param["assert_spu_message"]
# if r["error"] == -1:
# assert r["message"] == param["assert_version_message"]
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 TestSkuInfo:
data = BaseRequest().api_load(path_setting.JANUS_SKU_INFO)
sku_info_case, sku_info_data = get_ids(data, "sku_info")
@pytest.mark.parametrize("param", sku_info_data, ids=sku_info_case)
def test_sku_info(self, param):
r = janus_request().sku_info(param["service_id"], param["service_item_id"])
if r["error"] == 0:
assert r["error"] == param["assert_error"]
import pytest
from all_backend_api.service_request import service_request
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
class TestServiceFavor:
data = BaseRequest().api_load(path_setting.SERVICE_FAVOR)
service_favor_case, service_favor_data = get_ids(data, "service_favor")
@pytest.mark.parametrize("param", service_favor_data, ids=service_favor_case)
def test_service_favor(self, param):
r = service_request().service_favor()
if r["error"] == 0:
assert r["message"] == param["assert_message"]
print(service_request().service_favor())
import pytest
from all_backend_api.services_request import services_request
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
class TestShareData:
data = BaseRequest().api_load(path_setting.SERVICES_SHARE_DATA)
share_data_case, share_data_data = get_ids(data, "share_data")
@pytest.mark.parametrize("param", share_data_data, ids=share_data_case)
def test_share_data(self, param):
r = services_request().share_data(param["p_id"], param["u_id"])
if r["error"] == 0:
assert r["error"] == param["assert_error"]
# print(services_request().share_data())
product_detail:
-
case: "校验接口调用成功case"
service_id: "5857263"
service_item_id: "618788"
version: "7.43.0"
assert_error: 0
-
case: "校验spu_id错误case"
service_id: "585726"
service_item_id: "618788"
version: "7.43.0"
assert_spu_message: "美购不存在"
# -
# case: "校验sku_id错误case"
# service_id: "5857263"
# service_item_id: "61878"
# version: "7.43.0"
# assert_sku_message: ""
# -
# case: "校验不传版本号case"
# service_id: "5857263"
# service_item_id: "618788"
# assert_version_message: "服务器开小差儿了"
sku_info:
-
case: "校验接口返回成功case"
service_id: "5857263"
service_item_id: "618788"
assert_error: 0
\ No newline at end of file
service_favor:
-
case: "校验收藏成功case"
assert_message: "收藏成功"
\ No newline at end of file
share_data:
-
case: "校验接口返回成功case"
p_id: "5857263"
u_id: "618788"
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