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
d993b547
Commit
d993b547
authored
Aug 20, 2021
by
张淑琴
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
私信配置部分case
parent
9139994c
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
114 additions
and
0 deletions
+114
-0
web3_request.py
all_doctor_api/web3_request.py
+8
-0
web3_request.yaml
all_doctor_api/web3_request.yaml
+11
-0
path_setting.py
path_setting.py
+1
-0
test_conversation_robot_add_message.py
...tor_case/web3_case/test_conversation_robot_add_message.py
+19
-0
conversation_robot_add_message.yaml
...doctor_data/web3_data/conversation_robot_add_message.yaml
+75
-0
No files found.
all_doctor_api/web3_request.py
View file @
d993b547
...
...
@@ -7,8 +7,16 @@ class web3_request(BaseRequest):
self
.
CONVERSATION_ROBOT
=
self
.
api_load
(
path_setting
.
CONVERSATION_ROBOT
)
def
conversation_robot_get_page
(
self
):
#获取页面类型
return
self
.
api_send
(
self
.
CONVERSATION_ROBOT
[
"conversation_robot_get_page"
])
def
conversation_robot_add_message
(
self
,
message
,
csrfmiddlewaretoken
):
#添加私信机器人配置
self
.
params
[
"message"
]
=
message
self
.
params
[
"csrfmiddlewaretoken"
]
=
csrfmiddlewaretoken
return
self
.
api_send
(
self
.
CONVERSATION_ROBOT
[
"conversation_robot_add_message"
])
if
__name__
==
'__main__'
:
print
(
web3_request
()
.
conversation_robot_get_page
())
print
(
web3_request
()
.
conversation_robot_add_message
(
'{"default":[{"name":"","page_type":"0","tag_id":"","tag_name":"","doctor_user_id":602329,"msg_list":[{"id":168,"type":"0","content":"测试"}]}],"personality":[]}'
,
"qzDd1CYV1LngDvQaGjgq4gKoHOPyieHk"
))
all_doctor_api/web3_request.yaml
View file @
d993b547
...
...
@@ -5,4 +5,14 @@ conversation_robot_get_page:
data
:
{}
json
:
{}
isLogin
:
1
#需要登录
conversation_robot_add_message
:
method
:
post
url
:
/api/web3/conversation/robot/add_message
params
:
{}
data
:
message
:
${message}
csrfmiddlewaretoken
:
${csrfmiddlewaretoken}
json
:
{}
isLogin
:
1
#需要登录
\ No newline at end of file
path_setting.py
View file @
d993b547
...
...
@@ -483,6 +483,7 @@ CONVERSATIONUSERID=os.path.join(BASE_DIR, "backend_auto/test_doctor_data/web_dat
#医生后台-私信机器人
CONVERSATION_ROBOT
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_doctor_api"
,
"web3_request.yaml"
)
ROBOTGETPAGE
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_doctor_data/web3_data"
,
"conversation_robot_get_page.yaml"
)
ROBOTADDMESSAGE
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_doctor_data/web3_data"
,
"conversation_robot_add_message.yaml"
)
#医生后台-服务资源
...
...
test_doctor_case/web3_case/test_conversation_robot_add_message.py
0 → 100644
View file @
d993b547
import
pytest
from
ids_list
import
get_ids
import
path_setting
from
in_common.base_request
import
BaseRequest
from
all_doctor_api.web3_request
import
web3_request
class
TestConversationRobotAddMessage
:
data
=
BaseRequest
()
.
api_load
(
path_setting
.
ROBOTADDMESSAGE
)
robot_add_message_case
,
robot_add_message_data
=
get_ids
(
data
,
"conversation_robot_add_message"
)
@pytest.mark.parametrize
(
"param"
,
robot_add_message_data
,
ids
=
robot_add_message_case
)
def
test_conversation_robot_add_message
(
self
,
param
):
'''私信机器人-添加私信配置'''
r
=
web3_request
()
.
conversation_robot_add_message
(
param
[
"message"
],
param
[
"csrfmiddlewaretoken"
])
if
r
[
"error"
]
==
0
:
assert
r
[
"message"
]
==
param
[
"assert"
]
test_doctor_data/web3_data/conversation_robot_add_message.yaml
0 → 100644
View file @
d993b547
conversation_robot_add_message
:
#私信机器人-添加私信配置
-
case
:
"
私信机器人-只填写默认配置-文本"
message
:
'
{"default":[{"name":"","page_type":"0","tag_id":"","tag_name":"","doctor_user_id":602329,"msg_list":[{"id":168,"type":"0","content":"测试"}]}],"personality":[]}'
csrfmiddlewaretoken
:
"
qzDd1CYV1LngDvQaGjgq4gKoHOPyieHk"
assert
:
"
配置成功"
-
case
:
"
私信机器人-只填写默认配置-图片"
message
:
'
{"default":[{"name":"","page_type":"0","tag_id":"","tag_name":"","doctor_user_id":602329,"msg_list":[{"id":168,"type":"2","content":"https://heras.igengmei.com/service/2021/08/19/55aba3145e"}]}],"personality":[]}'
csrfmiddlewaretoken
:
"
qzDd1CYV1LngDvQaGjgq4gKoHOPyieHk"
assert
:
"
配置成功"
-
case
:
"
私信机器人-只填写默认配置-优惠券"
message
:
'
{"default":[{"name":"","page_type":"0","tag_id":"","tag_name":"","doctor_user_id":602329,"msg_list":[{"id":168,"type":"9","content":"59055,51"}]}],"personality":[]}'
csrfmiddlewaretoken
:
"
qzDd1CYV1LngDvQaGjgq4gKoHOPyieHk"
assert
:
"
配置成功"
-
case
:
"
私信机器人-只填写默认配置-文本+图片"
message
:
'
{"default":[{"name":"","page_type":"0","tag_id":"","tag_name":"","doctor_user_id":602329,"msg_list":[{"id":168,"type":"0","content":"这是默认配置的文本"},{"id":"","type":"2","content":"https://heras.igengmei.com/service/2021/08/19/287ca8f095"}]}],"personality":[]}'
csrfmiddlewaretoken
:
"
qzDd1CYV1LngDvQaGjgq4gKoHOPyieHk"
assert
:
"
配置成功"
-
case
:
"
私信机器人-只填写默认配置-文本+优惠券"
message
:
'
{"default":[{"name":"","page_type":"0","tag_id":"","tag_name":"","doctor_user_id":602329,"msg_list":[{"id":168,"type":"0","content":"这是默认配置的文本"},{"id":"","type":"9","content":"59055,51"}]}],"personality":[]}'
csrfmiddlewaretoken
:
"
qzDd1CYV1LngDvQaGjgq4gKoHOPyieHk"
assert
:
"
配置成功"
-
case
:
"
私信机器人-只填写默认配置-文本+图片+优惠券"
message
:
'
{"default":[{"name":"","page_type":"0","tag_id":"","tag_name":"","doctor_user_id":602329,"msg_list":[{"id":168,"type":"0","content":"这是默认配置"},{"id":"","type":"2","content":"https://heras.igengmei.com/service/2021/08/20/1e03212794"},{"id":"","type":"9","content":"59055,51"}]}],"personality":[]}'
csrfmiddlewaretoken
:
"
qzDd1CYV1LngDvQaGjgq4gKoHOPyieHk"
assert
:
"
配置成功"
-
case
:
"
私信机器人-只填写默认配置-图片+优惠券"
message
:
'
{"default":[{"name":"","page_type":"0","tag_id":"","tag_name":"","doctor_user_id":602329,"msg_list":[{"id":168,"type":"2","content":"https://heras.igengmei.com/service/2021/08/19/a3e25ac9e7"},{"id":"","type":"9","content":"59055,51"}]}],"personality":[]}'
csrfmiddlewaretoken
:
"
qzDd1CYV1LngDvQaGjgq4gKoHOPyieHk"
assert
:
"
配置成功"
-
case
:
"
私信机器人-只填写默认配置-配置5条"
message
:
'
{"default":[{"name":"","page_type":"0","tag_id":"","tag_name":"","doctor_user_id":602329,"msg_list":[{"id":168,"type":"2","content":"https://heras.igengmei.com/service/2021/08/19/a3e25ac9e7"},{"id":"","type":"9","content":"59055,51"},{"id":"","type":"0","content":"这是默认配置文本"},{"id":"","type":"0","content":"这是文本"},{"id":"","type":"2","content":"https://heras.igengmei.com/service/2021/08/19/36850a11c5"}]}],"personality":[]}'
csrfmiddlewaretoken
:
"
qzDd1CYV1LngDvQaGjgq4gKoHOPyieHk"
assert
:
"
配置成功"
-
case
:
"
私信机器人-只填写默认配置-敏感词"
message
:
'
{"default":[{"name":"","page_type":"0","tag_id":"","tag_name":"","doctor_user_id":602329,"msg_list":[{"id":168,"type":"0","content":"这是敏感词呀微信"}]}],"personality":[]}'
csrfmiddlewaretoken
:
"
qzDd1CYV1LngDvQaGjgq4gKoHOPyieHk"
assert
:
"
默认配置不能为空且文本不能含有敏感词,敏感词示例:私聊、微信、私信等"
-
case
:
"
私信机器人-默认配置文本+个性配置机构文本"
message
:
'
{"default":[{"name":"","page_type":"0","tag_id":"","tag_name":"","doctor_user_id":602329,"msg_list":[{"id":168,"type":"0","content":"这是默认配置"}]}],"personality":[{"name":"机构主页","page_type":"2","tag_id":"","doctor_user_id":602329,"msg_list":[{"id":"","type":"0","content":"这是机构主页文案"}]}]}'
csrfmiddlewaretoken
:
"
qzDd1CYV1LngDvQaGjgq4gKoHOPyieHk"
assert
:
"
配置成功"
-
case
:
"
私信机器人-默认配置文本+个性配置医生文本"
message
:
'
{"default":[{"name":"","page_type":"0","tag_id":"","tag_name":"","doctor_user_id":602329,"msg_list":[{"id":168,"type":"0","content":"这是默认配置"}]}],"personality":[{"name":"医生主页","page_type":"3","tag_id":"","doctor_user_id":602329,"msg_list":[{"id":"","type":"0","content":"这是医生主页文案"}]}]}'
csrfmiddlewaretoken
:
"
qzDd1CYV1LngDvQaGjgq4gKoHOPyieHk"
assert
:
"
配置成功"
-
case
:
"
私信机器人-默认配置文本+个性配置商详页眼科-文本"
message
:
'
{"default":[{"name":"","page_type":"0","tag_id":"","tag_name":"","doctor_user_id":602329,"msg_list":[{"id":168,"type":"0","content":"这是默认配置"}]}],"personality":[{"name":"商详页","page_type":"1","tag_id":12711,"doctor_user_id":602329,"msg_list":[{"id":"","type":"0","content":"这是商详页文案"}]}]}'
csrfmiddlewaretoken
:
"
qzDd1CYV1LngDvQaGjgq4gKoHOPyieHk"
assert
:
"
配置成功"
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