Commit 307e911c authored by aha's avatar aha

合并代码

parents 2711bfce 029c7d83
......@@ -41,6 +41,18 @@ class hybrid_request(BaseRequest):
return self.api_send(self.data['brand'])
# 问答详情页问题详情
def question_v1(self):
return self.api_send(self.data['question_v1'])
# 问答详情页--回答列表
def question_new_answer_list(self, question_id):
self.params['question_id'] = question_id
return self.api_send(self.data['question_new_answer_list'])
if __name__ == '__main__':
# print(self.data)
......
......@@ -37,4 +37,27 @@ brand:
version: ${version}
data: {}
json: {}
\ No newline at end of file
json: {}
#问答详情页--问题详情
question_v1:
method: GET
url: /hybrid/question_v1/210502
params:
data: {}
json: {}
isLogin: 1
#问答详情页--回答列表
question_new_answer_list:
method: GET
url: /hybrid/question/new_answer_list/_data
params:
question_id: ${question_id}
data: {}
json: {}
isLogin: 1
import path_setting
from in_common.base_request import BaseRequest
class qa_request(BaseRequest):
def __init__(self):
self.data = self.api_load(path_setting.QA_CONFIG)
# print(self.replyanswer)
# 帖子收藏
def favor(self, answer_id):
self.params["answer_id"] = answer_id
return self.api_send(self.data["favor"])
# 帖子取消收藏
def cancelfavor(self, answer_id):
self.params["answer_id"] = answer_id
return self.api_send(self.data["cancelfavor"])
#问题收藏
favor:
method: post
url: /api/qa/favor
params:
data:
answer_id: ${answer_id}
json: {}
isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
#问题取消收藏
cancelfavor:
method: post
url: /api/qa/favor/cancel
params:
data:
answer_id: ${answer_id}
json: {}
isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
......@@ -12,9 +12,9 @@ class topic_request(BaseRequest):
return self.api_send(self.data["vote"])
# 详情页内部-取消点赞
def topic_canclevote(self, topic_id):
def topic_cancelvote(self, topic_id):
self.params["topic_id"] = topic_id
return self.api_send(self.data["canclevote"])
return self.api_send(self.data["cancelvote"])
# 进入日记贴详情页-用来判断这篇日记贴点赞过没
def topic_detail(self, topic_id):
......
......@@ -9,7 +9,7 @@ vote:
isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
#取消点赞
canclevote:
cancelvote:
method: delete
url: /api/topic/vote/
params:
......
......@@ -8,7 +8,7 @@ topic_reply_vote:
json: {}
isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
topic_reply_canclevote:
topic_reply_cancelvote:
method: post
url: /hybrid/api/topicreply/cancel_vote/_data
params:
......
......@@ -10,9 +10,9 @@ class topicreply_vote_request(BaseRequest):
self.params["id"] = id
return self.api_send(self.data["topic_reply_vote"])
def topic_reply_canclevote(self, id):
def topic_reply_cancelvote(self, id):
self.params["id"] = id
return self.api_send(self.data["topic_reply_canclevote"])
return self.api_send(self.data["topic_reply_cancelvote"])
# 进入日记贴详情页-用来判断这篇日记贴点赞过没
# def diary_detail(self, topic_id):
......
......@@ -27,19 +27,40 @@ class tractate_request(BaseRequest):
self.params["data_type"] = data_type
return self.api_send(self.data["reply"])
# 帖子点赞
# 帖子收藏
def favor(self, tractate_id, data_type):
self.params["tractate_id"] = tractate_id
self.params["data_type"] = data_type
return self.api_send(self.data["favor"])
# 帖子取消点赞
# 帖子取消收藏
def cancelfavor(self, tractate_id, data_type):
self.params["tractate_id"] = tractate_id
self.params["data_type"] = data_type
return self.api_send(self.data["cancelfavor"])
# 帖子点赞
def tractate_vote(self, tractate_id, data_type, reply_id):
self.params["tractate_id"] = tractate_id
self.params["data_type"] = data_type
self.params["reply_id"] = reply_id
return self.api_send(self.data["tractate_vote"])
# 帖子取消点赞
def tractate_cancelvote(self, tractate_id, data_type, reply_id):
self.params["tractate_id"] = tractate_id
self.params["data_type"] = data_type
self.params["reply_id"] = reply_id
return self.api_send(self.data["tractate_cancelvote"])
# 帖子创建一级&二级评论
def publish_reply(self, tractate_id, data_type, reply_id, content):
self.params["tractate_id"] = tractate_id
self.params["data_type"] = data_type
self.params["reply_id"] = reply_id
self.params["content"] = content
return self.api_send(self.data["publish_reply"])
......@@ -38,10 +38,6 @@ reply:
isLogin: 0 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
#帖子收藏
favor:
method: post
......@@ -66,3 +62,42 @@ cancelfavor:
isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
#帖子点赞
tractate_vote:
method: post
url: /api/tractate/vote
params:
data:
tractate_id: ${tractate_id}
data_type: ${data_type}
reply_id: ${reply_id}
json: {}
isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
#帖子取消点赞
tractate_cancelvote:
method: post
url: /api/tractate/vote/cancel
params:
data:
tractate_id: ${tractate_id}
data_type: ${data_type}
reply_id: ${reply_id}
json: {}
isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
#
#帖子创建一级评论
publish_reply:
method: post
url: /api/tractate/publish_reply
params:
data:
tractate_id: ${tractate_id}
data_type: ${data_type}
reply_id: ${reply_id}
content: ${content}
json: {}
isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
#
\ No newline at end of file
......@@ -65,9 +65,13 @@ class web_request(BaseRequest):
return self.api_send(self.ACCOUNT_URL["cpc_homepage"])
def artemis_ad_type_list(self):
return self.api_send(self.ACCOUNT_URL["artemis_ad_type_list"])
def artemis_order_list(self,status):
def artemis_order_list(self, status, page):
self.params["status"] = status
self.params["page"] = page
return self.api_send(self.ACCOUNT_URL["artemis_order_list"])
def artemis_order_id_detail(self):
"上线中订单详情页"
return self.api_send(self.ACCOUNT_URL["artemis_order_id_detail"])
......@@ -89,6 +93,7 @@ if __name__ == '__main__':
print(web_request().cpc_homepage())
print(web_request().artemis_ad_type_list())
print("发送")
print(web_request().artemis_order_list(0))
print(web_request().artemis_order_list(1))
print(web_request().artemis_order_list(2))
\ No newline at end of file
print(web_request().artemis_order_list(0, 1))
print(web_request().artemis_order_list(1, 1))
print(web_request().artemis_order_list(2, 1))
print(web_request().artemis_order_id_detail())
\ No newline at end of file
......@@ -142,6 +142,15 @@ artemis_order_list:
url: /api/web/artemis/order/list
params:
status: ${status}
page: ${page}
data: {}
json: {}
isLogin: 1 #需要登录
artemis_order_id_detail:
method: get
url: /api/web/artemis/order/509151034657/detail
params: {}
data: {}
json: {}
isLogin: 1 #需要登录
\ No newline at end of file
......@@ -20,24 +20,26 @@ DIARY_SERVICE = os.path.join(BASE_DIR, "backend_auto/test_backend_data/diary_dat
#日记本收藏&取消收藏
DIARY_FAVOR = os.path.join(BASE_DIR, "backend_auto/test_backend_data/diary_data", "favor.yaml")
# 日记本列表-日记贴点赞相关()
DIARY_VOTE_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "hybrid_api_topic_request.yaml")
DIARY_VOTE = os.path.join(BASE_DIR, "backend_auto/test_backend_data/hybrid_data", "api_topic_vote.yaml")
# 日记本修改日记信息operation--目前好像直接用接口写无权限稍后解决
DIARY_OPERATION_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "diary_operation.yaml")
DIARY_OPERATION = os.path.join(BASE_DIR, "backend_auto/test_backend_data/diary_data", "diary_operation.yaml")
# 日记本创建日记贴信息-
DIARY_UPDATE_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "diary_update.yaml")
DIARY_UPDATE = os.path.join(BASE_DIR, "backend_auto/test_backend_data/diary_data", "diary_update.yaml")
# 日记本进入相册页
DIARY_ALBUM_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "hybrid_diary_request.yaml")
DIARY_ALBUM = os.path.join(BASE_DIR, "backend_auto/test_backend_data/hybrid_data", "diary_album.yaml")
# 日记本列表-日记贴点赞相关()
DIARY_VOTE_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "hybrid_api_topic_request.yaml")
DIARY_VOTE = os.path.join(BASE_DIR, "backend_auto/test_backend_data/hybrid_data", "api_topic_vote.yaml")
# 日记本&帖子&日记贴&帖子&问答各个详情页下方推荐内容
PERSONAL_RECOMMENDS_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "personal_recommends.yaml")
PERSONAL_RECOMMENDS = os.path.join(BASE_DIR, "backend_auto/test_backend_data/personal_data", "personal_recommends.yaml")
......@@ -55,14 +57,17 @@ TOPIC_SUB_COMMON = os.path.join(BASE_DIR, "backend_auto/test_backend_data/common
TOPIC_REPLY_CREATE_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "topic_reply_create.yaml")
TOPIC_REPLY_CREATE = os.path.join(BASE_DIR, "backend_auto/test_backend_data/topic_data", "topic_reply_create.yaml")
# 日记贴-一级评论点赞&取消点赞topicreply
TOPIC_REPLY_VOTE_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "topicreply_vote.yaml")
TOPIC_REPLY_VOTE = os.path.join(BASE_DIR, "backend_auto/test_backend_data/topic_data", "reply_vote.yaml")
# 日记贴-收藏&取消收藏--config文件代表,data代表接口
TOPIC_FAVOR_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "user_request.yaml")
TOPIC_FAVOR = os.path.join(BASE_DIR, "backend_auto/test_backend_data/user_data", "problem_favor.yaml")
# 日记贴-topic总的接口的请求配置
TOPIC_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "topic_request.yaml")
# 日记贴-详情页内容
......@@ -83,7 +88,24 @@ TRACTATE_RELATED_SERVICE = os.path.join(BASE_DIR, "backend_auto/test_backend_dat
TRACTATE_REPLY = os.path.join(BASE_DIR, "backend_auto/test_backend_data/tractate_data", "reply.yaml")
# 帖子详情页--收藏&取消收藏
TRACTATE_FAVOR = os.path.join(BASE_DIR, "backend_auto/test_backend_data/tractate_data", "favor.yaml")
# 帖子详情页--点赞&取消点赞
TRACTATE_VOTE = os.path.join(BASE_DIR, "backend_auto/test_backend_data/tractate_data", "vote.yaml")
# 帖子详情页--一级评论创建
TRACTATE_PUBLISH_REPLY = os.path.join(BASE_DIR, "backend_auto/test_backend_data/tractate_data", "publish_reply.yaml")
# 问答详情页--问题详情
QUESTION_DETAIL = os.path.join(BASE_DIR, "backend_auto/test_backend_data/hybrid_data", "question_v1.yaml")
# 问答详情页--回答列表
ANSWER_LIST = os.path.join(BASE_DIR, "backend_auto/test_backend_data/hybrid_data", "question_new_answer_list.yaml")
# qa接口总的配置项--问答·相关
QA_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "qa_request.yaml")
# -问题的收藏&取消收藏
QA_FAVOR = os.path.join(BASE_DIR, "backend_auto/test_backend_data/qa_data", "favor.yaml")
# -test的文件,尝试在不动原函数的基础上加参数而不是用默认参数。--没必要
# TEST_QA = os.path.join(BASE_DIR, "backend_auto/test_backend_data/qa_data", "test.yaml")
......@@ -404,6 +426,8 @@ ADTYPELIST=os.path.join(BASE_DIR, "backend_auto/test_doctor_data/web_data", "art
ADADDSHOPPINGCARTINFO=os.path.join(BASE_DIR, "backend_auto/test_doctor_data/web2_data", "artemis_ad_add_shopping_cart_info.yaml")
#医生后台-我的服务订单
ORDERLIST=os.path.join(BASE_DIR, "backend_auto/test_doctor_data/web_data", "artemis_order_list.yaml")
#医生后台-我的服务订单-已上线订单
ORDERIDDETAIL=os.path.join(BASE_DIR, "backend_auto/test_doctor_data/web_data", "artemis_order_id_detail.yaml")
#医生后台-点点通商品-概览
CPCHOMEPAGE=os.path.join(BASE_DIR, "backend_auto/test_doctor_data/web_data", "cpc_homepage.yaml")
......
......@@ -8,7 +8,7 @@ from all_backend_api.common_request import common_request
class TestReply:
data = BaseRequest().api_load(path_setting.DIARY_COMMON_REPLY)
diary_common_reply_case, diary_common_reply_data = get_ids(data, "diary_common_reply")
diary_common_reply_case, diary_common_reply_data = get_ids(data, "common_reply")
@pytest.mark.parametrize("param", diary_common_reply_data, ids=diary_common_reply_case)
def test_reply(self, param):
......@@ -30,24 +30,6 @@ class TestReply:
assert r["data"]["reply_data"][0]["_type"] == param["type"] # 校验评论列表返回类型
# 帖子的评论列表
# r = common_request().tractate_common_reply(param["id"], param["type"])
# # print(r)
# if r["error"] == 0:
# assert r["error"] == param["assert1"]
# # 先判断有没有评论,然后判断里面需要的那些字段,如点赞字段,评论总数等,不传值,传空值
# if r["data"]["reply_data"]:
# assert r["data"]["reply_data"][0]["user_id"] is not None and r["data"]["reply_data"][0]["user_id"] is not "" # 用户id
# assert r["data"]["reply_data"][0]["user_portrait"] is not None and r["data"]["reply_data"][0]["user_portrait"] is not "" # 用户头像
# assert r["data"]["reply_data"][0]["gm_url"] is not None and r["data"]["reply_data"][0]["gm_url"] is not "" # 头像跳转链接
# assert r["data"]["reply_data"][0]["user_nickname"] is not None and r["data"]["reply_data"][0]["user_nickname"] is not "" # 用户名
# assert r["data"]["reply_data"][0]["content"] is not None and r["data"]["reply_data"][0]["content"] is not "" # 评论内容
# assert r["data"]["reply_data"][0]["reply_count"] is not None and r["data"]["reply_data"][0]["reply_count"] is not "" # 评论总数
# assert r["data"]["reply_data"][0]["reply_id"] is not None and r["data"]["reply_data"][0]["reply_id"] is not "" # 评论id
# assert r["data"]["reply_data"][0]["is_voted"] is not None and r["data"]["reply_data"][0]["is_voted"] is not "" # 是否点赞
# assert r["data"]["reply_data"][0]["_type"] == param["type4"] # 校验评论列表返回类型
......
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.hybrid_request import hybrid_request
class TestQuestionNewAnswerLiist:
data = BaseRequest().api_load(path_setting.ANSWER_LIST)
test_case, test_data = get_ids(data, "question_new_answer_list")
@pytest.mark.parametrize("param", test_data, ids=test_case)
def test_question_v1(self, param):
r = hybrid_request().question_new_answer_list(param["question_id"])
if r["error"] == 0:
if r["data"]["answers_list"]:
# 看下是否有回答
assert r["data"]["answer_total_nums"] is not None and r["data"]["answer_total_nums"] is not ""
assert r["data"]["answers_list"][0]["is_author"] is not None and r["data"]["answers_list"][0]["is_author"] is not ""
assert r["data"]["answers_list"][0]["content_level"] is not None and r["data"]["answers_list"][0]["content_level"] is not ""
assert r["data"]["answers_list"][0]["first_reply_count"] is not None and r["data"]["answers_list"][0]["first_reply_count"] is not ""
assert r["data"]["answers_list"][0]["content"] is not None and r["data"]["answers_list"][0]["content"] is not ""
assert r["data"]["answers_list"][0]["comment_count"] is not None and r["data"]["answers_list"][0]["comment_count"] is not ""
assert r["data"]["answers_list"][0]["like_num"] is not None and r["data"]["answers_list"][0]["like_num"] is not ""
assert r["data"]["answers_list"][0]["is_voted"] is not None and r["data"]["answers_list"][0]["is_voted"] is not ""
assert r["data"]["answers_list"][0]["id"] is not None and r["data"]["answers_list"][0]["id"] is not ""
assert r["data"]["answers_list"][0]["answer_id"] is not None and r["data"]["answers_list"][0]["answer_id"] is not ""
else:
assert r["message"] == param["message"]
assert r["message"] == param["message"]
# 如果没有点过赞,就先校验点赞之后再取消点赞。【最后保持取消点赞的状态】
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.hybrid_request import hybrid_request
class TestQuestionV1:
data = BaseRequest().api_load(path_setting.QUESTION_DETAIL)
test_case, test_data = get_ids(data, "question_v1")
@pytest.mark.parametrize("param", test_data, ids=test_case)
def test_question_v1(self, param):
r = hybrid_request().question_v1()
assert r["error"] == param["error"]
if r["error"] == 0:
assert r["config"]["has_login"] is not None and r["config"]["has_login"] is not ""
assert r["config"]["url_base"] is not None and r["config"]["url_base"] is not ""
assert r["config"]["host_url"] is not None and r["config"]["host_url"] is not ""
assert r["data"]["is_favored"] is not None and r["data"]["is_favored"] is not ""
assert r["data"]["answer_count"] is not None and r["data"]["answer_count"] is not ""
assert r["data"]["answer_level_lte2_nums"] is not None and r["data"]["answer_level_lte2_nums"] is not ""
assert r["data"]["answer_level_gte3_nums"] is not None and r["data"]["answer_level_gte3_nums"] is not ""
assert r["data"]["is_following"] is not None and r["data"]["is_following"] is not ""
assert r["data"]["id"] is not None and r["data"]["id"] is not ""
assert r["data"]["title"] is not None and r["data"]["title"] is not ""
assert r["data"]["content"] is not None and r["data"]["content"] is not ""
# 如果没有点过赞,就先校验点赞之后再取消点赞。【最后保持取消点赞的状态】
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.qa_request import qa_request
class TestFavor:
data = BaseRequest().api_load(path_setting.QA_FAVOR)
test_case, test_data = get_ids(data, "favor")
@pytest.mark.parametrize("param", test_data, ids=test_case)
def test_favor(self, param):
r = qa_request().favor(param["answer_id"])
assert r["error"] == param["error"]
r = qa_request().cancelfavor(param["answer_id"])
assert r["error"] == param["error"]
......@@ -17,7 +17,7 @@ class TestTopicReplyVote:
if r["error"] == 1:
assert r["message"] == param["assert3"]
# 回到取消点赞状态
canclevote = topicreply_vote_request().topic_reply_canclevote(param["id"])
canclevote = topicreply_vote_request().topic_reply_cancelvote(param["id"])
assert canclevote["error"] == 0
# 校验点赞
vote = topicreply_vote_request().topic_reply_vote(param["id"])
......@@ -27,16 +27,16 @@ class TestTopicReplyVote:
assert vote["message"] == param["assert3"]
assert vote["error"] == 1
# 最后取消点赞,回到取消点赞的状态
canclevote = topicreply_vote_request().topic_reply_canclevote(param["id"])
assert canclevote["error"] == 0
cancelvote = topicreply_vote_request().topic_reply_cancelvote(param["id"])
assert cancelvote["error"] == 0
elif r["error"] == 0:
# 说明已经点赞成功只需要校验重复点赞和取消点赞即可-二次点赞无效
vote = topicreply_vote_request().topic_reply_vote(param["id"])
assert vote["message"] == param["assert3"]
assert vote["error"] == 1
# 最后取消点赞,回到取消点赞的状态
canclevote = topicreply_vote_request().topic_reply_canclevote(param["id"])
assert canclevote["error"] == 0
cancelvote = topicreply_vote_request().topic_reply_cancelvote(param["id"])
assert cancelvote["error"] == 0
#
......
......@@ -22,13 +22,13 @@ class TestVote:
assert vote["error"] == 0
assert vote["message"] == param["message1"]
# 取消点赞,回到取消点赞的状态
canclevote = topic_request().topic_canclevote(param["topic_id"])
assert canclevote["error"] == 0
cancelvote = topic_request().topic_cancelvote(param["topic_id"])
assert cancelvote["error"] == 0
else:
# 如果是已经点过赞的状态就直接取消点赞
canclevote = topic_request().topic_canclevote(param["topic_id"])
assert canclevote["error"] == 0
assert canclevote["message"] == param["message2"]
cancelvote = topic_request().topic_cancelvote(param["topic_id"])
assert cancelvote["error"] == 0
assert cancelvote["message"] == param["message2"]
......
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.tractate_request import tractate_request
class TestPublishReply:
data = BaseRequest().api_load(path_setting.TRACTATE_PUBLISH_REPLY)
test_case, test_data = get_ids(data, "publish_reply")
@pytest.mark.parametrize("param", test_data, ids=test_case)
def test_publish_reply(self, param):
r = tractate_request().publish_reply(param["tractate_id"], param["data_type"], param["reply_id"], param["content"])
# print(r)
assert r["error"] == param["error"]
if r["error"] == 0:
assert r["data"]["reply_data"]["content"] is not None and r["data"]["reply_data"]["content"] is not ""
assert r["data"]["reply_data"]["user_type"] is not None and r["data"]["reply_data"]["user_type"] is not ""
assert r["data"]["reply_data"]["user_gm_url"] is not None and r["data"]["reply_data"]["user_gm_url"] is not ""
assert r["data"]["reply_data"]["is_vote"] is not None and r["data"]["reply_data"]["is_vote"] is not ""
assert r["data"]["reply_data"]["id"] is not None and r["data"]["reply_data"]["id"] is not ""
assert r["data"]["reply_data"]["user_portrait"] is not None and r["data"]["reply_data"]["user_portrait"] is not ""
assert r["data"]["reply_data"]["vote_num"] is not None and r["data"]["reply_data"]["vote_num"] is not ""
assert r["data"]["reply_data"]["content"] is not None and r["data"]["reply_data"]["content"] is not ""
assert r["data"]["reply_data"]["reply_count"] is not None and r["data"]["reply_data"]["reply_count"] is not ""
assert r["data"]["reply_data"]["user_name"] is not None and r["data"]["reply_data"]["user_name"] is not ""
assert r["data"]["reply_data"]["content"] == param["content"]
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.tractate_request import tractate_request
class TestVote:
data = BaseRequest().api_load(path_setting.TRACTATE_VOTE)
test_case, test_data = get_ids(data, "tractate_vote")
@pytest.mark.parametrize("param", test_data, ids=test_case)
def test_vote(self, param):
r = tractate_request().tractate_detail(param["current_city_id"], param["tractate_id"], param["data_type"])
if r["error"] == 0:
assert r["error"] == param["assert1"]
# 如果没有点过赞,就先校验点赞之后再取消点赞。【最后保持取消点赞的状态】
if not r["data"]["tractate_list"]["is_voted"]:
vote = tractate_request().tractate_vote(param["tractate_id"], param["data_type"], param["reply_id"])
assert vote["error"] == 0
assert vote["message"] == param["message1"]
# 取消点赞,回到取消点赞的状态
canclevote = tractate_request().tractate_cancelvote(param["tractate_id"], param["data_type"], param["reply_id"])
assert canclevote["error"] == 0
else:
# 如果是已经点过赞的状态就直接取消点赞
canclevote = tractate_request().tractate_cancelvote(param["tractate_id"], param["data_type"], param["reply_id"])
assert canclevote["message"] == param["message2"]
diary_common_reply:
common_reply:
#日记本列表评论列表--校验
-
case: "日记本列表评论列表--校验"
......
question_new_answer_list:
#问题详情页--回答列表
-
case: "问题详情页--回答列表--有回答"
error: 0
error1: 1
message: "没有更多了"
question_id: 210502
assert: false
assert2: true
-
case: "问题详情页--回答列表--无回答"
error: 0
question_id: 358247
assert: false
assert2: true
error1: 1
message: "没有更多了"
question_v1:
#问题详情
-
case: "问题详情"
error: 0
assert: false
assert2: true
personal_recommends:
#日记本详情页推荐接口校验
#详情页推荐接口校验
-
case: "校验详情页推荐数据--日记本"
current_city_id: "beijiing"
......
favor:
#问题详情页--收藏&取消收藏校验
-
case: "问题详情页--收藏&取消收藏校验-"
current_city_id: "beijiing"
answer_id: 357124
error: 0
error1: 1
message1: "收藏成功"
message2: "请登录后再试"
message3: "取消收藏成功"
......@@ -2,7 +2,7 @@ reply_create:
- assert1: null
case: 日记贴一级评论创建--正常校验&创建二级评论--正常校验
channel: benzhan
content: ces测试+2021-06-18 19:05:18
content: ces测试+2021-06-18 19:16:10
message: 请勿回复重复内容
message1: 回复成功
message2: 你的回复有点频繁,稍后再来
......
publish_reply:
#帖子发布一级评论&二级评论
-
case: "贴子详情页--帖子发布一级评论--用接口校验可以发重复内容"
tractate_id: 175152
content: "太丰富发个刚刚"
data_type: "user_post"
current_city_id: "beijing"
reply_id: ""
assert1: 0
error: 0
message1: "点赞成功"
message2: "取消点赞成功"
- case: "贴子详情页--帖子发布二级评论--用接口校验可以发重复内容"
tractate_id: 175152
content: "太丰富发个刚刚"
data_type: "user_post"
current_city_id: "beijing"
reply_id: "2167124"
assert1: 0
error: 0
message1: "点赞成功"
message2: "取消点赞成功"
tractate_vote:
#贴子详情页点赞
-
case: "贴子详情页--点赞&取消点赞--用接口校验"
tractate_id: 175152
reply_id: ""
data_type: "user_post"
current_city_id: "beijing"
assert1: 0
message1: "点赞成功"
message2: "取消点赞成功"
-
case: "贴子详情页--一级评论点赞&取消点赞--用接口校验"
tractate_id: 175152
reply_id: "2167124"
data_type: "user_post"
current_city_id: "beijing"
assert1: 0
message1: "点赞成功"
message2: "取消点赞成功"
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 TestArtemisOrderIdDetail:
data = BaseRequest().api_load(path_setting.ORDERIDDETAIL)
orderiddetail_case, orderiddetail_data = get_ids(data, "artemis_order_id_detail")
@pytest.mark.parametrize("param",orderiddetail_data,ids=orderiddetail_case)
def test_artemis_order_id_detail(self, param):
'''我的服务订单'''
r = web_request().artemis_order_id_detail()
if r["error"] == 0:
assert r["data"]["detail_type"] == param["assert_detail_type"]
assert r["data"]["status"] == param["assert_status"]
......@@ -14,7 +14,7 @@ class TestArtemisOrderList:
@pytest.mark.parametrize("param",orderlist_data,ids=orderlist_case)
def test_artemis_order_list(self, param):
'''我的服务订单'''
r = web_request().artemis_order_list(param["status"])
r = web_request().artemis_order_list(param["status"], param["page"])
if r["error"] == 0:
orders = r.get("data").get("orders", [])
assert len(orders) >= param["assert"]
......
artemis_order_id_detail:
#已上线订单服务订单详情页case
-
case: "已上线订单服务订单详情页case"
assert_status: 3
assert_detail_type: 6
......@@ -3,36 +3,45 @@ artemis_order_list:
-
case: "我的服务订单请求失败case"
status: ""
page: 1
assert: 0
-
case: "我的服务订单-待支付广告包case"
status: 0
page: 1
assert: 0
-
case: "我的服务订单-已购买case"
status: 1
page: 1
assert: 0
-
case: "我的服务订单-待审核case"
status: 2
page: 1
assert: 0
-
case: "我的服务订单-待上线case"
status: 3
page: 1
assert: 0
-
case: "我的服务订单-上线中case"
status: 4
page: 1
assert: 0
-
case: "我的服务订单-已下线case"
status: 5
page: 1
assert: 0
-
case: "我的服务订单-已支付广告包case"
status: 6
page: 1
assert: 0
-
case: "我的服务订单-已关闭广告包case"
status: 7
page: 1
assert: 0
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