Commit d72713fa authored by 邓莹莹's avatar 邓莹莹

Merge branch 'common_dev' into dyy_dev

parents 36aa3b29 3fb19d9c
No preview for this file type
#查看日记本相册页面
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 diary_album_request(BaseRequest):
def __init__(self):
self.data = self.api_load(path_setting.DIARY_ALBUM_CONFIG)
def diary_album(self):
return self.api_send(self.data["album"])
#日记本收藏
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"])
#
#日记本列表--日记贴点赞
vote:
method: get
url: /api/common/reply
params:
id: ${id}
type: ${type}
data: {}
json: {}
isLogin: 0 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
import path_setting
from in_common.base_request import BaseRequest
class diary_common_reply_request(BaseRequest):
def __init__(self):
self.data = self.api_load(path_setting.DIARY_COMMON_REPLY_CONFIG)
def diary_common_reply(self, id, type):
self.params["id"] = id
self.params["type"] = type
return self.api_send(self.data["vote"])
......@@ -2,7 +2,7 @@ import path_setting
from in_common.base_request import BaseRequest
class diary_data_reqest(BaseRequest):
class diary_data_request(BaseRequest):
def __init__(self):
self.data = self.api_load(path_setting.DIARY_DATA_CONFIG)
......
#日记本收藏
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"])
#日记本修改信息
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是不需要登录的情况,如不需要登录,可以不添加这个字段
import path_setting
from in_common.base_request import BaseRequest
class diary_operation_request(BaseRequest):
def __init__(self):
self.data = self.api_load(path_setting.DIARY_OPERATION_CONFIG)
def diary_operation(self, diary_id, title, operation_timestamp, doctor_name, hospital_name):
self.params["diary_id"] = diary_id
self.params["title"] = title
self.params["operation_timestamp"] = operation_timestamp
self.params["doctor_name"] = doctor_name
self.params["hospital_name"] = hospital_name
return self.api_send(self.data["operation"])
def diary_additional_info(self):
return self.api_send(self.data["operation"])
# def __init__(self):
# self.data = self.api_load(path_setting.DIARY_OPERATION_RESULT_CONFIG)
#
# 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]'))
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"])
#日记本列表--日记贴点赞
vote:
method: post
url: /hybrid/api/topic/vote/_data
params:
data:
id: ${id}
json: {}
isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
canclevote:
method: post
url: /hybrid/api/topic/cancel_vote/_data
params:
data:
id: ${id}
json: {}
isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
#
detail:
method: get
url: /api/topic/v1
params:
topic_id: ${topic_id}
data: {}
json: {}
isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
import path_setting
from in_common.base_request import BaseRequest
class diary_vote_request(BaseRequest):
def __init__(self):
self.data = self.api_load(path_setting.DIARY_VOTE_CONFIG)
def diary_vote(self, id):
self.params["id"] = id
return self.api_send(self.data["vote"])
def diary_canclevote(self, id):
self.params["id"] = id
return self.api_send(self.data["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)
import path_setting
from in_common.base_request import BaseRequest
from bs4 import BeautifulSoup
class hybrid_request(BaseRequest):
def __init__(self):
#百科详情页-项目聚合百科
self.data = self.api_load(path_setting.SUBWIKI_CONFIG)
#百科详情页-项目百科
self.data = self.api_load(path_setting.BASEWIKI_ITEM_CONFIG)
#百科详情页-药品(仪器、材料)百科
self.data = self.api_load(path_setting.BASEWIKI_PRODUCT_CONFIG)
#百科详情页-品牌百科
self.data = self.api_load(path_setting.BRAND_CONFIG)
#百科详情页-项目聚合百科
def sub_wiki(self, version, current_city_id, device_id = '97B6764B-2135-4761-9911-701C38CBC272'):
self.params['current_city_id'] = current_city_id
self.params['version'] = version
return self.api_send(self.data['sub_wiki'])
# return self.data
#百科详情页-项目百科
def basewiki_item(self, version, device_id = '97B6764B-2135-4761-9911-701C38CBC272'):
self.params['version'] = version
return self.api_send(self.data['basewiki_item'])
#百科详情页-药品(仪器、材料)百科
def basewiki_product(self, version, device_id = '97B6764B-2135-4761-9911-701C38CBC272'):
self.params['version'] = version
return self.api_send(self.data['basewiki_product'])
#百科详情页-品牌百科
def brand(self, version, device_id = '97B6764B-2135-4761-9911-701C38CBC272'):
self.params['version'] = version
return self.api_send(self.data['brand'])
if __name__ == '__main__':
# print(self.data)
# print(hybrid_request().sub_wiki("744.0", "beijing"))
# print(type(hybrid_request().sub_wiki("744.0", "beijing")))
soup = BeautifulSoup(hybrid_request().sub_wiki("744.0", "beijing"), 'lxml') # html.parser是解析器,也可是lxml
print(soup.prettify(),'百科详情页-项目聚合百科') #输出soup对象的内容
print(soup.title)
\ No newline at end of file
#百科详情页-项目聚合百科-玻尿酸
sub_wiki:
method: GET
url: /hybrid/sub_wiki/127
params:
current_city_id: ${current_city_id}
version: ${version}
data: {}
json: {}
#百科详情页-项目百科-水光针
basewiki_item:
method: GET
url: /hybrid/base_wiki/item/141
params:
version: ${version}
data: {}
json: {}
#百科详情页-药品(仪器、材料)百科-菲洛嘉
basewiki_product:
method: GET
url: /hybrid/base_wiki/product/16
params:
version: ${version}
data: {}
json: {}
#百科详情页-品牌百科-德玛莎
brand:
method: GET
url: /hybrid/brand/98
params:
version: ${version}
data: {}
json: {}
\ No newline at end of file
#推荐内容
personal_recommends:
method: get
url: /api/personal/recommends/v1
params:
current_city_id: ${current_city_id}
id: ${id}
from_type: ${from_type}
data: {}
json: {}
isLogin: 0 #需要登录添加这个字段,值为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 personal_recommends_request(BaseRequest):
def __init__(self):
self.data = self.api_load(path_setting.PERSONAL_RECOMMENDS_CONFIG)
def personal_recommends(self, current_city_id, id, from_type):
self.params["current_city_id"] = current_city_id
self.params["id"] = id
self.params["from_type"] = from_type
return self.api_send(self.data["personal_recommends"])
#查看用户帖子详情页
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"])
......@@ -73,8 +73,15 @@ class BaseRequest:
# proxies={"http":"172.30.9.226:8888"}
)
try:
content_type = r.headers.get("content-type").split(";")[0]
except:
content_type = "application/json"
if content_type == 'application/json':
return r.json()
return r.text
# 随机生成trace_id
def trace_id(self):
return ''.join(random.sample(string.ascii_lowercase + string.digits, 32))
......
......@@ -9,8 +9,49 @@ 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")
LOGIN_VFC = os.path.join(BASE_DIR, "backend_auto/test_backend_data/account_data", "login_vfc.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/account_data", "diary_data.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_ISFAVOR_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "diary_isfavor.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 = os.path.join(BASE_DIR, "backend_auto/test_backend_data/diary", "diary_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--目前好像直接用接口写无权限稍后解决
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_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_ALBUM_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "diary_album.yaml")
DIARY_ALBUM = os.path.join(BASE_DIR, "backend_auto/test_backend_data/diary", "diary_album.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")
# 帖子详情页内容
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", "tractate_detail.yaml")
......@@ -44,6 +85,10 @@ TAG_DATA=os.path.join(BASE_DIR, "backend_auto/test_doctor_data/web2_data", "tag_
#医生后台 - 发布商品选择类目doctor
DOCTOR_DATA=os.path.join(BASE_DIR, "backend_auto/test_doctor_data/web_data", "doctor_submechanisms.yaml")
#搜索首页-热门搜索
KEYWORDS_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "search_request.yaml")
KEYWORDS = os.path.join(BASE_DIR, "backend_auto/test_backend_data/search_data", "keywords.yaml")
#医生后台-保存新增商品
REGISTER_URL=os.path.join(BASE_DIR, "backend_auto/all_doctor_api", "glmer_request.yaml")
REGISTER_DATA=os.path.join(BASE_DIR, "backend_auto/test_doctor_data/glmer_data", "service_register.yaml")
......@@ -61,11 +106,6 @@ DELETE_DATA=os.path.join(BASE_DIR, "backend_auto/test_doctor_data/web2_data", "s
PROPERTIES_DATA=os.path.join(BASE_DIR, "backend_auto/test_doctor_data/glmer_data", "tag_properties.yaml")
#搜索首页-热门搜索
KEYWORDS_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "search_request.yaml")
KEYWORDS = os.path.join(BASE_DIR, "backend_auto/test_backend_data/search_data", "keywords.yaml")
# 首页灰度v9,精选tab
FEED_INDEXV9_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "feed_request.yaml")
FEED_INDEXV9_DATA = os.path.join(BASE_DIR, "backend_auto/test_backend_data/feed_data", "index_v9.yaml")
......@@ -96,6 +136,7 @@ EYELIDS_DIARY_CARDS_DATA = os.path.join(BASE_DIR, "backend_auto/test_backend_dat
GMAI_PLASTIC_ANALYSIS_V3_DATA = os.path.join(BASE_DIR, "backend_auto/test_backend_data/gmai_data", "plastic_analysis_v3.yaml")
# 3D变脸
GMAI_PLASTIC_ANALYSIS_V2_DATA = os.path.join(BASE_DIR, "backend_auto/test_backend_data/gmai_data", "plastic_analysis_v2.yaml")
# 新版本我的美券列表
JANUS_PRODUCT_MY_LIST_DATA = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_data", "product_my_list.yaml")
# 我的订单列表
......@@ -104,6 +145,7 @@ ORDERS_MY_V2_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "or
ORDERS_MY_V2_DATA = os.path.join(BASE_DIR, "backend_auto/test_backend_data/orders_data", "my_v2.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")
......@@ -141,10 +183,11 @@ JANUS_MINE_GUESS_YOU_LIKE = os.path.join(BASE_DIR, "backend_auto/test_backend_da
#消息列表
MY_CONVERSATION_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "my_conversation_request.yaml")
MY_CONVERSATION = os.path.join(BASE_DIR, "backend_auto/test_backend_data/my_conversation_data", "my_conversation.yaml")
DETAIL_MESSAGEID = os.path.join(BASE_DIR, "backend_auto/test_backend_data/conversation_data", "detail_messageid.yaml")
#消息
MESSAGE_READ_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "conversation_request.yaml")
MESSAGE_READ = os.path.join(BASE_DIR, "backend_auto/test_backend_data/conversation_data", "message_read.yaml")
DETAIL_MESSAGEID = os.path.join(BASE_DIR, "backend_auto/test_backend_data/conversation_data", "detail_messageid.yaml")
#消息页未读数
UNREAD_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "notification_request.yaml")
......@@ -202,7 +245,6 @@ GIFT_LIST_DATA = os.path.join(BASE_DIR, "backend_auto/test_backend_data/hybrid_g
#商祥页-优惠券列表-领取
HYBRID_GET_GIFT_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "hybrid_get_gift_request.yaml")
GET_GIFT_DATA = os.path.join(BASE_DIR, "backend_auto/test_backend_data/hybrid_get_gift_data", "get_gift_data.yaml")
#捜索结果页-医生/医院tab
CONTENTV6_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "search_request.yaml")
CONTENTV6 = os.path.join(BASE_DIR, "backend_auto/test_backend_data/search_data", "content_v6.yaml")
......@@ -227,8 +269,6 @@ POLYMER = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_data", "p
THIRD_PHONE_LOGIN_CONFIG = os.path.join(BASE_DIR,"backend_auto/all_backend_api", "thirdphonelogin_request")
THIRD_PHONE_LOGIN =os.path.join(BASE_DIR,"backend_auto/test_backend_data/account_data","login_thirdphone.yaml")
#医生医院sug列表
KEYWORDTIP_CONFIG = os.path.join(BASE_DIR,"backend_auto/all_backend_api", "janus_request.yaml")
KEYWORDTIP = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_data", "keyword_tip.yaml")
......@@ -281,6 +321,22 @@ BEAUTYCARD_FILTERS = os.path.join(BASE_DIR, "backend_auto/test_backend_data/visu
BEAUTYCARD_SKUS_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "visual_beauty_card.yaml")
BEAUTYCARD_SKUS = os.path.join(BASE_DIR, "backend_auto/test_backend_data/visual_beauty_card_data", "beautycard_skus.yaml")
#百科详情页-项目聚合百科
SUBWIKI_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "hybrid_request.yaml")
SUBWIKI = os.path.join(BASE_DIR, "backend_auto/test_backend_data/hybrid_data", "sub_wiki.yaml")
#百科详情页-项目百科
BASEWIKI_ITEM_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "hybrid_request.yaml")
BASEWIKI_ITEM = os.path.join(BASE_DIR, "backend_auto/test_backend_data/hybrid_data", "basewiki_item.yaml")
#百科详情页-药品(仪器、材料)百科
BASEWIKI_PRODUCT_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "hybrid_request.yaml")
BASEWIKI_PRODUCT = os.path.join(BASE_DIR, "backend_auto/test_backend_data/hybrid_data", "basewiki_product.yaml")
#百科详情页-品牌百科
BRAND_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "hybrid_request.yaml")
BRAND = os.path.join(BASE_DIR, "backend_auto/test_backend_data/hybrid_data", "brand.yaml")
#普通美购提交订单页
PREVIEW_V1 = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "settlement_request.yaml")
WECHAT_PAY = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "pay_request.yaml")
......@@ -294,6 +350,5 @@ ALIPAYDATA = os.path.join(BASE_DIR, "backend_auto/test_backend_data/pay_data", "
JUMPDATA = os.path.join(BASE_DIR, "backend_auto/test_backend_data/pay_data", "jump.yaml")
SETTLEMENTDELETE = os.path.join(BASE_DIR, "backend_auto/test_backend_data/settlement_data", "settlement_delete.yaml")
if __name__ == '__main__':
print("==========",LIVEYAML_CONFIG)
from test_backend_case.account_case import test_login_vfc
from test_backend_case.account_case import test_diary_data
import pytest
......
......@@ -3,24 +3,38 @@ import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.diary_data_request import diary_data_reqest
from all_backend_api.diary_data_request import diary_data_request
class TestDIARYDATA:
class TestDiaryData:
data = BaseRequest().api_load(path_setting.DIARY_DATA)
diary_data_case, diary_data_data = get_ids(data, "diary_data")
@pytest.mark.parametrize("param",diary_data_data,ids=diary_data_case)
def test_diary_data(self,param):
# print(2)
r = diary_data_reqest().diary_data(param["current_city_id"], param["diary_referrer"], param["sort"], param["count"], param["start_num"])
# print(1)
r = diary_data_request().diary_data(param["current_city_id"], param["diary_referrer"], param["sort"], param["count"], param["start_num"])
# print(r)
if r["error"] == 0:
assert r["error"] == param["assert"]
# 先判断有没有日记,然后判断日记本里面需要的那些字段,如点赞字段,日记总数等,不传值,传空值
if r["data"][0]:
assert r["data"][0]["post_date"] is not None and r["data"][0]["post_date"] is not "" #c创建时间
assert r["data"][0]["diary_num"] is not None and r["data"][0]["diary_num"] is not "" #日记总数
assert r["data"][0]["view_count"] is not None and r["data"][0]["view_count"] is not "" #浏览次数
assert r["data"][0]["is_liked"] is not None and r["data"][0]["is_liked"] is not "" #是否点赞
assert r["data"][0]["operation_day"] is not None and r["data"][0]["operation_day"] is not "" #术后多少天
assert r["data"][0]["vote_count"] is not None and r["data"][0]["vote_count"] is not "" #点赞总数
assert r["data"][0]["reply_count"] is not None and r["data"][0]["reply_count"] is not ""#评论总数
assert r["data"][0]["id"] is not None and r["data"][0]["id"] is not ""#日记贴id
# 判断评论列表里面的用户信息是否为空,如果有评论的话
if r["data"][0]["comments"][0]:
assert r["data"][0]["comments"][0]["user_id"] is not None and r["data"][0]["comments"][0]["user_id"] is not ""#用户id
assert r["data"][0]["comments"][0]["nick_name"] is not None and r["data"][0]["comments"][0]["nick_name"] is not ""#用户名
assert r["data"][0]["comments"][0]["gm_url"] is not None and r["data"][0]["comments"][0]["gm_url"] is not ""#点击头像跳转链接
# assert(r[""])
if r["error"] == 1:
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.diary_album_request import diary_album_request
class TestDiaryAlbum:
data = BaseRequest().api_load(path_setting.DIARY_ALBUM)
diary_album_case, diary_album_data = get_ids(data, "diary_album")
@pytest.mark.parametrize("param", diary_album_data, ids=diary_album_case)
def test_diary_album(self, param):
r = diary_album_request().diary_album()
# print(r)
if r["error"] == 0:
assert r["data"][2]["images"][0]["is_cover"] == param["assert"]
assert r["data"][0]["images"][0]["is_cover"] == param["assert2"]
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"]
#
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.diary_common_reply_request import diary_common_reply_request
class TestDiaryCommonReply:
data = BaseRequest().api_load(path_setting.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)
def test_diary_common_reply(self, param):
# print(2)
r = diary_common_reply_request().diary_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 "" # 是否点赞
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.diary_isfavor_request import diary_isfavor_request
class TestDiaryIsfavor:
data = BaseRequest().api_load(path_setting.DIARY_ISFAVOR)
diary_isfavor_case, diary_isfavor_data = get_ids(data, "diary_isfavor")
@pytest.mark.parametrize("param", diary_isfavor_data, ids=diary_isfavor_case)
def test_diary_isfavor(self, param):
r = diary_isfavor_request().diary_isfavor()
# print(r)
if r["error"] == 0:
assert r["message"] == param["assert"]
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.diary_operation_request import diary_operation_request
class TestDiaryOperation:
data = BaseRequest().api_load(path_setting.DIARY_OPERATION)
diary_operation_case, diary_operation_data = get_ids(data, "diary_operation")
@pytest.mark.parametrize("param", diary_operation_data, ids=diary_operation_case)
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"])
result = diary_operation_request().diary_additional_info()
if result["error"] == 1:
assert r["message"] == param["assert"]
# if r["error"] == 1:
# assert r["message"] ==param["assert2"]
#
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.diary_data_request import diary_data_request
class TestDiaryService:
data = BaseRequest().api_load(path_setting.DIARY_DATA)
diary_data_case, diary_data_data = get_ids(data, "diary_data")
@pytest.mark.parametrize("param",diary_data_data,ids=diary_data_case)
def test_diary_service(self,param):
# print(2)
r = diary_data_request().diary_data(param["current_city_id"], param["diary_referrer"], param["sort"], param["count"], param["start_num"])
# print(r)
if r["error"] == 0:
assert r["error"] == param["assert"]
# 先判断有没有日记,然后判断日记本里面需要的那些字段,如点赞字段,日记总数等,不传值,传空值
if r["data"]:
assert r["data"][0]["post_date"] is not None and r["data"][0]["post_date"] is not "" #c创建时间
assert r["data"][0]["diary_num"] is not None and r["data"][0]["diary_num"] is not "" #日记总数
assert r["data"][0]["view_count"] is not None and r["data"][0]["view_count"] is not "" #浏览次数
assert r["data"][0]["is_liked"] is not None and r["data"][0]["is_liked"] is not "" #是否点赞
assert r["data"][0]["operation_day"] is not None and r["data"][0]["operation_day"] is not "" #术后多少天
assert r["data"][0]["vote_count"] is not None and r["data"][0]["vote_count"] is not "" #点赞总数
assert r["data"][0]["reply_count"] is not None and r["data"][0]["reply_count"] is not ""#评论总数
assert r["data"][0]["id"] is not None and r["data"][0]["id"] is not ""#日记贴id
# 判断评论列表里面的用户信息是否为空,先判断有没有评论
if r["data"][0]["comments"]:
assert r["data"][0]["comments"][0]["user_id"] is not None and r["data"][0]["comments"][0]["user_id"] is not ""#用户id
assert r["data"][0]["comments"][0]["nick_name"] is not None and r["data"][0]["comments"][0]["nick_name"] is not ""#用户名
assert r["data"][0]["comments"][0]["gm_url"] is not None and r["data"][0]["comments"][0]["gm_url"] is not ""#点击头像跳转链接
# assert(r[""])
if r["error"] == 1:
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.diary_update_request import diary_update_request
class TestDiaryUpdate:
data = BaseRequest().api_load(path_setting.DIARY_UPDATE)
diary_update_case, diary_update_data = get_ids(data, "diary_update")
@pytest.mark.parametrize("param", diary_update_data, ids=diary_update_case)
def test_diary_update(self, param):
r = diary_update_request().diary_update(param["topic_list"])
# print(r)
# if r["error"] == 0:
# assert r["message"] == param["assert"]
if r["error"] == 1:
assert r["message"] == param["assert"]
# 收藏之后取消收藏
# 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.diary_vote_request import diary_vote_request
class TestDiaryVote:
data = BaseRequest().api_load(path_setting.DIARY_VOTE)
diary_vote_case, diary_vote_data = get_ids(data, "diary_vote")
@pytest.mark.parametrize("param", diary_vote_data, ids=diary_vote_case)
def test_diary_vote(self, param):
# print(111)
# print(diary_vote_case)
r = diary_vote_request().diary_detail(param["topic_id"])
# print(r)
# 可以多加一个d代表详情页
if r["error"] == 0:
assert r["error"] == param["assert1"]
# 如果没有点过赞,就先校验点赞之后再取消点赞。【最后保持取消点赞的状态】
if not r["data"]["data"]["is_liked"]:
# print(222)
vote = diary_vote_request().diary_vote(param["id"])
assert vote["error"] == 0
# 校验二次点赞无效
vote = diary_vote_request().diary_vote(param["id"])
assert vote["message"] == param["assert3"]
assert vote["error"] == 1
# 取消点赞,回到取消点赞的状态
canclevote = diary_vote_request().diary_canclevote(param["id"])
assert canclevote["error"] == 0
else:
# 如果是已经点过赞的状态就直接取消点赞
# print(111)
canclevote = diary_vote_request().diary_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 bs4 import BeautifulSoup
import path_setting
from all_backend_api.hybrid_request import hybrid_request
from ids_list import get_ids
from in_common.base_request import BaseRequest
#百科详情页-项目百科,水光针
class TestBaseWikiItem:
data = BaseRequest().api_load(path_setting.BASEWIKI_ITEM)
basewiki_item_case, basewiki_item_data = get_ids(data, "basewiki_item")
@pytest.mark.parametrize("param", basewiki_item_data, ids=basewiki_item_case)
def test_basewiki_item(self, param):
r = hybrid_request().basewiki_item(param["version"])
soup = BeautifulSoup(r, 'lxml') # html.parser是解析器,也可是lxml
assert soup.title.string == param["assert"]
print('进入项目百科-水光针的百科详情页')
\ No newline at end of file
import pytest
from bs4 import BeautifulSoup
import path_setting
from all_backend_api.hybrid_request import hybrid_request
from ids_list import get_ids
from in_common.base_request import BaseRequest
#百科详情页-药品(仪器、材料)百科,菲洛嘉
class TestBaseWikiProduct:
data = BaseRequest().api_load(path_setting.BASEWIKI_PRODUCT)
basewiki_product_case, basewiki_product_data = get_ids(data, "basewiki_product")
@pytest.mark.parametrize("param", basewiki_product_data, ids=basewiki_product_case)
def test_basewiki_product(self, param):
r = hybrid_request().basewiki_product(param["version"])
soup = BeautifulSoup(r, 'lxml') # html.parser是解析器,也可是lxml
assert soup.title.string == param["assert"]
print('进入项目百科-菲洛嘉的百科详情页')
\ No newline at end of file
import pytest
from bs4 import BeautifulSoup
import path_setting
from all_backend_api.hybrid_request import hybrid_request
from ids_list import get_ids
from in_common.base_request import BaseRequest
#百科详情页-品牌百科,得玛莎
class TestBrand:
data = BaseRequest().api_load(path_setting.BRAND)
brand_case, brand_data = get_ids(data, "brand")
@pytest.mark.parametrize("param", brand_data, ids=brand_case)
def test_brand(self, param):
r = hybrid_request().brand(param["version"])
soup = BeautifulSoup(r, 'lxml') # html.parser是解析器,也可是lxml
assert soup.title.string == param["assert"]
print('进入项目百科-得玛莎的百科详情页')
\ No newline at end of file
import pytest
from bs4 import BeautifulSoup
import path_setting
from all_backend_api.hybrid_request import hybrid_request
from ids_list import get_ids
from in_common.base_request import BaseRequest
#百科详情页-项目聚合百科,玻尿酸
class TestSubWiki:
data = BaseRequest().api_load(path_setting.SUBWIKI)
subwiki_case, subwiki_data = get_ids(data, "sub_wiki")
@pytest.mark.parametrize("param", subwiki_data, ids=subwiki_case)
def test_sub_wiki(self, param):
r = hybrid_request().sub_wiki(param["version"], param["current_city_id"])
soup = BeautifulSoup(r, 'lxml') # html.parser是解析器,也可是lxml
assert soup.title.string == param["assert"]
print('进入项目聚合百科-玻尿酸的百科详情页')
\ 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.personal_recommends_request import personal_recommends_request
class TestPersonalRecommends:
data = BaseRequest().api_load(path_setting.PERSONAL_RECOMMENDS)
personal_recommends_case, personal_recommends_data = get_ids(data, "personal_recommends")
@pytest.mark.parametrize("param", personal_recommends_data, ids=personal_recommends_case)
def test_personal_recommends(self, param):
r = personal_recommends_request().personal_recommends( param["current_city_id"], param["id"], param["from_type"] )
# print(r)
assert r["error"] == param["assert_error"]
# 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_detail_request import tractate_detail_request
class TestTractateDetail:
data = BaseRequest().api_load(path_setting.TRACTATE_DETAIL)
tractate_detail_case, tractate_detail_data = get_ids(data, "tractate_detail")
@pytest.mark.parametrize("param", tractate_detail_data, ids=tractate_detail_case)
def test_tractate_detail(self, param):
r = tractate_detail_request().tractate_detail( param["current_city_id"], param["tractate_id"], param["data_type"] )
# print(r)
assert r["error"] == param["assert_error"]
if r["error"] == 0:
assert r["error"] == param["assert_error"]
# 先判断有没有日记,然后判断日记本里面需要的那些字段,如点赞字段,日记总数等,不传值,传空值
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_following"] is not None and r["data"]["tractate_list"]["is_following"] is not "" #是否关注
assert r["data"]["tractate_list"]["data_type"] is not None and r["data"]["tractate_list"]["data_type"] is not "" #模版类型
assert r["data"]["tractate_list"]["is_voted"] is not None and r["data"]["tractate_list"]["is_voted"] is not "" #是否点赞
assert r["data"]["tractate_list"]["favor_amount"] is not None and r["data"]["tractate_list"]["favor_amount"] is not "" #收藏总数
assert r["data"]["tractate_list"]["vote_amount"] is not None and r["data"]["tractate_list"]["vote_amount"] is not "" #点赞总数
assert r["data"]["tractate_list"]["reply_amount"] is not None and r["data"]["tractate_list"]["reply_amount"] is not ""#评论总数
assert r["data"]["tractate_list"]["tractate_id"] is not None and r["data"]["tractate_list"]["tractate_id"] is not ""#贴子id
# 判断评论列表里面返回的用户信息是否为空,先判断有没有评论
if r["data"]["tractate_list"]["reply"]:
assert r["data"]["tractate_list"]["reply"][0]["user_id"] is not None and r["data"]["tractate_list"]["reply"][0]["user_id"] is not ""#用户id
assert r["data"]["tractate_list"]["reply"][0]["user_name"] is not None and r["data"]["tractate_list"]["reply"][0]["user_name"] is not ""#用户名
assert r["data"]["tractate_list"]["reply"][0]["user_portrait"] is not None and r["data"]["tractate_list"]["reply"][0]["user_portrait"] is not ""#点击头像跳转链接
# # assert(r[""])
# if r["error"] == 1:
# assert r["error"] == param["assert_error"]
# assert r["data"]["text"] == param["assert_text"]
# if r["error"] == 21001:
# assert r["message"] == param["assert_message1"]
\ No newline at end of file
diary_album:
#进入日记本相册case--无须字段
-
case: "进入日记本相册case"
assert: false
assert2: true
#
#diary_cancelfavor:
#-
# case: "取消收藏case"
# assert: "已取消收藏"
diary_cancelfavor:
#取消收藏case--无须字段
-
case: "取消收藏成功case"
assert: "已取消收藏"
assert2: "请登录后再试"
#
#diary_cancelfavor:
#-
# case: "取消收藏case"
# assert: "已取消收藏"
diary_common_reply:
#取消点赞case--从日记本列表点赞
-
case: "日记本列表评论列表--校验"
id: 21250007
type: 2
assert1: 0
assert2: "请登录后再试"
assert3: "已经赞过啦"
#diary_canclevote:
#点赞成功case--无须字段
# -
# case: "点赞成功case"
# id: 21249958
# topic_id: 21249958
# assert: "0"
# assert2: "请登录后再试"
diary_isfavor:
#收藏case--无须字段
-
case: "收藏成功case"
assert: "收藏成功"
assert2: "请登录后再试"
#diary_cancelfavor:
#-
# case: "取消收藏case"
# assert: "已取消收藏"
diary_operation:
#修改日记本信息case--
-
case: "修改信息"
diary_id: 17586198
title : "上海哈哈哈哈哈哈哈哈哈哈哈虎骨"
operation_timestamp: 1620662400
doctor_name: "也一样"
hospital_name: "一样一样"
assert: "没有权限"
-
case: "将原来的修改内容修改回去,方便下次接着使用"
diary_id: 17586198
title: "测试"
operation_timestamp: 1620662401
doctor_name: "测试"
hospital_name: "测试"
assert: "没有权限"
#
#diary_cancelfavor:
#-
# case: "取消收藏case"
# assert: "已取消收藏"
diary_service:
#字段正常case
-
case: "有推荐美购的日记--有外显评论"
diary_id: ""
service_id: 5815774
assert: 0
-
case: "接口传参数失败,但不报错case"
current_city_id: "beijing"
diary_referrer: "my_diary"
sort: 0
count: 8
start_num: 2
assert: 0
diary_update:
#创建更新日记本信息case--创建新的日记贴
-
case: "发布成功--校验"
topic_list: '[{"content":"呵呵呵呵呵","images":[{"image":"2021/06/04/1545/b9ed9f0dc883"}],"operation_timestamp":"1622792725"}]'
status: true
assert: "没有权限"
isLogin: 1
#
#diary_cancelfavor:
#-
# case: "取消收藏case"
# assert: "已取消收藏"
diary_vote:
#取消点赞case--从日记本列表点赞
-
case: "日记本列表点赞--点赞&取消点赞成功case--校验"
id: 21249958
topic_id: 21249958
assert1: 0
assert2: "请登录后再试"
assert3: "已经赞过啦"
#diary_canclevote:
#点赞成功case--无须字段
# -
# case: "点赞成功case"
# id: 21249958
# topic_id: 21249958
# assert: "0"
# assert2: "请登录后再试"
#diary_detail:
# #获取详情页是否点赞过--好像不是从这取
# -
# case: "取消收藏成功case"
# id: 21249958
# assert: "0"
# assert2: "请登录后再试"
basewiki_item:
-
#百科详情页-项目百科,水光针
case: "百科详情页-项目百科,水光针"
version: "744.0"
assert: 水光针
\ No newline at end of file
basewiki_product:
-
#百科详情页-药品(仪器、材料)百科,菲洛嘉
case: "百科详情页-药品(仪器、材料)百科,菲洛嘉"
version: "744.0"
assert: 菲洛嘉
\ No newline at end of file
brand:
-
#百科详情页-品牌百科,得玛莎
case: "百科详情页-品牌百科,得玛莎"
version: "744.0"
assert: 得玛莎
\ No newline at end of file
sub_wiki:
-
#百科详情页-项目聚合百科,玻尿酸
case: "百科详情页-项目聚合百科,玻尿酸"
current_city_id: "beijing"
version: "744.0"
assert: 玻尿酸
\ No newline at end of file
personal_recommends:
#日记本详情页推荐接口校验
-
case: "校验详情页推荐数据--日记本"
current_city_id: "beijiing"
id: 17586195
from_type: "diary"
assert_error: 0
assert_count: 10
# 日记贴详情页推荐接口校验
- case: "校验详情页推荐数据--日记贴"
current_city_id: "beijiing"
id: 123456795
from_type: "topic"
assert_error: 0
assert_count: 10
# 帖子详情页推荐接口校验
- case: "校验详情页推荐数据--帖子"
current_city_id: "beijiing"
id: 187333
from_type: "tractate"
assert_error: 0
assert_count: 10
# 问答详情页推荐接口校验
- case: "校验详情页推荐数据--问答"
current_city_id: "beijiing"
id: 231628
from_type: "question"
assert_error: 0
assert_count: 10
tractate_detail:
#用户贴详情页接口校验
-
case: "校验详情页推荐数据--用户贴--无评论"
current_city_id: "beijiing"
tractate_id: 187937
data_type: "user_post"
assert_error: 0
assert_count: 10
-
case: "校验详情页推荐数据--用户贴--有评论"
current_city_id: "beijiing"
tractate_id: 171688
data_type: "user_post"
assert_error: 0
assert_count: 10
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment