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
c17a171d
Commit
c17a171d
authored
Jun 04, 2021
by
张淑琴
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
发送案例及美券
parent
05b5dced
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
102 additions
and
5 deletions
+102
-5
web_request.py
all_doctor_api/web_request.py
+10
-1
web_request.yaml
all_doctor_api/web_request.yaml
+21
-3
base_request.py
in_common/base_request.py
+3
-1
path_setting.py
path_setting.py
+5
-0
test_conversation_coupon.py
test_doctor_case/web_case/test_conversation_coupon.py
+20
-0
test_conversation_diary.py
test_doctor_case/web_case/test_conversation_diary.py
+23
-0
conversation_coupon.yaml
test_doctor_data/web_data/conversation_coupon.yaml
+13
-0
conversation_diary.yaml
test_doctor_data/web_data/conversation_diary.yaml
+7
-0
No files found.
all_doctor_api/web_request.py
View file @
c17a171d
...
...
@@ -34,6 +34,13 @@ class web_request(BaseRequest):
def
service
(
self
):
return
self
.
api_send
(
self
.
ACCOUNT_URL
[
"service"
])
def
conversation_diary
(
self
,
doctor_user_id
):
self
.
params
[
"doctor_user_id"
]
=
doctor_user_id
return
self
.
api_send
(
self
.
ACCOUNT_URL
[
"conversation_diary"
])
def
conversation_coupon
(
self
,
doctor_user_id
):
self
.
params
[
"doctor_user_id"
]
=
doctor_user_id
return
self
.
api_send
(
self
.
ACCOUNT_URL
[
"conversation_coupon"
])
...
...
@@ -43,9 +50,11 @@ if __name__ == '__main__':
print
(
web_request
()
.
account_unreadbadgecount
())
print
(
web_request
()
.
article_videotoken
())
print
(
web_request
()
.
doctor_submechanisms
())
print
(
"列表页"
)
print
(
web_request
()
.
conversation
(
0
,
1
))
print
(
web_request
()
.
service_offline
(
"209992"
,
"PC8uTySuxipukIMuqNV1OPB376C2ZZ3g"
))
print
(
web_request
()
.
conversation_unread_list
(
1
))
print
(
web_request
()
.
service
())
print
(
"发送"
)
print
(
web_request
()
.
conversation_diary
(
602329
))
print
(
web_request
()
.
conversation_coupon
(
602329
))
all_doctor_api/web_request.yaml
View file @
c17a171d
...
...
@@ -30,7 +30,7 @@ doctor_submechanisms:
conversation
:
method
:
get
url
:
/api/web/conversation
param
:
param
s
:
is_star
:
${is_star}
page
:
${page}
data
:
{}
...
...
@@ -51,7 +51,7 @@ service_offline:
conversation_unread_list
:
method
:
get
url
:
/api/web/conversation/unread_list
param
:
param
s
:
page
:
${page}
data
:
{}
json
:
{}
...
...
@@ -60,7 +60,25 @@ conversation_unread_list:
service
:
method
:
get
url
:
/api/web/service
param
:
{}
params
:
{}
data
:
{}
json
:
{}
isLogin
:
1
#需要登录
conversation_diary
:
method
:
get
url
:
/api/web/conversation/diary
params
:
doctor_user_id
:
${doctor_user_id}
data
:
{}
json
:
{}
isLogin
:
1
#需要登录
conversation_coupon
:
method
:
get
url
:
/api/web/conversation/coupon
params
:
doctor_user_id
:
${doctor_user_id}
data
:
{}
json
:
{}
isLogin
:
1
#需要登录
in_common/base_request.py
View file @
c17a171d
...
...
@@ -77,7 +77,9 @@ class BaseRequest:
# url_host = host['develop_host']['doctor']
# elif host["develop_host"].get("backend") is not None:
# url_host = host['develop_host']['backend']
print
(
'*'
*
100
)
print
(
req
)
print
(
'*'
*
100
)
raw
=
yaml
.
dump
(
req
)
# 将一个python对象生成为yaml文档
for
key
,
value
in
self
.
params
.
items
():
raw
=
raw
.
replace
(
f
"${{{key}}}"
,
repr
(
value
))
...
...
path_setting.py
View file @
c17a171d
...
...
@@ -181,6 +181,11 @@ CONVERSATION = os.path.join(BASE_DIR, "backend_auto/test_doctor_data/web_data",
CONVERSATIONUNREADLIST
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_doctor_data/web_data"
,
"conversation_unread_list.yaml"
)
#医生后台--点击发送商品按钮
SERVICE
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_doctor_data/web_data"
,
"service.yaml"
)
#医生后台--点击发送案例按钮
CONVERSATIONDIARY
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_doctor_data/web_data"
,
"conversation_diary.yaml"
)
#医生后台--点击发送优惠券按钮
CONVERSATIONCOUPON
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_doctor_data/web_data"
,
"conversation_coupon.yaml"
)
if
__name__
==
'__main__'
:
...
...
test_doctor_case/web_case/test_conversation_coupon.py
0 → 100644
View file @
c17a171d
import
pytest
from
ids_list
import
get_ids
import
path_setting
from
in_common.base_request
import
BaseRequest
from
all_doctor_api.web_request
import
web_request
class
TestService
:
data
=
BaseRequest
()
.
api_load
(
path_setting
.
CONVERSATIONCOUPON
)
conversationcoupon_case
,
conversationcoupon_data
=
get_ids
(
data
,
"conversation_coupon"
)
@pytest.mark.parametrize
(
"param"
,
conversationcoupon_data
,
ids
=
conversationcoupon_case
)
def
test_conversation_coupon
(
self
,
param
):
'''发送美券按钮'''
r
=
web_request
()
.
conversation_coupon
(
param
[
"doctor_user_id"
])
if
r
[
"error"
]
==
0
:
data1
=
r
.
get
(
"data"
,
[])
assert
len
(
data1
)
>=
param
[
"assert"
]
test_doctor_case/web_case/test_conversation_diary.py
0 → 100644
View file @
c17a171d
import
pytest
from
ids_list
import
get_ids
import
path_setting
from
in_common.base_request
import
BaseRequest
from
all_doctor_api.web_request
import
web_request
class
TestConversationDiary
:
data
=
BaseRequest
()
.
api_load
(
path_setting
.
CONVERSATIONDIARY
)
conversationdiary_case
,
conversationdiary_data
=
get_ids
(
data
,
"conversation_diary"
)
@pytest.mark.parametrize
(
"param"
,
conversationdiary_data
,
ids
=
conversationdiary_case
)
def
test_conversation_diary
(
self
,
param
):
'''点击发送案例按钮'''
r
=
web_request
()
.
conversation_diary
(
param
[
"doctor_user_id"
])
print
(
r
)
#r = web_request().conversation_diary()
if
r
[
"error"
]
==
0
:
data
=
r
.
get
(
"data"
,
[])
assert
len
(
data
)
>=
param
[
"assert"
]
test_doctor_data/web_data/conversation_coupon.yaml
0 → 100644
View file @
c17a171d
conversation_coupon
:
#私信点击发送优惠券case
-
case
:
"
点击私信发送优惠券按钮"
doctor_user_id
:
"
602329"
assert
:
0
-
case
:
"
点击私信发送优惠券按钮接口报错"
doctor_user_id
:
"
602329"
assert
:
0
assert_message
:
'
缺少参数:
doctor_user_id'
assert_data
:
None
\ No newline at end of file
test_doctor_data/web_data/conversation_diary.yaml
0 → 100644
View file @
c17a171d
conversation_diary
:
#私信点击发送案例case
-
case
:
"
点击私信发送案例按钮"
doctor_user_id
:
602329
assert
:
0
\ No newline at end of file
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