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

Merge branch 'common_dev' into zzsq_dev

parents 10bb47ce 2e45e176
...@@ -2,13 +2,31 @@ import path_setting ...@@ -2,13 +2,31 @@ import path_setting
from in_common.base_request import BaseRequest from in_common.base_request import BaseRequest
class diary_common_reply_request(BaseRequest): class common_request(BaseRequest):
def __init__(self): def __init__(self):
self.data = self.api_load(path_setting.DIARY_COMMON_REPLY_CONFIG) self.data = self.api_load(path_setting.DIARY_COMMON_CONFIG)
# 日记贴评论列表--一级评论列表
def diary_common_reply(self, id, type): def diary_common_reply(self, id, type):
self.params["id"] = id self.params["id"] = id
self.params["type"] = type self.params["type"] = type
return self.api_send(self.data["vote"]) return self.api_send(self.data["reply_detail"])
# 日记贴评论列表--二级评论
def topic_sub_common(self, id, type, reply_id):
self.params["id"] = id
self.params["type"] = type
self.params["reply_id"] = reply_id
return self.api_send(self.data["sub_common"])
#日记本列表--日记贴点赞 #日记本的评论列表---一级评论列表
vote: reply_detail:
method: get method: get
url: /api/common/reply url: /api/common/reply
params: params:
...@@ -9,3 +9,19 @@ vote: ...@@ -9,3 +9,19 @@ vote:
json: {} json: {}
isLogin: 0 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段 isLogin: 0 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
#日记本列表--日记贴--二级评论列表
sub_common:
method: get
url: /api/common/reply/sub_reply
params:
id: ${id}
type: ${type}
reply_id: ${reply_id}
data: {}
json: {}
isLogin: 0 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
#日记本收藏
cancelfavor:
method: delete
url: /api/diary/favor/17586195
params:
data: {}
json: {}
isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
#
#cancelfavor:
# method: delte
# url: /api/diary/favor/17586195
# params:
# data: {}
# json: {}
# isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
#
import path_setting
from in_common.base_request import BaseRequest
class diary_cancelfavor_request(BaseRequest):
def __init__(self):
self.data = self.api_load(path_setting.DIARY_CANCELFAVOR_CONFIG)
def diary_cancelfavor(self):
return self.api_send(self.data["cancelfavor"])
#
import path_setting
from in_common.base_request import BaseRequest
class diary_data_request(BaseRequest):
def __init__(self):
self.data = self.api_load(path_setting.DIARY_DATA_CONFIG)
def diary_data(self, current_city_id, diary_referrer, sort, count , start_num):
self.params["current_city_id"] = current_city_id
self.params["diary_referrer"] = diary_referrer
self.params["sort"] = sort
self.params["count"] = count
self.params["start_num"] = start_num
return self.api_send(self.data["diary_data"])
# if __name__ == '__main__':
# print(send_reqest().login_vfc("beijing", "+8612345678912", 1234, "", ""))
# print(send_reqest().diary_data("beijing", "my_diary", 0, 8, 2))
# print(1)
\ No newline at end of file
diary_data:
method: get
url: /api/diary/topic/15261339/_data
params:
current_city_id: ${current_city_id}
diary_referrer: ${diary_referrer}
sort: ${sort}
count: ${count}
start_num: ${start_num}
data:
json: {}
#日记本收藏
isfavor:
method: post
url: /api/diary/favor/17586195
params:
data: {}
json: {}
isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
#cancelfavor:
# method: delte
# url: /api/diary/favor/17586195
# params:
# data: {}
# json: {}
# isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
#
import path_setting
from in_common.base_request import BaseRequest
class diary_isfavor_request(BaseRequest):
def __init__(self):
self.data = self.api_load(path_setting.DIARY_ISFAVOR_CONFIG)
def diary_isfavor(self):
return self.api_send(self.data["isfavor"])
...@@ -2,10 +2,19 @@ import path_setting ...@@ -2,10 +2,19 @@ import path_setting
from in_common.base_request import BaseRequest from in_common.base_request import BaseRequest
class diary_operation_request(BaseRequest): class diary_request(BaseRequest):
def __init__(self): def __init__(self):
self.data = self.api_load(path_setting.DIARY_OPERATION_CONFIG) self.data = self.api_load(path_setting.DIARY_CONFIG)
# 收藏
def diary_isfavor(self):
return self.api_send(self.data["isfavor"])
# 取消收藏
def diary_cancelfavor(self):
return self.api_send(self.data["cancelfavor"])
# 更新日记本
def diary_operation(self, diary_id, title, operation_timestamp, doctor_name, hospital_name): def diary_operation(self, diary_id, title, operation_timestamp, doctor_name, hospital_name):
self.params["diary_id"] = diary_id self.params["diary_id"] = diary_id
self.params["title"] = title self.params["title"] = title
...@@ -14,25 +23,28 @@ class diary_operation_request(BaseRequest): ...@@ -14,25 +23,28 @@ class diary_operation_request(BaseRequest):
self.params["hospital_name"] = hospital_name self.params["hospital_name"] = hospital_name
return self.api_send(self.data["operation"]) return self.api_send(self.data["operation"])
# 添加信息--待争议
def diary_additional_info(self): def diary_additional_info(self):
return self.api_send(self.data["operation"]) return self.api_send(self.data["operation"])
# 详情页-内容
def diary_data(self, current_city_id, diary_referrer, sort, count , start_num):
self.params["current_city_id"] = current_city_id
self.params["diary_referrer"] = diary_referrer
self.params["sort"] = sort
self.params["count"] = count
self.params["start_num"] = start_num
return self.api_send(self.data["diary_data"])
# 日记本美购相关
def diary_service(self, diary_id, service_id):
self.params["diary_id"] = diary_id
self.params["service_id"] = service_id
return self.api_send(self.data["diary_service"])
# 日记更新
# def __init__(self): def diary_update(self, topic_list):
# self.data = self.api_load(path_setting.DIARY_OPERATION_RESULT_CONFIG) self.params["topic_list"] = topic_list
# return self.api_send(self.data["update"])
# def diary_additional_info(self):
# return self.api_send(self.data["diary_additional_info"])
# if __name__ == '__main__':
# print(conversation_request().message_read("beijing", 1,'[10622,10626,10646,10651]'))
#日记本收藏
isfavor:
method: post
url: /api/diary/favor/17586195
params:
data: {}
json: {}
isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
#日记本取消收藏
cancelfavor:
method: delete
url: /api/diary/favor/17586195
params:
data: {}
json: {}
isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
#
#日记本修改信息
operation:
method: post
url: /api/diary/additional_info/v2
params:
data:
diary_id: ${diary_id}
title: ${title}
operation_timestamp: ${operation_timestamp}
doctor_name: ${doctor_name}
hospital_name: ${hospital_name}
json: {}
isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
#查看日记修改信息页面
additional_info:
method: get
url: /api/diary/operation/17586198/
params:
data: {}
json: {}
isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
#详情页内容
diary_data:
method: get
url: /api/diary/topic/15261339/_data
params:
current_city_id: ${current_city_id}
diary_referrer: ${diary_referrer}
sort: ${sort}
count: ${count}
start_num: ${start_num}
data:
json: {}
#美购相关
diary_service:
method: get
url: /api/diary/services
params:
diary_id: ${diary_id}
service_id: ${service_id}
data:
json: {}
#更新日记本的修改信息
update:
method: post
url: /api/diary/update_v2/17586198
params:
data:
topic_list: ${topic_list}
json: {}
isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
diary_data:
method: get
url: /api/diary/services
params:
diary_id: ${diary_id}
service_id: ${service_id}
data:
json: {}
import path_setting
from in_common.base_request import BaseRequest
class diary_service_request(BaseRequest):
def __init__(self):
self.data = self.api_load(path_setting.DIARY_SERVICE_CONFIG)
def diary_service(self, diary_id, service_id):
self.params["diary_id"] = diary_id
self.params["service_id"] = service_id
return self.api_send(self.data["diary_service"])
# if __name__ == '__main__':
# print(send_reqest().login_vfc("beijing", "+8612345678912", 1234, "", ""))
# print(send_reqest().diary_data("beijing", "my_diary", 0, 8, 2))
# print(1)
\ No newline at end of file
#更新日记本的修改信息
update:
method: post
url: /api/diary/update_v2/17586198
params:
data:
topic_list: ${topic_list}
json: {}
isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
import path_setting
from in_common.base_request import BaseRequest
class diary_update_request(BaseRequest):
def __init__(self):
self.data = self.api_load(path_setting.DIARY_UPDATE_CONFIG)
def diary_update(self, topic_list):
self.params["topic_list"] = topic_list
return self.api_send(self.data["update"])
...@@ -2,7 +2,7 @@ import path_setting ...@@ -2,7 +2,7 @@ import path_setting
from in_common.base_request import BaseRequest from in_common.base_request import BaseRequest
class diary_vote_request(BaseRequest): class hybrid_api_topic_request(BaseRequest):
def __init__(self): def __init__(self):
self.data = self.api_load(path_setting.DIARY_VOTE_CONFIG) self.data = self.api_load(path_setting.DIARY_VOTE_CONFIG)
......
...@@ -8,6 +8,7 @@ vote: ...@@ -8,6 +8,7 @@ vote:
json: {} json: {}
isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段 isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
#取消点赞
canclevote: canclevote:
method: post method: post
url: /hybrid/api/topic/cancel_vote/_data url: /hybrid/api/topic/cancel_vote/_data
...@@ -17,7 +18,6 @@ canclevote: ...@@ -17,7 +18,6 @@ canclevote:
json: {} json: {}
isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段 isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
# #
detail: detail:
method: get method: get
url: /api/topic/v1 url: /api/topic/v1
...@@ -27,5 +27,3 @@ detail: ...@@ -27,5 +27,3 @@ detail:
json: {} json: {}
isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段 isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
...@@ -2,7 +2,7 @@ import path_setting ...@@ -2,7 +2,7 @@ import path_setting
from in_common.base_request import BaseRequest from in_common.base_request import BaseRequest
class diary_album_request(BaseRequest): class hybrid_diary_request(BaseRequest):
def __init__(self): def __init__(self):
self.data = self.api_load(path_setting.DIARY_ALBUM_CONFIG) self.data = self.api_load(path_setting.DIARY_ALBUM_CONFIG)
......
...@@ -140,6 +140,40 @@ class janus_request(BaseRequest): ...@@ -140,6 +140,40 @@ class janus_request(BaseRequest):
self.params["payment_id"] = payment_id self.params["payment_id"] = payment_id
return self.api_send(self.data["beauty_card_payment_method"]) return self.api_send(self.data["beauty_card_payment_method"])
#次卡-微信支付
def beauty_card_prepay_wechat(self, payment_id):
self.params["payment_id"] = payment_id
return self.api_send(self.data["beauty_card_prepay_wechat"])
#次卡-支付宝支付
def beauty_card_prepay_alipay(self, is_huabei, payment_id):
self.params["is_huabei"] = is_huabei
self.params["payment_id"] = payment_id
return self.api_send(self.data["beauty_card_prepay_alipay"])
#次卡-订单详情
def beauty_card_payment_detail(self, payment_id):
self.params["payment_id"] = payment_id
return self.api_send(self.data["beauty_card_payment_detail"])
#次卡-取消订单
def beauty_card_payment_delete(self, payment_id):
self.params["payment_id"] = payment_id
return self.api_send(self.data["beauty_card_payment_delete"])
#次卡-申请退款
def beauty_card_refund_info(self, order_id):
self.params["order_id"] = order_id
return self.api_send(self.data["beauty_card_refund_info"])
#次卡-提交退款申请
def beauty_card_refund_submit(self, order_id, reason_id, reason_text, reason_type):
self.params["order_id"] = order_id
self.params["reason_id"] = reason_id
self.params["reason_text"] = reason_text
self.params["reason_type"] = reason_type
return self.api_send(self.data["beauty_card_refund_submit"])
# 新版本我的美券列表 # 新版本我的美券列表
def product_my_list(self,start_num,tab_id): def product_my_list(self,start_num,tab_id):
self.params['start_num'] = start_num self.params['start_num'] = start_num
...@@ -148,31 +182,43 @@ class janus_request(BaseRequest): ...@@ -148,31 +182,43 @@ class janus_request(BaseRequest):
if __name__ == '__main__': if __name__ == '__main__':
#打印购物车-猜你喜欢列表接口返回 # #打印购物车-猜你喜欢列表接口返回
print(janus_request().mine_guess_you_like()) # print(janus_request().mine_guess_you_like())
#打印商祥页-详情接口返回 # #打印商祥页-详情接口返回
print(janus_request().product_detail("5857263", "618788", "7.43.0")) # print(janus_request().product_detail("5857263", "618788", "7.43.0"))
#打印商祥页-sku信息接口返回 # #打印商祥页-sku信息接口返回
print(janus_request().sku_info("5857263", "618788")) # print(janus_request().sku_info("5857263", "618788"))
#打印商祥页-美券列表-我的美券点击-744版本及以后-新接口返回 # #打印商祥页-美券列表-我的美券点击-744版本及以后-新接口返回
print(janus_request().product_coupon_my_list(0, 0)) # print(janus_request().product_coupon_my_list(0, 0))
#
#品类聚合页面商品列表接口返回 # #品类聚合页面商品列表接口返回
print(janus_request().tag_service()) # print(janus_request().tag_service())
print("fgx") # print("fgx")
#
#品类聚合页面标签和专场 # #品类聚合页面标签和专场
print(janus_request().polymer()) # print(janus_request().polymer())
print("fgx") # print("fgx")
#
#打印次卡-确认订单接口返回 # #打印次卡-确认订单接口返回
print(janus_request().beauty_card_order_confirm("10176", 1, 1, 0)) # print(janus_request().beauty_card_order_confirm("10176", 1, 1, 0))
#打印次卡-确认订单页面-修改手机号接口返回 # #打印次卡-确认订单页面-修改手机号接口返回
print(janus_request().beauty_card_update_phone("+8612348543876", 1, "084430")) # print(janus_request().beauty_card_update_phone("+8612348543876", 1, "084430"))
#打印次卡-提交订单接口返回 # #打印次卡-提交订单接口返回
print(janus_request().beauty_card_order_submit("12345678912", "10176", 1, 1, 0, 0)) # print(janus_request().beauty_card_order_submit("12345678912", "10176", 1, 1, 0, 0))
#打印次卡-支付平台接口返回 # #打印次卡-支付平台接口返回
print(janus_request().beauty_card_payment_method("101670448736595")) # print(janus_request().beauty_card_payment_method("101670448736595"))
# #打印次卡-微信支付接口返回
print(janus_request().product_my_list(0, 0)) # print(janus_request().beauty_card_prepay_wechat("101353630959868"))
# # 打印次卡-支付宝支付接口返回
# print(janus_request().beauty_card_prepay_alipay(0, "101353630959868"))
# #打印次卡 - 订单详情接口返回
# print(janus_request().beauty_card_payment_detail("101353630959868"))
# #打印次卡 - 取消订单接口返回
# print(janus_request().beauty_card_payment_delete("101353630959868"))
# #打印次卡-申请退款接口返回
# print(janus_request().beauty_card_refund_info("102217820485006"))
#打印次卡-提交退款申请接口返回
print(janus_request().beauty_card_refund_submit("102813852173916", 3, "个人身体原因", 0))
# print(janus_request().product_my_list(0, 0))
...@@ -158,6 +158,82 @@ beauty_card_payment_method: ...@@ -158,6 +158,82 @@ beauty_card_payment_method:
json: {} json: {}
isLogin: 1 isLogin: 1
#次卡-微信支付
beauty_card_prepay_wechat:
method: post
url: /api/janus/beauty_card/prepay/wechat
params: {}
data:
payment_id: ${payment_id}
json: {}
isLogin: 1
#次卡-支付宝支付
beauty_card_prepay_alipay:
method: post
url: /api/janus/beauty_card/prepay/alipay
params: {}
data:
is_huabei: ${is_huabei}
payment_id: ${payment_id}
json: {}
isLogin: 1
##次卡-支付宝支付-花呗分期
#beauty_card_prepay_alipay_huabei:
# method: post
# url: /api/janus/beauty_card/prepay/alipay
# params: {}
# data:
# huabei_period: ${huabei_period}
# is_huabei: ${is_huabei}
# payment_id: ${payment_id}
# json: {}
# isLogin: 1
#次卡-订单详情
beauty_card_payment_detail:
method: get
url: /api/janus/beauty_card/payment/detail
params:
payment_id: ${payment_id}
data: {}
json: {}
isLogin: 1
#次卡-取消订单
beauty_card_payment_delete:
method: post
url: /api/janus/beauty_card/payment/delete
params: {}
data:
payment_id: ${payment_id}
json: {}
isLogin: 1
#次卡-申请退款
beauty_card_refund_info:
method: get
url: /api/janus/beauty_card/refund/info
params:
order_id: ${order_id}
data: {}
json: {}
isLogin: 1
#次卡-提交退款申请
beauty_card_refund_submit:
method: post
url: /api/janus/beauty_card/refund/submit
params: {}
data:
order_id: ${order_id}
reason_id: ${reason_id}
reason_text: ${reason_text}
reason_type: ${reason_type}
json: {}
isLogin: 1
#新版本我的美券 #新版本我的美券
coupon_my_list: coupon_my_list:
method: get method: get
......
...@@ -15,8 +15,11 @@ class orders_request(BaseRequest): ...@@ -15,8 +15,11 @@ class orders_request(BaseRequest):
return self.api_send(self.data["my_v2"]) return self.api_send(self.data["my_v2"])
#我的订单-各状态订单数量
def my_status(self):
return self.api_send(self.data["my_status"])
if __name__ == '__main__': if __name__ == '__main__':
print(orders_request().my_v2(0,1,"7.44.0")) print(orders_request().my_v2(0,1,"7.44.0"))
#打印我的订单-各状态订单数量接口返回
print(orders_request().my_status())
...@@ -6,3 +6,12 @@ my_v2: ...@@ -6,3 +6,12 @@ my_v2:
status: ${status} status: ${status}
version: ${version} version: ${version}
isLogin: 1 isLogin: 1
#我的订单-各状态订单数量
my_status:
method: get
url: /api/orders/my/status
params: {}
data: {}
json: {}
isLogin: 1
#日记贴一级评论创建[这个是非本身日记贴:21116006]--暂时未解决复写yaml文件的问题所以单独把创建评论踢出去
reply_create:
method: post
url: /api/topic/reply/create/21249632/
params:
channel: ${channel}
data:
content: ${content}
json: {}
isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
#日记贴二级评论创建[这个是非本身日记贴:21116006]
sub_reply_create:
method: post
url: /api/topic/reply/create/21249632/
params:
channel: ${channel}
data:
content: ${content}
replied_id: ${replied_id}
json: {}
isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
\ No newline at end of file
import path_setting
from in_common.base_request import BaseRequest
class topic_reply_create_request(BaseRequest):
def __init__(self):
self.data = self.api_load(path_setting.TOPIC_REPLY_CREATE_CONFIG)
def topic_reply_create(self, content, channel):
self.params["content"] = content
self.params["channel"] = channel
return self.api_send(self.data["reply_create"])
def topic_sub_reply_create(self, content, channel, replied_id):
self.params["content"] = content
self.params["channel"] = channel
self.params["replied_id"] = replied_id
return self.api_send(self.data["sub_reply_create"])
import path_setting
from in_common.base_request import BaseRequest
class topic_request(BaseRequest):
def __init__(self):
self.data = self.api_load(path_setting.TOPIC_CONFIG)
# 详情页内部--点赞
def topic_vote(self, topic_id):
self.params["topic_id"] = topic_id
return self.api_send(self.data["vote"])
# 详情页内部-取消点赞
def topic_canclevote(self, topic_id):
self.params["topic_id"] = topic_id
return self.api_send(self.data["canclevote"])
# 进入日记贴详情页-用来判断这篇日记贴点赞过没
def topic_detail(self, topic_id):
self.params["topic_id"] = topic_id
return self.api_send(self.data["detail"])
# def diary_test(self):
# return self.api_send(self.data["detail"])
# if __name__ == '__main__':
# r = diary_vote_request.diary_detail(21249959)
# print(r)
#日记贴详情页--日记贴点赞
vote:
method: post
url: /api/topic/vote/
params:
data:
topic_id: ${topic_id}
json: {}
isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
#取消点赞
canclevote:
method: delete
url: /api/topic/vote/
params:
topic_id: ${topic_id}
data: {}
json: {}
isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
#详情页内容
detail:
method: get
url: /api/topic/v1
params:
topic_id: ${topic_id}
data: {}
json: {}
isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
##日记贴相关美购--暂时没有
#topic_service:
# method: get
# url: /api/diary/services
# params:
# diary_id: ${diary_id}
# service_id: ${service_id}
# data:
# json: {}
##日记贴一级评论创建[这个是非本身日记贴:21116006]--暂时未解决复写yaml文件的问题所以单独把创建评论踢出去
#reply_create:
# method: post
# url: /api/topic/reply/create/21249632/
# params:
# channel: ${channel}
# data:
# content: ${content}
# json: {}
# isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
#
#
##日记贴二级评论创建[这个是非本身日记贴:21116006]
#sub_reply_create:
# method: post
# url: /api/topic/reply/create/21249632/
# params:
# channel: ${channel}
# data:
# content: ${content}
# replied_id: ${replied_id}
# json: {}
# isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
\ No newline at end of file
#日记本修改信息 #日记贴评论点赞
operation: topic_reply_vote:
method: post method: post
url: /api/diary/additional_info/v2 url: /hybrid/api/topicreply/vote/_data
params: params:
data: data:
diary_id: ${diary_id} id: ${id}
title: ${title}
operation_timestamp: ${operation_timestamp}
doctor_name: ${doctor_name}
hospital_name: ${hospital_name}
json: {} json: {}
isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段 isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
topic_reply_canclevote:
#查看日记修改信息页面 method: post
additional_info: url: /hybrid/api/topicreply/cancel_vote/_data
method: get
url: /api/diary/operation/17586198/
params: params:
data: {} data:
id: ${id}
json: {} json: {}
isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段 isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
#
import path_setting
from in_common.base_request import BaseRequest
class topicreply_vote_request(BaseRequest):
def __init__(self):
self.data = self.api_load(path_setting.TOPIC_REPLY_VOTE_CONFIG)
def topic_reply_vote(self, id):
self.params["id"] = id
return self.api_send(self.data["topic_reply_vote"])
def topic_reply_canclevote(self, id):
self.params["id"] = id
return self.api_send(self.data["topic_reply_canclevote"])
# 进入日记贴详情页-用来判断这篇日记贴点赞过没
# def diary_detail(self, topic_id):
# self.params["topic_id"] = topic_id
# return self.api_send(self.data["detail"])
# def diary_test(self):
# return self.api_send(self.data["detail"])
# if __name__ == '__main__':
# r = diary_vote_request.diary_detail(21249959)
# print(r)
#查看用户帖子详情页
tractate_detail:
method: get
url: /api/tractate/new_detail
params:
current_city_id: ${current_city_id}
tractate_id: ${tractate_id}
data_type: ${data_type}
data: {}
json: {}
isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
#查看日记本相册页面
#album:
# method: get
# url: /hybrid/diary/album/17586198/_data
# params:
# data: {}
# json: {}
# isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
import path_setting
from in_common.base_request import BaseRequest
class tractate_detail_request(BaseRequest):
def __init__(self):
self.data = self.api_load(path_setting.TRACTATE_DETAIL_CONFIG)
def tractate_detail(self, current_city_id, tractate_id, data_type):
self.params["current_city_id"] = current_city_id
self.params["tractate_id"] = tractate_id
self.params["data_type"] = data_type
return self.api_send(self.data["tractate_detail"])
import path_setting
from in_common.base_request import BaseRequest
class tractate_request(BaseRequest):
def __init__(self):
self.data = self.api_load(path_setting.TRACTATE_CONFIG)
# 帖子详情页内容
def tractate_detail(self, current_city_id, tractate_id, data_type):
self.params["current_city_id"] = current_city_id
self.params["tractate_id"] = tractate_id
self.params["data_type"] = data_type
return self.api_send(self.data["tractate_detail"])
# 帖子相关美购
def tractate_related_service(self, current_city_id, tractate_id, data_type):
self.params["current_city_id"] = current_city_id
self.params["tractate_id"] = tractate_id
self.params["data_type"] = data_type
return self.api_send(self.data["related_service"])
# 帖子外显评论
def reply(self, current_city_id, id, data_type):
self.params["current_city_id"] = current_city_id
self.params["id"] = id
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"])
#查看用户帖子详情页
tractate_detail:
method: get
url: /api/tractate/new_detail
params:
current_city_id: ${current_city_id}
tractate_id: ${tractate_id}
data_type: ${data_type}
data: {}
json: {}
isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
#查看用户帖子相关美购详情
related_service:
method: get
url: /api/tractate/related_service
params:
current_city_id: ${current_city_id}
tractate_id: ${tractate_id}
data_type: ${data_type}
data: {}
json: {}
isLogin: 0 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
#查看用户帖子外显评论
reply:
method: get
url: /api/tractate/reply
params:
current_city_id: ${current_city_id}
id: ${id}
data_type: ${data_type}
data: {}
json: {}
isLogin: 0 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
#帖子收藏
favor:
method: post
url: /api/tractate/favor
params:
data:
data_type: ${data_type}
tractate_id: ${tractate_id}
json: {}
isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
#帖子取消收藏
cancelfavor:
method: post
url: /api/tractate/favor/cancel
params:
data:
data_type: ${data_type}
tractate_id: ${tractate_id}
json: {}
isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
...@@ -21,6 +21,17 @@ class user_request(BaseRequest): ...@@ -21,6 +21,17 @@ class user_request(BaseRequest):
def answer(self, user): def answer(self, user):
self.params["user"] = user self.params["user"] = user
return self.api_send(self.data["answer"]) return self.api_send(self.data["answer"])
#日记贴相关部分配置
def __init__(self):
self.data = self.api_load(path_setting.TOPIC_FAVOR_CONFIG)
#日记贴帖子相关-收藏
def topic_favor(self):
return self.api_send(self.data["favor"])
#日记贴取消收藏
def topic_canclefavor(self):
return self.api_send(self.data["canclefavor"])
if __name__ == '__main__': if __name__ == '__main__':
...@@ -31,4 +42,9 @@ if __name__ == '__main__': ...@@ -31,4 +42,9 @@ if __name__ == '__main__':
#打印医生/医院主页问答列表接口返回 #打印医生/医院主页问答列表接口返回
print(user_request().answer("21476198")) print(user_request().answer("21476198"))
# 日记贴收藏&取消收藏
# print(user_request().topic_favor())
# print(user_request().topic_canclefavor())
...@@ -20,3 +20,21 @@ answer: ...@@ -20,3 +20,21 @@ answer:
data: {} data: {}
json: {} json: {}
#日记贴--收藏
favor:
method: post
url: /api/user/problem_favor/21249632/
params:
data: {}
json: {}
isLogin: 1
#日记贴--取消收藏
canclefavor:
method: delete
url: /api/user/problem_favor/21249632/
params:
data: {}
json: {}
isLogin: 1
...@@ -9,49 +9,81 @@ LOGIN_FUNCTION_DATA = os.path.join(BASE_DIR, "backend_auto", "login_session_func ...@@ -9,49 +9,81 @@ LOGIN_FUNCTION_DATA = os.path.join(BASE_DIR, "backend_auto", "login_session_func
APYAML_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "account_request.yaml") APYAML_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "account_request.yaml")
LOGIN_VFC = os.path.join(BASE_DIR, "backend_auto/test_backend_data/account_data", "login_vfc.yaml") LOGIN_VFC = os.path.join(BASE_DIR, "backend_auto/test_backend_data/account_data", "login_vfc.yaml")
# 日记本总接口配置
DIARY_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "diary_request.yaml")
#日记本详情页--字段判空 #日记本详情页--字段判空
DIARY_DATA_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "diary_data_request.yaml") DIARY_DATA = os.path.join(BASE_DIR, "backend_auto/test_backend_data/diary_data", "topic_data.yaml")
DIARY_DATA = os.path.join(BASE_DIR, "backend_auto/test_backend_data/account_data", "diary_data.yaml")
#日记本关联美购 #日记本关联美购
DIARY_SERVICE_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "diary_service.yaml") DIARY_SERVICE_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "diary_service.yaml")
DIARY_SERVICE = os.path.join(BASE_DIR, "backend_auto/test_backend_data/diary", "diary_service.yaml") DIARY_SERVICE = os.path.join(BASE_DIR, "backend_auto/test_backend_data/diary_data", "diary_service.yaml")
#日记本收藏 #日记本收藏&取消收藏
DIARY_ISFAVOR_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "diary_isfavor.yaml") DIARY_FAVOR = os.path.join(BASE_DIR, "backend_auto/test_backend_data/diary_data", "favor.yaml")
DIARY_ISFAVOR = os.path.join(BASE_DIR, "backend_auto/test_backend_data/diary", "diary_isfavor.yaml")
# 日记本取消收藏
DIARY_CANCELFAVOR_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "diary_cancelfavor.yaml")
DIARY_CANCELFAVOR = os.path.join(BASE_DIR, "backend_auto/test_backend_data/diary", "diary_cancelfavor.yaml")
# 日记本列表-日记贴点赞相关() # 日记本列表-日记贴点赞相关()
DIARY_VOTE_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "diary_vote.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/diary", "diary_vote.yaml") DIARY_VOTE = os.path.join(BASE_DIR, "backend_auto/test_backend_data/hybrid_data", "api_topic_vote.yaml")
# 日记本列表-展示评论列表
DIARY_COMMON_REPLY_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "diary_common_reply.yaml")
DIARY_COMMON_REPLY = os.path.join(BASE_DIR, "backend_auto/test_backend_data/diary", "diary_common_reply.yaml")
# 日记本修改日记信息operation--目前好像直接用接口写无权限稍后解决 # 日记本修改日记信息operation--目前好像直接用接口写无权限稍后解决
DIARY_OPERATION_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "diary_operation.yaml") 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", "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_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", "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", "diary_album.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/diary", "diary_album.yaml") DIARY_ALBUM = os.path.join(BASE_DIR, "backend_auto/test_backend_data/hybrid_data", "diary_album.yaml")
# 日记本&帖子&日记贴&帖子&问答各个详情页下方推荐内容 # 日记本&帖子&日记贴&帖子&问答各个详情页下方推荐内容
PERSONAL_RECOMMENDS_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "personal_recommends.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") PERSONAL_RECOMMENDS = os.path.join(BASE_DIR, "backend_auto/test_backend_data/personal_data", "personal_recommends.yaml")
# 日记本列表-展示评论列表---也是总的common的配置
DIARY_COMMON_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "common_request.yaml")
# 日记本列表-一级评论展示评论列表
DIARY_COMMON_REPLY = os.path.join(BASE_DIR, "backend_auto/test_backend_data/common_data", "reply.yaml")
# 日记贴-子评论列表
TOPIC_SUB_COMMON = os.path.join(BASE_DIR, "backend_auto/test_backend_data/common_data", "sub_common.yaml")
# 日记贴-创建一级评论&二级评论
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")
# 日记贴-详情页内容
TOPIC_DETAIL = os.path.join(BASE_DIR, "backend_auto/test_backend_data/topic_data", "v1.yaml")
# 日记贴-点赞&取消点赞--详情页内部
TOPIC_VOTE = os.path.join(BASE_DIR, "backend_auto/test_backend_data/topic_data", "vote.yaml")
# 帖子详情页内容--也是总的tractate接口的配置
TRACTATE_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "tractate_request.yaml")
# 帖子详情页内容 # 帖子详情页内容
TRACTATE_DETAIL_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "tractate_detail.yaml") TRACTATE_DETAIL = os.path.join(BASE_DIR, "backend_auto/test_backend_data/tractate_data", "new_detail.yaml")
TRACTATE_DETAIL = os.path.join(BASE_DIR, "backend_auto/test_backend_data/tractate_data", "tractate_detail.yaml") # 帖子详情页--相关美购&推荐美购
TRACTATE_RELATED_SERVICE = os.path.join(BASE_DIR, "backend_auto/test_backend_data/tractate_data", "related_service.yaml")
# 帖子详情页--外显评论
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")
...@@ -158,8 +190,8 @@ JANUS_PRODUCT_MY_LIST_DATA = os.path.join(BASE_DIR, "backend_auto/test_backend_d ...@@ -158,8 +190,8 @@ JANUS_PRODUCT_MY_LIST_DATA = os.path.join(BASE_DIR, "backend_auto/test_backend_d
ORDERS_MY_V2_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "orders_request.yaml") ORDERS_MY_V2_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "orders_request.yaml")
# 订单列表 # 订单列表
ORDERS_MY_V2_DATA = os.path.join(BASE_DIR, "backend_auto/test_backend_data/orders_data", "my_v2.yaml") ORDERS_MY_V2_DATA = os.path.join(BASE_DIR, "backend_auto/test_backend_data/orders_data", "my_v2.yaml")
#我的订单-各状态订单数量
ORDER_MY_STATUS = os.path.join(BASE_DIR, "backend_auto/test_backend_data/orders_data", "my_status.yaml")
LOGIN_PASSWD = os.path.join(BASE_DIR, "backend_auto/test_backend_data/accounts_data", "login_passwd.yaml") LOGIN_PASSWD = os.path.join(BASE_DIR, "backend_auto/test_backend_data/accounts_data", "login_passwd.yaml")
LOGIN_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "accounts_request.yaml") LOGIN_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "accounts_request.yaml")
...@@ -274,6 +306,18 @@ BEAUTY_CARD_UPDATE_PHONE = os.path.join(BASE_DIR, "backend_auto/test_backend_dat ...@@ -274,6 +306,18 @@ BEAUTY_CARD_UPDATE_PHONE = os.path.join(BASE_DIR, "backend_auto/test_backend_dat
BEAUTY_CARD_ORDER_SUBMIT = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_data", "beauty_card_order_submit.yaml") BEAUTY_CARD_ORDER_SUBMIT = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_data", "beauty_card_order_submit.yaml")
#次卡-支付平台 #次卡-支付平台
BEAUTY_CARD_PAYMENT_METHOD = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_data", "beauty_card_payment_method.yaml") BEAUTY_CARD_PAYMENT_METHOD = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_data", "beauty_card_payment_method.yaml")
#次卡-微信支付
BEAUTY_CARD_PREPAY_WECHAT = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_data", "beauty_card_prepay_wechat.yaml")
#次卡-支付宝支付
BEAUTY_CARD_PREPAY_ALIPAY = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_data", "beauty_card_prepay_alipay.yaml")
#次卡-订单详情
BEAUTY_CARD_PAYMENT_DETAIL = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_data", "beauty_card_payment_detail.yaml")
#次卡-取消订单
BEAUTY_CARD_PAYMENT_DELETE = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_data", "beauty_card_payment_delete.yaml")
#次卡-申请退款
BEAUTY_CARD_REFUND_INFO = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_data", "beauty_card_refund_info.yaml")
#次卡-提交退款申请
BEAUTY_CARD_REFUND_SUBMIT = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_data", "beauty_card_refund_submit.yaml")
#捜索结果页-医生/医院tab #捜索结果页-医生/医院tab
CONTENTV6_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "search_request.yaml") CONTENTV6_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "search_request.yaml")
......
...@@ -3,17 +3,17 @@ import pytest ...@@ -3,17 +3,17 @@ import pytest
from ids_list import get_ids from ids_list import get_ids
import path_setting import path_setting
from in_common.base_request import BaseRequest from in_common.base_request import BaseRequest
from all_backend_api.diary_common_reply_request import diary_common_reply_request from all_backend_api.common_request import common_request
class TestDiaryCommonReply: class TestReply:
data = BaseRequest().api_load(path_setting.DIARY_COMMON_REPLY) 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, "diary_common_reply")
@pytest.mark.parametrize("param", diary_common_reply_data, ids=diary_common_reply_case) @pytest.mark.parametrize("param", diary_common_reply_data, ids=diary_common_reply_case)
def test_diary_common_reply(self, param): def test_reply(self, param):
# print(2) # 日记贴的评论列表
r = diary_common_reply_request().diary_common_reply(param["id"], param["type"]) r = common_request().diary_common_reply(param["id"], param["type"])
# print(r) # print(r)
if r["error"] == 0: if r["error"] == 0:
assert r["error"] == param["assert1"] assert r["error"] == param["assert1"]
...@@ -27,6 +27,27 @@ class TestDiaryCommonReply: ...@@ -27,6 +27,27 @@ class TestDiaryCommonReply:
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_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]["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]["is_voted"] is not None and r["data"]["reply_data"][0]["is_voted"] is not "" # 是否点赞
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.common_request import common_request
class TestRrplySubReply:
data = BaseRequest().api_load(path_setting.TOPIC_SUB_COMMON)
topic_sub_common_case, topic_sub_common_data = get_ids(data, "topic_sub_common")
@pytest.mark.parametrize("param", topic_sub_common_data, ids=topic_sub_common_case)
def test_reply_sub_reply(self, param):
# print(2)
r = common_request().topic_sub_common(param["id"], param["type"], param["reply_id"])
# print(r)
if r["error"] == 0:
assert r["error"] == param["assert1"]
# 先判断有没有评论,然后判断里面需要的那些字段,如点赞字段,评论总数等,不传值,传空值
if r["data"]:
assert r["data"][0]["at_user_id"] is not None and r["data"][0]["at_user_id"] is not "" # 用户id
assert r["data"][0]["comment_user_gm_url"] is not None and r["data"][0]["comment_user_gm_url"] is not "" # 点击评论跳转链接
assert r["data"][0]["at_user_gm_url"] is not None and r["data"][0]["at_user_gm_url"] is not "" # 用户名跳转链接
assert r["data"][0]["nickname"] is not None and r["data"][0]["nickname"] is not "" # 用户名
assert r["data"][0]["content"] is not None and r["data"][0]["content"] is not "" # 评论内容
assert r["data"][0]["comment_user_id"] is not None and r["data"][0]["comment_user_id"] is not "" # 评论人
assert r["data"][0]["comment_id"] is not None and r["data"][0]["comment_id"] is not "" # 评论id
assert r["data"]["reply_data"][0]["_type"] == param["type"] # 校验评论列表返回类型
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.diary_cancelfavor_request import diary_cancelfavor_request
class TestDiaryCancelfavor:
data = BaseRequest().api_load(path_setting.DIARY_CANCELFAVOR)
diary_cancelfavor_case, diary_cancelfavor_data = get_ids(data, "diary_cancelfavor")
@pytest.mark.parametrize("param", diary_cancelfavor_data, ids=diary_cancelfavor_case)
def test_diary_cancelfavor(self, param):
r = diary_cancelfavor_request().diary_cancelfavor()
# print(r)
if r["error"] == 0:
assert r["message"] == param["assert"]
if r["error"] == 1:
assert r["message"] == param["assert2"]
#
...@@ -3,27 +3,32 @@ import pytest ...@@ -3,27 +3,32 @@ import pytest
from ids_list import get_ids from ids_list import get_ids
import path_setting import path_setting
from in_common.base_request import BaseRequest from in_common.base_request import BaseRequest
from all_backend_api.diary_isfavor_request import diary_isfavor_request from all_backend_api.diary_request import diary_request
class TestDiaryIsfavor: class TestFavor:
data = BaseRequest().api_load(path_setting.DIARY_ISFAVOR) data = BaseRequest().api_load(path_setting.DIARY_FAVOR)
diary_isfavor_case, diary_isfavor_data = get_ids(data, "diary_isfavor") diary_favor_case, diary_favor_data = get_ids(data, "diary_favor")
@pytest.mark.parametrize("param", diary_isfavor_data, ids=diary_isfavor_case) @pytest.mark.parametrize("param", diary_favor_data, ids=diary_favor_case)
def test_diary_isfavor(self, param): def test_favor(self, param):
r = diary_isfavor_request().diary_isfavor() r = diary_request().diary_isfavor()
# print(r) # print(r)
if r["error"] == 0: if r["error"] == 0:
assert r["message"] == param["assert"] assert r["message"] == param["assert"]
if r["error"] == 1: if r["error"] == 1:
assert r["message"] ==param["assert2"] assert r["message"] ==param["assert2"]
r = diary_request().diary_cancelfavor()
# print(r)
if r["error"] == 0:
assert r["message"] == param["assert3"]
if r["error"] == 1:
assert r["message"] == param["assert2"]
# 收藏之后取消收藏
# r1 = diary_isfavor_request().diary_cancelfavor()
# if r["error"] == 0:
# assert r["error"] == param["assert"]
......
...@@ -3,7 +3,7 @@ import pytest ...@@ -3,7 +3,7 @@ import pytest
from ids_list import get_ids from ids_list import get_ids
import path_setting import path_setting
from in_common.base_request import BaseRequest from in_common.base_request import BaseRequest
from all_backend_api.diary_operation_request import diary_operation_request from all_backend_api.diary_request import diary_request
class TestDiaryOperation: class TestDiaryOperation:
...@@ -11,8 +11,8 @@ class TestDiaryOperation: ...@@ -11,8 +11,8 @@ class TestDiaryOperation:
diary_operation_case, diary_operation_data = get_ids(data, "diary_operation") diary_operation_case, diary_operation_data = get_ids(data, "diary_operation")
@pytest.mark.parametrize("param", diary_operation_data, ids=diary_operation_case) @pytest.mark.parametrize("param", diary_operation_data, ids=diary_operation_case)
def test_diary_operation(self, param): def test_diary_operation(self, param):
r = diary_operation_request().diary_operation(param["diary_id"], param["title"], param["operation_timestamp"], param["doctor_name"], param["hospital_name"]) r = diary_request().diary_operation(param["diary_id"], param["title"], param["operation_timestamp"], param["doctor_name"], param["hospital_name"])
result = diary_operation_request().diary_additional_info() result = diary_request().diary_additional_info()
if result["error"] == 1: if result["error"] == 1:
assert r["message"] == param["assert"] assert r["message"] == param["assert"]
# if r["error"] == 1: # if r["error"] == 1:
......
...@@ -3,7 +3,7 @@ import pytest ...@@ -3,7 +3,7 @@ import pytest
from ids_list import get_ids from ids_list import get_ids
import path_setting import path_setting
from in_common.base_request import BaseRequest from in_common.base_request import BaseRequest
from all_backend_api.diary_data_request import diary_data_request from all_backend_api.diary_request import diary_request
class TestDiaryService: class TestDiaryService:
...@@ -13,7 +13,7 @@ class TestDiaryService: ...@@ -13,7 +13,7 @@ class TestDiaryService:
@pytest.mark.parametrize("param",diary_data_data,ids=diary_data_case) @pytest.mark.parametrize("param",diary_data_data,ids=diary_data_case)
def test_diary_service(self,param): def test_diary_service(self,param):
# print(2) # print(2)
r = diary_data_request().diary_data(param["current_city_id"], param["diary_referrer"], param["sort"], param["count"], param["start_num"]) r = diary_request().diary_data(param["current_city_id"], param["diary_referrer"], param["sort"], param["count"], param["start_num"])
# print(r) # print(r)
if r["error"] == 0: if r["error"] == 0:
assert r["error"] == param["assert"] assert r["error"] == param["assert"]
......
...@@ -3,17 +3,17 @@ import pytest ...@@ -3,17 +3,17 @@ import pytest
from ids_list import get_ids from ids_list import get_ids
import path_setting import path_setting
from in_common.base_request import BaseRequest from in_common.base_request import BaseRequest
from all_backend_api.diary_data_request import diary_data_request from all_backend_api.diary_request import diary_request
class TestDiaryData: class TestTopicData:
data = BaseRequest().api_load(path_setting.DIARY_DATA) data = BaseRequest().api_load(path_setting.DIARY_DATA)
diary_data_case, diary_data_data = get_ids(data, "diary_data") diary_data_case, diary_data_data = get_ids(data, "diary_data")
@pytest.mark.parametrize("param",diary_data_data,ids=diary_data_case) @pytest.mark.parametrize("param",diary_data_data,ids=diary_data_case)
def test_diary_data(self,param): def test_topic_data(self,param):
# print(2) # print(2)
r = diary_data_request().diary_data(param["current_city_id"], param["diary_referrer"], param["sort"], param["count"], param["start_num"]) r = diary_request().diary_data(param["current_city_id"], param["diary_referrer"], param["sort"], param["count"], param["start_num"])
# print(r) # print(r)
if r["error"] == 0: if r["error"] == 0:
assert r["error"] == param["assert"] assert r["error"] == param["assert"]
......
...@@ -3,7 +3,7 @@ import pytest ...@@ -3,7 +3,7 @@ import pytest
from ids_list import get_ids from ids_list import get_ids
import path_setting import path_setting
from in_common.base_request import BaseRequest from in_common.base_request import BaseRequest
from all_backend_api.diary_update_request import diary_update_request from all_backend_api.diary_request import diary_request
class TestDiaryUpdate: class TestDiaryUpdate:
...@@ -12,7 +12,7 @@ class TestDiaryUpdate: ...@@ -12,7 +12,7 @@ class TestDiaryUpdate:
@pytest.mark.parametrize("param", diary_update_data, ids=diary_update_case) @pytest.mark.parametrize("param", diary_update_data, ids=diary_update_case)
def test_diary_update(self, param): def test_diary_update(self, param):
r = diary_update_request().diary_update(param["topic_list"]) r = diary_request().diary_update(param["topic_list"])
# print(r) # print(r)
# if r["error"] == 0: # if r["error"] == 0:
# assert r["message"] == param["assert"] # assert r["message"] == param["assert"]
......
...@@ -3,7 +3,7 @@ import pytest ...@@ -3,7 +3,7 @@ import pytest
from ids_list import get_ids from ids_list import get_ids
import path_setting import path_setting
from in_common.base_request import BaseRequest from in_common.base_request import BaseRequest
from all_backend_api.diary_vote_request import diary_vote_request from all_backend_api.hybrid_api_topic_request import hybrid_api_topic_request
class TestDiaryVote: class TestDiaryVote:
...@@ -11,10 +11,10 @@ class TestDiaryVote: ...@@ -11,10 +11,10 @@ class TestDiaryVote:
diary_vote_case, diary_vote_data = get_ids(data, "diary_vote") diary_vote_case, diary_vote_data = get_ids(data, "diary_vote")
@pytest.mark.parametrize("param", diary_vote_data, ids=diary_vote_case) @pytest.mark.parametrize("param", diary_vote_data, ids=diary_vote_case)
def test_diary_vote(self, param): def test_api_topic_vote(self, param):
# print(111) # print(111)
# print(diary_vote_case) # print(diary_vote_case)
r = diary_vote_request().diary_detail(param["topic_id"]) r = hybrid_api_topic_request().diary_detail(param["topic_id"])
# print(r) # print(r)
# 可以多加一个d代表详情页 # 可以多加一个d代表详情页
if r["error"] == 0: if r["error"] == 0:
...@@ -22,19 +22,19 @@ class TestDiaryVote: ...@@ -22,19 +22,19 @@ class TestDiaryVote:
# 如果没有点过赞,就先校验点赞之后再取消点赞。【最后保持取消点赞的状态】 # 如果没有点过赞,就先校验点赞之后再取消点赞。【最后保持取消点赞的状态】
if not r["data"]["data"]["is_liked"]: if not r["data"]["data"]["is_liked"]:
# print(222) # print(222)
vote = diary_vote_request().diary_vote(param["id"]) vote = hybrid_api_topic_request().diary_vote(param["id"])
assert vote["error"] == 0 assert vote["error"] == 0
# 校验二次点赞无效 # 校验二次点赞无效
vote = diary_vote_request().diary_vote(param["id"]) vote = hybrid_api_topic_request().diary_vote(param["id"])
assert vote["message"] == param["assert3"] assert vote["message"] == param["assert3"]
assert vote["error"] == 1 assert vote["error"] == 1
# 取消点赞,回到取消点赞的状态 # 取消点赞,回到取消点赞的状态
canclevote = diary_vote_request().diary_canclevote(param["id"]) canclevote = hybrid_api_topic_request().diary_canclevote(param["id"])
assert canclevote["error"] == 0 assert canclevote["error"] == 0
else: else:
# 如果是已经点过赞的状态就直接取消点赞 # 如果是已经点过赞的状态就直接取消点赞
# print(111) # print(111)
canclevote = diary_vote_request().diary_canclevote(param["id"]) canclevote = hybrid_api_topic_request().diary_canclevote(param["id"])
assert canclevote["error"] == 0 assert canclevote["error"] == 0
...@@ -42,13 +42,13 @@ class TestDiaryVote: ...@@ -42,13 +42,13 @@ class TestDiaryVote:
# if r["error"] == 1: # if r["error"] == 1:
# assert r["message"] ==param["assert2"] # assert r["message"] ==param["assert2"]
# 收藏之后取消收藏 # 收藏之后取消收藏
# r1 = diary_isfavor_request().diary_cancelfavor() # r1 = diary_isfavor_request().diary_cancelfavor()
# if r["error"] == 0: # if r["error"] == 0:
# assert r["error"] == param["assert"] # assert r["error"] == param["assert"]
......
...@@ -3,7 +3,7 @@ import pytest ...@@ -3,7 +3,7 @@ import pytest
from ids_list import get_ids from ids_list import get_ids
import path_setting import path_setting
from in_common.base_request import BaseRequest from in_common.base_request import BaseRequest
from all_backend_api.diary_album_request import diary_album_request from all_backend_api.hybrid_diary_request import hybrid_diary_request
class TestDiaryAlbum: class TestDiaryAlbum:
...@@ -12,7 +12,7 @@ class TestDiaryAlbum: ...@@ -12,7 +12,7 @@ class TestDiaryAlbum:
@pytest.mark.parametrize("param", diary_album_data, ids=diary_album_case) @pytest.mark.parametrize("param", diary_album_data, ids=diary_album_case)
def test_diary_album(self, param): def test_diary_album(self, param):
r = diary_album_request().diary_album() r = hybrid_diary_request().diary_album()
# print(r) # print(r)
if r["error"] == 0: if r["error"] == 0:
assert r["data"][2]["images"][0]["is_cover"] == param["assert"] assert r["data"][2]["images"][0]["is_cover"] == param["assert"]
......
import pytest
from all_backend_api.janus_request import janus_request
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
class TestBeautyCardPaymentDelete:
data = BaseRequest().api_load(path_setting.BEAUTY_CARD_PAYMENT_DELETE)
beauty_card_payment_delete_case, beauty_card_payment_delete_data = get_ids(data, "beauty_card_payment_delete")
@pytest.mark.parametrize("param", beauty_card_payment_delete_data, ids=beauty_card_payment_delete_case)
def test_beauty_card_payment_delete(self, param):
payment = janus_request().beauty_card_order_submit("12345678912", "10176", 1, 1, 0, 0)
payment_id = payment["data"]["payment_id"]
r = janus_request().beauty_card_payment_delete(payment_id)
if r["error"] == 0:
assert r["data"]["message"] == param["assert_data_message"]
import pytest
from all_backend_api.janus_request import janus_request
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
class TestBeautyCardPaymentDetail:
data = BaseRequest().api_load(path_setting.BEAUTY_CARD_PAYMENT_DETAIL)
beauty_card_payment_detail_case, beauty_card_payment_detail_data = get_ids(data, "beauty_card_payment_detail")
@pytest.mark.parametrize("param", beauty_card_payment_detail_data, ids=beauty_card_payment_detail_case)
def test_beauty_card_payment_detail(self, param):
payment = janus_request().beauty_card_order_submit("12345678912", "10176", 1, 1, 0, 0)
payment_id = payment["data"]["payment_id"]
r = janus_request().beauty_card_payment_detail(payment_id)
if r["error"] == 0:
assert r["error"] == param["assert_error"]
import pytest
from all_backend_api.janus_request import janus_request
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
class TestBeautyCardPrepayAlipay:
data = BaseRequest().api_load(path_setting.BEAUTY_CARD_PREPAY_ALIPAY)
beauty_card_prepay_alipay_case, beauty_card_prepay_alipay_data = get_ids(data, "beauty_card_prepay_alipay")
@pytest.mark.parametrize("param", beauty_card_prepay_alipay_data, ids=beauty_card_prepay_alipay_case)
def test_beauty_card_prepay_alipay(self, param):
payment = janus_request().beauty_card_order_submit("12345678912", "10176", 1, 1, 0, 0)
payment_id = payment["data"]["payment_id"]
r = janus_request().beauty_card_prepay_alipay(param["is_huabei"], payment_id)
if r["error"] == 0:
assert r["error"] == param["assert_error"]
import pytest
from all_backend_api.janus_request import janus_request
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
class TestBeautyCardPrepayWechat:
data = BaseRequest().api_load(path_setting.BEAUTY_CARD_PREPAY_WECHAT)
beauty_card_prepay_wechat_case, beauty_card_prepay_wechat_data = get_ids(data, "beauty_card_prepay_wechat")
@pytest.mark.parametrize("param", beauty_card_prepay_wechat_data, ids=beauty_card_prepay_wechat_case)
def test_beauty_card_prepay_wechat(self, param):
payment = janus_request().beauty_card_order_submit("12345678912", "10176", 1, 1, 0, 0)
payment_id = payment["data"]["payment_id"]
r = janus_request().beauty_card_prepay_wechat(payment_id)
if r["error"] == 0:
assert r["error"] == param["assert_error"]
import pytest
from all_backend_api.janus_request import janus_request
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
class TestBeautyCardRefundInfo:
data = BaseRequest().api_load(path_setting.BEAUTY_CARD_REFUND_INFO)
beauty_card_refund_info_case, beauty_card_refund_info_data = get_ids(data, "beauty_card_refund_info")
@pytest.mark.parametrize("param", beauty_card_refund_info_data, ids=beauty_card_refund_info_case)
def test_beauty_card_refund_info(self, param):
r = janus_request().beauty_card_refund_info(param["order_id"])
if r["error"] == 0:
assert r["error"] == param["assert_error"]
import pytest
from all_backend_api.janus_request import janus_request
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
class TestBeautyCardRefundSubmit:
data = BaseRequest().api_load(path_setting.BEAUTY_CARD_REFUND_SUBMIT)
beauty_card_refund_submit_case, beauty_card_refund_submit_data = get_ids(data, "beauty_card_refund_submit")
@pytest.mark.parametrize("param", beauty_card_refund_submit_data, ids=beauty_card_refund_submit_case)
def test_beauty_card_refund_submit(self, param):
r = janus_request().beauty_card_refund_submit(param["order_id"], param["reason_id"], param["reason_text"],
param["reason_type"])
if r["error"] == 1:
assert r["message"] == param["assert_message"]
import pytest
from all_backend_api.orders_request import orders_request
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
class TestMyStatus:
data = BaseRequest().api_load(path_setting.ORDER_MY_STATUS)
my_status_case, my_status_data = get_ids(data, "my_status")
@pytest.mark.parametrize("param", my_status_data, ids=my_status_case)
def test_my_status(self, param):
r = orders_request().my_status()
if r["error"] == 0:
assert r["error"] == param["assert_error"]
import time
import yaml
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.topic_reply_create_request import topic_reply_create_request
class TestTopicReplyCreate:
data = BaseRequest().api_load(path_setting.TOPIC_REPLY_CREATE)
topic_reply_create_case, topic_reply_create_data = get_ids(data, "reply_create")
@pytest.mark.parametrize("param", topic_reply_create_data, ids=topic_reply_create_case)
def test_topic_reply_create(self, param):
r = topic_reply_create_request().topic_reply_create( param["content"], param["channel"] )
# 一级评论三种情况校验,回复成功,回复频繁,回复重复
if r["error"] == 0:
assert r["message"] == param["message1"]
elif r["error"] == 4:
assert r["message"] == param["message"]
elif r["error"] == 1:
assert r["message"] == param["message2"]
sub_r = topic_reply_create_request().topic_sub_reply_create( param["content"], param["channel"], param["replied_id"] )
# 二级评论三种情况校验,回复成功,回复频繁,回复重复
if sub_r["error"] == 0:
assert sub_r["message"] == param["message1"]
elif sub_r["error"] == 4:
assert sub_r["message"] == param["message"]
elif sub_r["error"] == 1:
assert sub_r["message"] == param["message2"]
# 运行完用例后修改topic_reply_create.yaml文件里的content内容避免下一次重复,工作路径是backend_auto,用的是相对路径
a_path = "test_backend_data/topic_data/topic_reply_create.yaml"
with open(a_path, "r", encoding="utf-8") as f:
res = yaml.load(f, Loader=yaml.FullLoader)
a_content = res["reply_create"][0]["content"]
a_new_content = "ces测试+" + str(time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())))
# 更换content内容,写入yaml文件
for k in res["reply_create"][0]:
if k == "content":
res["reply_create"][0][k] = a_new_content
with open(a_path, "w", encoding="utf-8") as f:
yaml.dump(res, f, encoding='utf-8', allow_unicode=True)
#
#
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.topicreply_vote_request import topicreply_vote_request
class TestTopicReplyVote:
data = BaseRequest().api_load(path_setting.TOPIC_REPLY_VOTE)
topic_reply_vote_case, topic_reply_vote_data = get_ids(data, "topic_reply_vote")
@pytest.mark.parametrize("param", topic_reply_vote_data, ids=topic_reply_vote_case)
def test_topic_reply_vote(self, param):
r = topicreply_vote_request().topic_reply_vote(param["id"])
# 先点赞一次。看是否报重复点赞的错误,如果是就先取消点赞。最后回到取消点赞的状态
if r["error"] == 1:
assert r["message"] == param["assert3"]
# 回到取消点赞状态
canclevote = topicreply_vote_request().topic_reply_canclevote(param["id"])
assert canclevote["error"] == 0
# 校验点赞
vote = topicreply_vote_request().topic_reply_vote(param["id"])
assert vote["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
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
#
# if r["error"] == 1:
# assert r["message"] ==param["assert2"]
# 收藏之后取消收藏
# r1 = diary_isfavor_request().diary_cancelfavor()
# if r["error"] == 0:
# assert r["error"] == param["assert"]
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.topic_request import topic_request
class TestTopicDetail:
data = BaseRequest().api_load(path_setting.TOPIC_DETAIL)
topic_detail_case, topic_detail_data = get_ids(data, "topic_detail")
@pytest.mark.parametrize("param", topic_detail_data, ids=topic_detail_case)
def test_v1(self, param):
r = topic_request().topic_detail(param["topic_id"])
assert r["error"] == param["assert1"]
if r["error"] == 0:
assert r["error"] == param["assert1"]
# 先判断点赞字段,日记总数等,不传值,传空值
if r["data"]["data"]:
assert r["data"]["data"]["is_following"] is not None and r["data"]["data"]["is_following"] is not "" # 是否关注
assert r["data"]["data"]["topic_num"] is not None and r["data"]["data"]["topic_num"] is not "" # 日记贴总数
assert r["data"]["data"]["reply_num"] is not None and r["data"]["data"]["reply_num"] is not "" # 评论数
assert r["data"]["data"]["is_liked"] is not None and r["data"]["data"]["is_liked"] is not "" #是否点赞
assert r["data"]["data"]["vote_num"] is not None and r["data"]["data"]["vote_num"] is not "" #点赞总数
assert r["data"]["data"]["view_num"] is not None and r["data"]["data"]["view_num"] is not ""#浏览总数
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.topic_request import topic_request
class TestVote:
data = BaseRequest().api_load(path_setting.TOPIC_VOTE)
topic_vote_case, topic_vote_data = get_ids(data, "topic_vote")
@pytest.mark.parametrize("param", topic_vote_data, ids=topic_vote_case)
def test_vote(self, param):
r = topic_request().topic_detail(param["topic_id"])
if r["error"] == 0:
assert r["error"] == param["assert1"]
# 如果没有点过赞,就先校验点赞之后再取消点赞。【最后保持取消点赞的状态】
if not r["data"]["data"]["is_liked"]:
vote = topic_request().topic_vote(param["topic_id"])
assert vote["error"] == 0
assert vote["message"] == param["message1"]
# 取消点赞,回到取消点赞的状态
canclevote = topic_request().topic_canclevote(param["topic_id"])
assert canclevote["error"] == 0
else:
# 如果是已经点过赞的状态就直接取消点赞
canclevote = topic_request().topic_canclevote(param["topic_id"])
assert canclevote["error"] == 0
assert canclevote["message"] == param["message2"]
# if r["error"] == 1:
# assert r["message"] ==param["assert2"]
# 收藏之后取消收藏
# r1 = diary_isfavor_request().diary_cancelfavor()
# if r["error"] == 0:
# assert r["error"] == param["assert"]
...@@ -3,20 +3,20 @@ import pytest ...@@ -3,20 +3,20 @@ import pytest
from ids_list import get_ids from ids_list import get_ids
import path_setting import path_setting
from in_common.base_request import BaseRequest from in_common.base_request import BaseRequest
from all_backend_api.tractate_detail_request import tractate_detail_request from all_backend_api.tractate_request import tractate_request
class TestTractateDetail: class TestTractateDetail:
data = BaseRequest().api_load(path_setting.TRACTATE_DETAIL) data = BaseRequest().api_load(path_setting.TRACTATE_DETAIL)
tractate_detail_case, tractate_detail_data = get_ids(data, "tractate_detail") tractate_detail_case, tractate_detail_data = get_ids(data, "tractate_detail")
@pytest.mark.parametrize("param", tractate_detail_data, ids=tractate_detail_case) @pytest.mark.parametrize("param", tractate_detail_data, ids=tractate_detail_case)
def test_tractate_detail(self, param): def test_detail(self, param):
r = tractate_detail_request().tractate_detail( param["current_city_id"], param["tractate_id"], param["data_type"] ) r = tractate_request().tractate_detail( param["current_city_id"], param["tractate_id"], param["data_type"] )
# print(r) # print(r)
assert r["error"] == param["assert_error"] assert r["error"] == param["assert_error"]
if r["error"] == 0: if r["error"] == 0:
assert r["error"] == param["assert_error"] assert r["error"] == param["assert_error"]
# 先判断有没有日记,然后判断日记本里面需要的那些字段,如点赞字段,日记总数等,不传值,传空值 # 先判断有没有,然后判断里面需要的那些字段,如点赞字段,日记总数等,不传值,传空值
if r["data"]["tractate_list"]: if r["data"]["tractate_list"]:
assert r["data"]["tractate_list"]["is_favored"] is not None and r["data"]["tractate_list"]["is_favored"] is not "" #是否收藏 assert r["data"]["tractate_list"]["is_favored"] is not None and r["data"]["tractate_list"]["is_favored"] is not "" #是否收藏
assert r["data"]["tractate_list"]["is_following"] is not None and r["data"]["tractate_list"]["is_following"] is not "" #是否关注 assert r["data"]["tractate_list"]["is_following"] is not None and r["data"]["tractate_list"]["is_following"] is not "" #是否关注
......
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 TestFavor:
data = BaseRequest().api_load(path_setting.TRACTATE_FAVOR)
test_case, test_data = get_ids(data, "favor")
@pytest.mark.parametrize("param", test_data, ids=test_case)
def test_favor(self, param):
r = tractate_request().favor(param["tractate_id"], param["data_type"])
# print(r)
if r["error"] == 0:
assert r["message"] == param["message1"]
if r["error"] == 1:
assert r["message"] ==param["message2"]
r = tractate_request().cancelfavor(param["tractate_id"], param["data_type"])
# print(r)
if r["error"] == 0:
assert r["message"] == param["message3"]
if r["error"] == 1:
assert r["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 TestRelatedService:
data = BaseRequest().api_load(path_setting.TRACTATE_RELATED_SERVICE)
related_service_case, related_service_data = get_ids(data, "related_service")
@pytest.mark.parametrize("param", related_service_data, ids=related_service_case)
def test_related_service(self, param):
r = tractate_request().tractate_related_service( param["current_city_id"], param["tractate_id"], param["data_type"] )
# print(r)
assert r["error"] == param["assert_error"]
if r["error"] == 0:
# 先判断有没有美购,然后判断里面需要的那些字段,如点赞字段,日记总数等,不传值,传空值
if r["data"]["consult_info"]:
assert r["data"]["consult_info"]["service_id"] is not None and r["data"]["consult_info"]["service_id"] is not "" # 美购id
assert r["data"]["consult_info"]["doctor_user_id"] is not None and r["data"]["consult_info"]["doctor_user_id"] is not "" # 医生id
assert r["data"]["display_service_gray"] is not None and r["data"]["display_service_gray"] is not "" # 是否展示吸顶美购灰度
assert r["data"]["consult_info"]["service_id"] == r["data"]["related_services"][0]["id"] # 校验关联美购id是否正确
assert r["data"]["new_recommend_service"] is not None and r["data"]["new_recommend_service"] is not "" # 校验推荐美购是否存在
#
# assert r["data"]["text"] == param["assert_text"]
# if r["error"] == 21001:
# assert r["message"] == param["assert_message1"]
\ No newline at end of file
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 TestReply:
data = BaseRequest().api_load(path_setting.TRACTATE_REPLY)
test_case, test_data = get_ids(data, "reply")
@pytest.mark.parametrize("param", test_data, ids=test_case)
def test_reply(self, param):
r = tractate_request().reply( param["current_city_id"], param["id"], param["data_type"] )
# print(r)
assert r["error"] == param["assert_error"]
if r["error"] == 0:
# 先判断有没有值,然后判断里面需要的那些字段,如点赞字段,总数等,不传值,传空值
if r["data"]["reply"]:
assert r["data"]["reply"][0]["content"] is not None and r["data"]["reply"][0]["content"] is not ""
assert r["data"]["reply"][0]["user_id"] is not None and r["data"]["reply"][0]["user_id"] is not ""
assert r["data"]["reply"][0]["user_gm_url"] is not None and r["data"]["reply"][0]["user_gm_url"] is not ""
assert r["data"]["reply"][0]["user_portrait"] is not None and r["data"]["reply"][0]["user_portrait"] is not ""
assert r["data"]["reply"][0]["vote_num"] is not None and r["data"]["reply"][0]["vote_num"] is not ""
assert r["data"]["reply"][0]["user_type"] is not None and r["data"]["reply"][0]["user_type"] is not ""
assert r["data"]["reply"][0]["user_name"] is not None and r["data"]["reply"][0]["user_name"] is not ""
assert r["data"]["reply"][0]["tractate_id"] is not None and r["data"]["reply"][0]["tractate_id"] is not ""
assert r["data"]["reply"][0]["reply_count"] is not None and r["data"]["reply"][0]["reply_count"] is not ""
assert r["data"]["reply"][0]["is_vote"] is not None and r["data"]["reply"][0]["is_vote"] is not ""
assert r["data"]["reply"][0]["id"] is not None and r["data"]["reply"][0]["id"] is not ""
else:
# print(r["data"]["reply"])
# 如果得到结果是无评论看是不是写死的无评论的账号还是别的原因导致
assert r["data"]["tractate_id"] == str(param["id"])
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.user_request import user_request
class TestTopicFavor:
data = BaseRequest().api_load(path_setting.TOPIC_FAVOR)
topic_favor_case, topic_favor_data = get_ids(data, "favor")
@pytest.mark.parametrize("param", topic_favor_data, ids=topic_favor_case)
def test_topic_favor(self, param):
# 收藏校验
r = user_request().topic_favor()
assert r["error"] == param["assert"]
# 取消收藏校验
r = user_request().topic_canclefavor()
assert r["error"] == param["assert"]
diary_common_reply:
#日记本列表评论列表--校验
-
case: "日记本列表评论列表--校验"
id: 21250007
type: 2
assert1: 0
type: "TOPIC"
-
case: "帖子列表评论列表--校验"
id: 82208
type: 4
assert1: 0
type: "TRACTATE"
topic_sub_common:
#二级评论列表展示-多数为字段判空校验-因为评论本身并不确定
-
case: "日记贴二级评论列表--展示--用户信息校验"
id: 21249632
type: 2
reply_id: 35526987
assert1: 0
assert2: "请登录后再试"
assert3: "已经赞过啦"
type: "TOPIC"
-
case: "贴子二级评论列表--展示--用户信息校验"
id: 2087079
type: 4
reply_id: 2087079
assert1: 0
assert2: "请登录后再试"
assert3: "已经赞过啦"
type: "TRACTATE"
diary_isfavor:
#收藏case--无须字段
-
case: "收藏成功case"
assert: "收藏成功"
assert2: "请登录后再试"
#diary_cancelfavor:
#-
# case: "取消收藏case"
# assert: "已取消收藏"
diary_cancelfavor: diary_favor:
#取消收藏case--无须字段 #收藏case--无须字段
- -
case: "取消收藏成功case" case: "收藏成功case"
assert: "已取消收藏" assert: "收藏成功"
assert2: "请登录后再试" assert2: "请登录后再试"
assert3: "已取消收藏"
#
#diary_cancelfavor: #diary_cancelfavor:
#- #-
# case: "取消收藏case" # case: "取消收藏case"
......
diary_data: diary_data:
#字段正常case #字段正常case
- -
case: "接口正常case" case: "接口正常case"
current_city_id: "beijing" current_city_id: "beijing"
......
diary_vote: diary_vote:
#取消点赞case--从日记本列表点赞 #点赞case--从日记本列表点赞
- -
case: "日记本列表点赞--点赞&取消点赞成功case--校验" case: "日记本列表点赞--点赞&取消点赞成功case--校验"
id: 21249958 id: 21249958
......
beauty_card_payment_delete:
-
case: "次卡取消订单-接口调用成功case"
assert_data_message: "取消成功"
\ No newline at end of file
beauty_card_payment_detail:
-
case: "次卡订单详情-接口调用成功case"
assert_error: 0
\ No newline at end of file
beauty_card_prepay_alipay:
-
case: "次卡支付宝支付-接口调用成功case"
is_huabei: 0
assert_error: 0
\ No newline at end of file
beauty_card_prepay_wechat:
-
case: "次卡微信支付-接口调用成功case"
assert_error: 0
\ No newline at end of file
beauty_card_refund_info:
-
case: "次卡-取消订单-接口调用成功case"
order_id: "102217820485006"
assert_error: 0
\ No newline at end of file
beauty_card_refund_submit:
-
case: "次卡-提交退款申请-接口调用成功case"
order_id: "102813852173916"
reason_id: 3
reason_text: "个人身体原因"
reason_type: 0
assert_message: "订单已经退款"
\ No newline at end of file
my_status:
-
case: "我的订单-各状态订单数量-接口调用成功case"
assert_error: 0
\ No newline at end of file
diary_common_reply: topic_reply_vote:
#取消点赞case--从日记本列表点赞 #点赞case--日记贴评论点赞
- -
case: "日记本列表评论列表--校验" case: "日记本列表点赞--点赞&取消点赞成功case--校验"
id: 21250007 id: 35526988
type: 2
assert1: 0 assert1: 0
assert2: "请登录后再试" assert2: "请登录后再试"
assert3: "已经赞过啦" assert3: "已经赞过啦"
...@@ -19,6 +18,14 @@ diary_common_reply: ...@@ -19,6 +18,14 @@ diary_common_reply:
# assert: "0" # assert: "0"
# assert2: "请登录后再试" # assert2: "请登录后再试"
#diary_detail:
# #获取详情页是否点赞过--好像不是从这取
# -
# case: "取消收藏成功case"
# id: 21249958
# assert: "0"
# assert2: "请登录后再试"
......
reply_create:
- assert1: null
case: 日记贴一级评论创建--正常校验&创建二级评论--正常校验
channel: benzhan
content: ces测试+2021-06-15 17:03:51
message: 请勿回复重复内容
message1: 回复成功
message2: 你的回复有点频繁,稍后再来
replied_id: 35526987
- assert2: 4
case: 日记贴一级&二级评论创建--同一个用户重复内容校验
channel: benzhan
content: ces测试
message: 请勿回复重复内容
message1: 回复成功
message2: 你的回复有点频繁,稍后再来
replied_id: 35526987
topic_detail:
#日记贴详情页
-
case: "日记贴详情页--展示--用户信息校验"
topic_id: 21249632
assert1: 0
topic_vote:
#日记贴详情页点赞
-
case: "日记贴详情页--点赞--用接口校验"
topic_id: 21249632
id: 21249632
assert1: 0
message1: " +1"
message2: "取消成功"
favor:
#用户贴详情页--收藏&取消收藏校验
-
case: "用户贴详情页--收藏&取消收藏校验-"
current_city_id: "beijiing"
tractate_id: 189080
data_type: "user_post"
message1: "收藏成功"
message2: "请登录后再试"
message3: "取消收藏成功"
related_service:
#用户贴详情页--相关美购接口校验--只能校验字段是否为空,
-
case: "用户贴详情页--相关美购接口校验--无关联美购无推荐美购"
current_city_id: "beijiing"
tractate_id: 170479
data_type: "user_post"
assert_error: 0
assert_count: 10
-
case: "用户贴详情页--相关美购接口校验--有关联美购有推荐美购"
current_city_id: "beijiing"
tractate_id: 82208
data_type: "user_post"
assert_error: 0
assert_count: 10
reply:
#用户贴详情页--外显评论-校验字段是否为空,
-
case: "用户贴详情页--外显评论--校验字段是否为空-有多条评论"
current_city_id: "beijiing"
id: 82208
data_type: "user_post"
assert_error: 0
assert_count: 10
-
case: "用户贴详情页--外显评论--校验字段是否为空--无评论"
current_city_id: "beijiing"
id: 189080
data_type: "user_post"
assert_error: 0
assert_count: 10
favor:
#个人中心
-
case: "日记贴收藏&取消收藏--case"
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