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

重新提交上周代码

parent 9f5a8672
...@@ -20,8 +20,25 @@ class web_request(BaseRequest): ...@@ -20,8 +20,25 @@ class web_request(BaseRequest):
self.params["csrfmiddlewaretoken"] = csrfmiddlewaretoken self.params["csrfmiddlewaretoken"] = csrfmiddlewaretoken
return self.api_send(self.ACCOUNT_URL["service_offline"]) return self.api_send(self.ACCOUNT_URL["service_offline"])
def conversation(self, is_star, page):
self.params["is_star"] = is_star
self.params["page"] = page
return self.api_send(self.ACCOUNT_URL["conversation"])
def conversation_unread_list(self, page):
self.params["page"] = page
return self.api_send(self.ACCOUNT_URL["conversation_unread_list"])
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"])
if __name__ == '__main__': if __name__ == '__main__':
...@@ -29,3 +46,9 @@ if __name__ == '__main__': ...@@ -29,3 +46,9 @@ if __name__ == '__main__':
print(web_request().article_videotoken()) print(web_request().article_videotoken())
print(web_request().doctor_submechanisms()) print(web_request().doctor_submechanisms())
print(web_request().service_offline("209992", "PC8uTySuxipukIMuqNV1OPB376C2ZZ3g")) print(web_request().service_offline("209992", "PC8uTySuxipukIMuqNV1OPB376C2ZZ3g"))
print(web_request().conversation(0, 1))
print(web_request().conversation_unread_list(1))
print(web_request().service())
print("发送")
print(web_request().conversation_diary(602329))
print(web_request().conversation_coupon(602329))
...@@ -36,3 +36,48 @@ service_offline: ...@@ -36,3 +36,48 @@ service_offline:
csrfmiddlewaretoken: ${csrfmiddlewaretoken} csrfmiddlewaretoken: ${csrfmiddlewaretoken}
json: {} json: {}
isLogin: 1 isLogin: 1
conversation:
method: get
url: /api/web/conversation
params:
is_star: ${is_star}
page: ${page}
data: {}
json: {}
isLogin: 1 #需要登录
conversation_unread_list:
method: get
url: /api/web/conversation/unread_list
params:
page: ${page}
data: {}
json: {}
isLogin: 1 #需要登录
service:
method: get
url: /api/web/service
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 #需要登录
...@@ -242,6 +242,18 @@ REPLY_ANSWER = os.path.join(BASE_DIR, "backend_auto/test_backend_data/question_d ...@@ -242,6 +242,18 @@ REPLY_ANSWER = os.path.join(BASE_DIR, "backend_auto/test_backend_data/question_d
DETAIL_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "answer_request.yaml") DETAIL_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "answer_request.yaml")
DETAIL = os.path.join(BASE_DIR, "backend_auto/test_backend_data/answer_data", "detail.yaml") DETAIL = os.path.join(BASE_DIR, "backend_auto/test_backend_data/answer_data", "detail.yaml")
#医生后台-全部私信列表
CONVERSATION=os.path.join(BASE_DIR, "backend_auto/test_doctor_data/web_data", "conversation.yaml")
#医生后台-未读私信列表
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__': if __name__ == '__main__':
print("==========",LIVEYAML_CONFIG) print("==========",LIVEYAML_CONFIG)
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 TestConversation:
data = BaseRequest().api_load(path_setting.CONVERSATION)
conversation_case, conversation_data = get_ids(data, "conversation")
@pytest.mark.parametrize("param",conversation_data,ids=conversation_case)
def test_conversation(self, param):
'''全部私信列表'''
r = web_request().conversation(param["is_star"], param["page"])
if r["error"] == 0:
conversation = r.get("data").get("conversation", [])
assert len(conversation) <= param["assert"]
assert r["data"]["size"] <= param["assert_size"]
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"]
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)
if r["error"] == 0:
data = r.get("data", [])
assert len(data) >= param["assert"]
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 TestConversationUnreadList:
data = BaseRequest().api_load(path_setting.CONVERSATIONUNREADLIST)
unreadlist_case, unreadlist_data = get_ids(data, "conversation_unread_list")
@pytest.mark.parametrize("param",unreadlist_data,ids=unreadlist_case)
def test_conversation_unread_list(self, param):
'''未读私信列表'''
r = web_request().conversation_unread_list(param["page"])
if r["error"] == 0:
conversation = r.get("data").get("conversation", [])
assert len(conversation) <= param["assert"]
assert r["data"]["size"] <= param["assert_size"]
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.SERVICE)
service_case, service_data = get_ids(data, "service")
@pytest.mark.parametrize("param",service_data,ids=service_case)
def test_service(self, param):
'''未读私信列表'''
r = web_request().service()
if r["error"] == 0:
data = r.get("data").get("data", [])
assert len(data) <= param["assert"]
assert r["data"]["size"] <= param["assert_size"]
conversation:
#全部私信case
-
case: "请求成功,有数据返回的第一页数据"
is_star: 0
page: 1
assert_size: 10
assert: 10
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
conversation_diary:
#私信点击发送案例case
-
case: "点击私信发送案例按钮"
doctor_user_id: 602329
assert: 0
conversation_unread_list:
#未读私信case
-
case: "请求成功,有未读消息"
page: 1
assert_size: 10
assert: 10
service:
#私信点击发送商品case
-
case: "点击私信发送商品按钮"
#page: 1
assert_size: 10
assert: 10
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