Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
backend_auto
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
邓莹莹
backend_auto
Commits
11c8a2fc
Commit
11c8a2fc
authored
Jun 04, 2021
by
aha
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更美热门榜/医生医院sug列表
parent
cfc3d3ed
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
135 additions
and
0 deletions
+135
-0
janus_request.py
all_backend_api/janus_request.py
+15
-0
janus_request.yaml
all_backend_api/janus_request.yaml
+12
-0
search_request.py
all_backend_api/search_request.py
+6
-0
search_request.yaml
all_backend_api/search_request.yaml
+12
-0
path_setting.py
path_setting.py
+7
-0
test_keyword_tip.py
test_backend_case/janus_case/test_keyword_tip.py
+25
-0
test_hot.py
test_backend_case/search_case/test_hot.py
+19
-0
keyword_tip.yaml
test_backend_data/janus_data/keyword_tip.yaml
+33
-0
hot.yaml
test_backend_data/search_data/hot.yaml
+6
-0
No files found.
all_backend_api/janus_request.py
View file @
11c8a2fc
...
...
@@ -4,7 +4,10 @@ from in_common.base_request import BaseRequest
class
janus_request
(
BaseRequest
):
def
__init__
(
self
):
#捜索结果页-综合/百科tab
self
.
data
=
self
.
api_load
(
path_setting
.
CONTENTV7_CONFIG
)
#医院主页捜索
self
.
data
=
self
.
api_load
(
path_setting
.
HOSPITALSEARCH_CONFIG
)
#品类聚合页面商品列表
...
...
@@ -13,6 +16,9 @@ class janus_request(BaseRequest):
#品类聚合页面标签和专场
self
.
data
=
self
.
api_load
(
path_setting
.
POLYMER_CONFIG
)
#医生医院sug列表
self
.
data
=
self
.
api_load
(
path_setting
.
KEYWORDTIP_CONFIG
)
#搜索结果页-综合/百科tab
def
content_v7
(
self
,
query
,
device_id
,
current_city_id
,
version
,
is_first
,
tab_type
,
offset
):
#搜索词
...
...
@@ -89,6 +95,15 @@ class janus_request(BaseRequest):
return
self
.
api_send
(
self
.
data
[
"polymer"
])
#医生医院sug列表
def
keyword_tip
(
self
,
query
,
lat
,
lng
,
version
,
device_id
=
'97B6764B-2135-4761-9911-701C38CBC272'
,
tab_type
=
'0'
):
self
.
params
[
'query'
]
=
query
self
.
params
[
'lat'
]
=
lat
self
.
params
[
'lng'
]
=
lng
self
.
params
[
'version'
]
=
version
return
self
.
api_send
(
self
.
data
[
'keyword_tip'
])
if
__name__
==
'__main__'
:
#打印购物车-猜你喜欢列表接口返回
...
...
all_backend_api/janus_request.yaml
View file @
11c8a2fc
...
...
@@ -84,6 +84,18 @@ polymer:
data
:
{
}
json
:
{
}
#医生医院sug列表
keyword_tip
:
method
:
GET
url
:
/api/janus/search/keyword/tip
params
:
query
:
${query}
lat
:
${lat}
lng
:
${lng}
version
:
${version}
data
:
{}
json
:
{}
...
...
all_backend_api/search_request.py
View file @
11c8a2fc
...
...
@@ -6,6 +6,7 @@ class search_request(BaseRequest):
def
__init__
(
self
):
self
.
data
=
self
.
api_load
(
path_setting
.
KEYWORDS_CONFIG
)
#keywords路径
self
.
data
=
self
.
api_load
(
path_setting
.
CONTENTV6_CONFIG
)
#content_v6路径
self
.
data
=
self
.
api_load
(
path_setting
.
HOT_CONFIG
)
# hot路径
#搜索首页-热门搜索模块(点击搜索框即调接口)
def
keywords
(
self
,
current_city_id
,
search_tab
):
...
...
@@ -32,3 +33,8 @@ class search_request(BaseRequest):
# 请求的size
self
.
params
[
'size'
]
=
size
return
self
.
api_send
(
self
.
data
[
"content_v6"
])
# 搜索首页-更美热门榜模块(点击搜索框即调接口)
def
hot
(
self
,
version
,
device_id
=
'97B6764B-2135-4761-9911-701C38CBC272'
):
self
.
params
[
"version"
]
=
version
return
self
.
api_send
(
self
.
data
[
"hot"
])
all_backend_api/search_request.yaml
View file @
11c8a2fc
#搜索首页-热门搜索模块(点击搜索框即调接口)
keywords
:
method
:
get
#接口地址
...
...
@@ -9,6 +10,7 @@ keywords:
data
:
{}
json
:
{}
#搜索结果页-医生/医院tab
content_v6
:
method
:
get
#接口地址
...
...
@@ -25,3 +27,12 @@ content_v6:
size
:
${size}
data
:
{}
json
:
{}
# 搜索首页-更美热门榜模块(点击搜索框即调接口)
hot
:
method
:
get
#接口地址
url
:
/api/search/hot
#列出所有定义函数时的参数
params
:
version
:
${version}
\ No newline at end of file
path_setting.py
View file @
11c8a2fc
...
...
@@ -166,6 +166,13 @@ THIRD_PHONE_LOGIN_CONFIG = os.path.join(BASE_DIR,"backend_auto/all_backend_api",
THIRD_PHONE_LOGIN
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/account_data"
,
"login_thirdphone"
)
#医生医院sug列表
KEYWORDTIP_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"janus_request.yaml"
)
KEYWORDTIP
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/janus_data"
,
"keyword_tip.yaml"
)
#搜索首页-更美热门榜
HOT_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"search_request.yaml"
)
HOT
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/search_data"
,
"hot.yaml"
)
if
__name__
==
'__main__'
:
print
(
"=========="
,
LIVEYAML_CONFIG
)
test_backend_case/janus_case/test_keyword_tip.py
0 → 100644
View file @
11c8a2fc
import
pytest
import
path_setting
from
all_backend_api.janus_request
import
janus_request
from
ids_list
import
get_ids
from
in_common.base_request
import
BaseRequest
#医生医院sug列表
class
TestKeywordTip
:
data
=
BaseRequest
()
.
api_load
(
path_setting
.
KEYWORDTIP
)
keywordtip_case
,
keywordtip_data
=
get_ids
(
data
,
"keyword_tip"
)
@pytest.mark.parametrize
(
"param"
,
keywordtip_data
,
ids
=
keywordtip_case
)
def
test_keyword_tip
(
self
,
param
):
print
(
param
[
'query'
])
r
=
janus_request
()
.
keyword_tip
(
param
[
"query"
],
param
[
"lat"
],
param
[
"lng"
],
param
[
"version"
])
if
not
r
[
"data"
][
"aggregation_card"
]:
print
(
'医生医院卡片信息'
)
assert
r
[
"data"
][
"tip_keys"
][
0
][
"type_flag"
]
==
param
[
"assert1"
]
assert
r
[
"data"
][
"tip_keys"
][
11
][
"type_flag"
]
==
param
[
"assert2"
]
if
r
[
"data"
][
"aggregation_card"
]
:
print
(
'百科卡片信息'
)
assert
r
[
"data"
][
"aggregation_card"
][
"child"
][
0
][
"type_flag"
]
==
param
[
"assert1"
]
assert
r
[
"data"
][
"tip_keys"
][
0
][
"type_flag"
]
==
param
[
"assert2"
]
\ No newline at end of file
test_backend_case/search_case/test_hot.py
0 → 100644
View file @
11c8a2fc
import
pytest
import
path_setting
from
all_backend_api.search_request
import
search_request
from
ids_list
import
get_ids
from
in_common.base_request
import
BaseRequest
#搜索首页-更美热门榜
class
TestHot
:
data
=
BaseRequest
()
.
api_load
(
path_setting
.
HOT
)
hot_case
,
hot_data
=
get_ids
(
data
,
"hot"
)
@pytest.mark.parametrize
(
"param"
,
hot_data
,
ids
=
hot_case
)
def
test_hot
(
self
,
param
):
r
=
search_request
()
.
hot
(
param
[
"version"
])
if
r
[
"error"
]
==
0
:
print
(
"接口调用成功了~"
)
assert
len
([
"data"
])
!=
param
[
"assert"
]
\ No newline at end of file
test_backend_data/janus_data/keyword_tip.yaml
0 → 100644
View file @
11c8a2fc
keyword_tip
:
-
#输入北京,接口有数据召回且SUG列表召回北京开头的医院信息
case
:
"
输入北京,接口有数据召回且SUG列表召回北京开头的医院信息"
query
:
"
北京"
lat
:
"
39.9"
lng
:
"
116.4"
version
:
"
742.0"
assert1
:
unknown
assert2
:
hospital
# -
# #测试环境无法验证该用例
# #输入杨,接口有数据召回且SUG列表召回杨开头的医生信息
# case: "输入杨,接口有数据召回且SUG列表召回杨开头的医生信息"
# query: "杨"
# lat: "39.9"
# lng: "116.4"
# version: "742.0"
# assert1: unknown
# assert2: doctor
-
#输入双眼皮,接口有数据召回且SUG列表召回双眼皮下的项目百科信息
case
:
"
输入双眼皮,接口有数据召回且SUG列表召回双眼皮下的项目百科信息"
query
:
"
双眼皮"
lat
:
"
39.9"
lng
:
"
116.4"
version
:
"
742.0"
assert1
:
project
assert2
:
unknown
\ No newline at end of file
test_backend_data/search_data/hot.yaml
0 → 100644
View file @
11c8a2fc
hot
:
-
#进入搜索首页-成功调用搜索首页接口
case
:
"
进入搜索首页-成功调用搜索首页接口"
version
:
"
743.0"
assert
:
0
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment