Commit d993b547 authored by 张淑琴's avatar 张淑琴

私信配置部分case

parent 9139994c
......@@ -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"))
......@@ -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
......@@ -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")
#医生后台-服务资源
......
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"]
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: "配置成功"
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