Commit f4210bea authored by 张伟男's avatar 张伟男

域名

parents 6d7bdd14 7171bf3d
...@@ -13,9 +13,16 @@ class conversation_request(BaseRequest): ...@@ -13,9 +13,16 @@ class conversation_request(BaseRequest):
self.params["message_ids"] = message_ids self.params["message_ids"] = message_ids
return self.api_send(self.messageread["message_read"]) return self.api_send(self.messageread["message_read"])
def detail_messageid(self, os_version, last_msg_id, offset_msg_id):
self.params["os_version"] = os_version
self.params["last_msg_id"] = last_msg_id
self.params["offset_msg_id"] = offset_msg_id
return self.api_send(self.messageread["detail_messageid"])
if __name__ == '__main__': if __name__ == '__main__':
print(conversation_request().message_read("beijing", 1,'[10622,10626,10646,10651]')) print(conversation_request().message_read("beijing", 1,'[10622,10626,10646,10651]'))
print(conversation_request().detail_messageid(10, 0, 0))
......
...@@ -10,3 +10,15 @@ message_read: ...@@ -10,3 +10,15 @@ message_read:
json: {} json: {}
isLogin: 1 #需要登录的接口 isLogin: 1 #需要登录的接口
detail_messageid:
method: get
url: /api/conversation/detail/602329_33910245/
params:
os_version: ${os_version}
last_msg_id: ${last_msg_id}
offset_msg_id: ${offset_msg_id}
data: {}
json: {}
isLogin: 1 #需要登录的接口
import path_setting
from in_common.base_request import BaseRequest
class filter_request(BaseRequest):
def __init__(self):
self.data = self.api_load(path_setting.FILTER_CONFIG)
def service_home_city_v2(self, current_city_id, lat, lng):
print("fgx")
self.params["current_city_id"] = current_city_id
self.params["lat"] = lat
self.params["lng"] = lng
return self.api_send(self.data["service_home_city_v2"])
if __name__ == '__main__':
#城市筛选器
print(filter_request().service_home_city_v2("", "40.002", "116.487252"))
print("fgx")
service_home_city_v2:
method: GET
url: /api/filter/service_home_city_v2
params:
current_city_id: ${current_city_id}
lat: ${lat}
lng: ${lng}
data: {}
json: {}
import path_setting
from in_common.base_request import BaseRequest
class hybrid_get_gift_request(BaseRequest):
def __init__(self):
self.data = self.api_load(path_setting.HYBRID_GET_GIFT_CONFIG)
#商祥页-美券列表
def get_gift_data(self, gift_id):
self.params["gift_id"] = gift_id
return self.api_send(self.data["get_gift_data"])
if __name__ == '__main__':
#打印商祥页-优惠券列表-领取
print(hybrid_get_gift_request().get_gift_data("63302"))
\ No newline at end of file
#商祥页-优惠券列表-领取
get_gift_data:
method: post
url: /hybrid/get_gift/_data
params: {}
data:
gift_id: ${gift_id}
json: {}
isLogin: 1
\ No newline at end of file
...@@ -4,6 +4,9 @@ from in_common.base_request import BaseRequest ...@@ -4,6 +4,9 @@ from in_common.base_request import BaseRequest
class search_request(BaseRequest): class search_request(BaseRequest):
def __init__(self): def __init__(self):
self.data = self.api_load(path_setting.KEYWORDS_CONFIG)
#品类聚合页面医生tab列表
self.data = self.api_load(path_setting.HOSPITAL_CONFIG)
self.data = self.api_load(path_setting.KEYWORDS_CONFIG) #keywords路径 self.data = self.api_load(path_setting.KEYWORDS_CONFIG) #keywords路径
self.data = self.api_load(path_setting.CONTENTV6_CONFIG) #content_v6路径 self.data = self.api_load(path_setting.CONTENTV6_CONFIG) #content_v6路径
self.data = self.api_load(path_setting.HOT_CONFIG) # hot路径 self.data = self.api_load(path_setting.HOT_CONFIG) # hot路径
...@@ -38,3 +41,18 @@ class search_request(BaseRequest): ...@@ -38,3 +41,18 @@ class search_request(BaseRequest):
def hot(self, version, device_id = '97B6764B-2135-4761-9911-701C38CBC272'): def hot(self, version, device_id = '97B6764B-2135-4761-9911-701C38CBC272'):
self.params["version"] = version self.params["version"] = version
return self.api_send(self.data["hot"]) return self.api_send(self.data["hot"])
# 品类聚合页面医生tab列表
def hospital(self, cp_id, tag_id, q, count, device_id):
self.params["cp_id"] = cp_id
self.params["tag_id"] = tag_id
self.params["q"] = q
self.params["count"] = count
self.params["device_id"] = device_id
return self.api_send(self.data["hospital"])
if __name__ == '__main__':
# 打印购物车-猜你喜欢列表接口返回
print(search_request().hospital(82, [], "眼部整形", 10, "869378034450718"))
...@@ -36,3 +36,16 @@ hot: ...@@ -36,3 +36,16 @@ hot:
#列出所有定义函数时的参数 #列出所有定义函数时的参数
params: params:
version: ${version} version: ${version}
#品类聚合页面医生tab列表
hospital:
method: get
url: /api/search/v2/hospital
params:
cp_id: ${cp_id}
tag_id: ${tag_id}
q: ${q}
count: ${count}
device_id: ${device_id}
data: {}
json: {}
\ No newline at end of file
import path_setting
from in_common.base_request import BaseRequest
class glmer_request(BaseRequest):
def __init__(self):
self.REGISTER_URL = self.api_load(path_setting.REGISTER_URL)
def service_register(self,name,project_type,upgrade,short_description,doctor_id,start_time,end_time,photo_details,image_header,video_token,service_type,is_specialreview,reservation,have_extra_pay,is_draft,items,csrfmiddlewaretoken):
self.params["name"] = name
self.params["project_type"] = project_type
self.params["upgrade"] = upgrade
self.params["short_description"] = short_description
self.params["doctor_id"] = doctor_id
self.params["start_time"] = start_time
self.params["end_time"] = end_time
self.params["photo_details"] = photo_details
self.params["image_header"] = image_header
self.params["video_token"] = video_token
self.params["service_type"] = service_type
self.params["is_specialreview"] = is_specialreview
self.params["reservation"] = reservation
self.params["have_extra_pay"] = have_extra_pay
self.params["is_draft"] = is_draft
self.params["items"] = items
self.params["csrfmiddlewaretoken"] = csrfmiddlewaretoken
return self.api_send(self.REGISTER_URL["service_register"])
def service_detail(self) :
return self.api_send(self.REGISTER_URL["service_detail"])
def tag_properties(self,catalog_ids):
#我的商品-编辑可标准化商品
self.params["catalog_ids"] = catalog_ids
return self.api_send(self.REGISTER_URL["tag_properties"])
if __name__ == '__main__':
print(glmer_request().service_register("激光溶脂瘦脸", "[236]", "true", "测试", "wangyang", "1624377600", "1627660800", "<p>12</p>", "https://heras.igengmei.com/service/2021/06/01/0b9b110e60", "UPCOYIJkZOMcdd9FDzpBqYjzWUh55fBpVi3AhWpL:nBdvXYz_CR7wNcuroo3TLyvuQiY=:eyJzY29wZSI6InZpZGVvIiwiZGVhZGxpbmUiOjE2MjI1MTg2NTd9", "0", "false", "1", "false", "0", '[{"gengmei_price":100,"original_price":200,"is_online":true}]',"PC8uTySuxipukIMuqNV1OPB376C2ZZ3g"))
print(glmer_request().service_detail())
print(glmer_request().tag_properties("[115,141]"))
service_register:
method: POST
url: /api/glmer/service/register
params: {}
data:
name: ${name}
project_type: ${project_type}
upgrade: ${upgrade}
short_description: ${short_description}
doctor_id: ${doctor_id}
start_time: ${start_time}
end_time: ${end_time}
photo_details: ${photo_details}
image_header: ${image_header}
video_token: ${video_token}
service_type: ${service_type}
is_specialreview: ${is_specialreview}
reservation: ${reservation}
have_extra_pay: ${have_extra_pay}
is_draft: ${is_draft}
items: ${items}
csrfmiddlewaretoken: ${csrfmiddlewaretoken}
phone_num: ${phone_num}
vfc_code: ${vfc_code}
face_token: ${face_token}
json: {}
isLogin: 1
service_detail:
method: get
url: /api/glmer/service/detail/5885425
params: {}
data: {}
json: {}
isLogin: 1
tag_properties:
method: get
url: /api/glmer/tag/properties
params:
catalog_ids: ${catalog_ids}
data: {}
json: {}
isLogin: 1
...@@ -8,6 +8,7 @@ class web2_request(BaseRequest): ...@@ -8,6 +8,7 @@ class web2_request(BaseRequest):
# self.SERVICE_REVIEW_URL = self.api_load(path_setting.SERVICE_REVIEW_URL) # self.SERVICE_REVIEW_URL = self.api_load(path_setting.SERVICE_REVIEW_URL)
def service_list(self, page,pagesize,is_online,extra_filter_choice): def service_list(self, page,pagesize,is_online,extra_filter_choice):
#我的商品查询列表
self.params["page"] = page self.params["page"] = page
self.params["pagesize"] = pagesize self.params["pagesize"] = pagesize
self.params["is_online"] = is_online self.params["is_online"] = is_online
...@@ -15,25 +16,34 @@ class web2_request(BaseRequest): ...@@ -15,25 +16,34 @@ class web2_request(BaseRequest):
return self.api_send(self.SERVICE_URL["service_list"]) return self.api_send(self.SERVICE_URL["service_list"])
def service_review_list(self,page,pagesize,type): def service_review_list(self,page,pagesize,type):
#商品审核查询列表
self.params["page"] = page self.params["page"] = page
self.params["pagesize"] = pagesize self.params["pagesize"] = pagesize
self.params["type"] = type self.params["type"] = type
return self.api_send(self.SERVICE_URL["service_review_list"]) return self.api_send(self.SERVICE_URL["service_review_list"])
def servicereview_option(self,id, type,csrfmiddlewaretoken): def servicereview_option(self,id, type,csrfmiddlewaretoken):
#商品审核-撤回审核、取消申请
self.params["id"] = id self.params["id"] = id
self.params["type"] = type self.params["type"] = type
self.params["csrfmiddlewaretoken"] = csrfmiddlewaretoken self.params["csrfmiddlewaretoken"] = csrfmiddlewaretoken
return self.api_send(self.SERVICE_URL["servicereview_option"]) return self.api_send(self.SERVICE_URL["servicereview_option"])
def tag_all(self) : def tag_all(self) :
#发布商品-选择类目跳转发布商品页面tag接口
return self.api_send(self.SERVICE_URL["tag_all"]) return self.api_send(self.SERVICE_URL["tag_all"])
def service_delete(self,is_delete,service_register_id,csrfmiddlewaretoken):
#我的商品-删除商品
self.params["is_delete"] = is_delete
self.params["service_register_id"] = service_register_id
self.params["csrfmiddlewaretoken"] = csrfmiddlewaretoken
return self.api_send(self.SERVICE_URL["service_delete"])
if __name__ == '__main__': if __name__ == '__main__':
print(web2_request().service_list("1", "10", "-1", "-1")) print(web2_request().service_list("1", "10", "-1", "-1"))
print(web2_request().service_review_list("1", "10", "0")) print(web2_request().service_review_list("1", "10", "0"))
print(web2_request().servicereview_option("209989", "1", "PC8uTySuxipukIMuqNV1OPB376C2ZZ3g")) print(web2_request().servicereview_option("209989", "1", "PC8uTySuxipukIMuqNV1OPB376C2ZZ3g"))
print(web2_request().tag_all()) print(web2_request().tag_all())
print(web2_request().service_delete("1","209863","PC8uTySuxipukIMuqNV1OPB376C2ZZ3g"))
...@@ -51,3 +51,14 @@ tag_all: ...@@ -51,3 +51,14 @@ tag_all:
data: {} data: {}
json: {} json: {}
isLogin: 1 isLogin: 1
service_delete:
method: POST
url: /api/web2/service/delete
param: {}
data:
is_delete: ${is_delete}
service_register_id: ${service_register_id}
csrfmiddlewaretoken: ${csrfmiddlewaretoken}
json: {}
isLogin: 1
...@@ -4,21 +4,51 @@ from in_common.base_request import BaseRequest ...@@ -4,21 +4,51 @@ from in_common.base_request import BaseRequest
class web_request(BaseRequest): class web_request(BaseRequest):
def __init__(self): def __init__(self):
self.data = self.api_load(path_setting.ACCOUNT_URL) self.ACCOUNT_URL = self.api_load(path_setting.ACCOUNT_URL)
def account_unreadbadgecount(self) : def account_unreadbadgecount(self) :
return self.api_send(self.data["account_unreadbadgecount"]) return self.api_send(self.ACCOUNT_URL["account_unreadbadgecount"])
def article_videotoken(self) : def article_videotoken(self) :
return self.api_send(self.data["article_videotoken"]) return self.api_send(self.ACCOUNT_URL["article_videotoken"])
def doctor_submechanisms(self) : def doctor_submechanisms(self) :
return self.api_send(self.data["doctor_submechanisms"]) return self.api_send(self.ACCOUNT_URL["doctor_submechanisms"])
def service_offline(self,id,csrfmiddlewaretoken):
self.params["id"] = id
self.params["csrfmiddlewaretoken"] = csrfmiddlewaretoken
return self.api_send(self.ACCOUNT_URL["service_offline"])
def conversation(self, is_star, page):
self.params["is_star"] = is_star
self.params["page"] = page
return self.api_send(self.ACCOUNT_URL["conversation"])
def conversation_unread_list(self, page):
self.params["page"] = page
return self.api_send(self.ACCOUNT_URL["conversation_unread_list"])
def service(self):
return self.api_send(self.ACCOUNT_URL["service"])
def conversation_diary(self, doctor_user_id):
self.params["doctor_user_id"] = doctor_user_id
return self.api_send(self.ACCOUNT_URL["conversation_diary"])
def conversation_coupon(self, doctor_user_id):
self.params["doctor_user_id"] = doctor_user_id
return self.api_send(self.ACCOUNT_URL["conversation_coupon"])
if __name__ == '__main__': if __name__ == '__main__':
print(web_request().account_unreadbadgecount()) print(web_request().account_unreadbadgecount())
print(web_request().article_videotoken()) print(web_request().article_videotoken())
print(web_request().doctor_submechanisms()) print(web_request().doctor_submechanisms())
print(web_request().service_offline("209992", "PC8uTySuxipukIMuqNV1OPB376C2ZZ3g"))
print(web_request().conversation(0, 1))
print(web_request().conversation_unread_list(1))
print(web_request().service())
print("发送")
print(web_request().conversation_diary(602329))
print(web_request().conversation_coupon(602329))
...@@ -25,3 +25,59 @@ doctor_submechanisms: ...@@ -25,3 +25,59 @@ doctor_submechanisms:
data: {} data: {}
json: {} json: {}
isLogin: 1 isLogin: 1
service_offline:
method: post
url: /api/web/service/offline
param: {}
data:
id: ${id}
csrfmiddlewaretoken: ${csrfmiddlewaretoken}
json: {}
isLogin: 1
conversation:
method: get
url: /api/web/conversation
params:
is_star: ${is_star}
page: ${page}
data: {}
json: {}
isLogin: 1 #需要登录
conversation_unread_list:
method: get
url: /api/web/conversation/unread_list
params:
page: ${page}
data: {}
json: {}
isLogin: 1 #需要登录
service:
method: get
url: /api/web/service
params: {}
data: {}
json: {}
isLogin: 1 #需要登录
conversation_diary:
method: get
url: /api/web/conversation/diary
params:
doctor_user_id: ${doctor_user_id}
data: {}
json: {}
isLogin: 1 #需要登录
conversation_coupon:
method: get
url: /api/web/conversation/coupon
params:
doctor_user_id: ${doctor_user_id}
data: {}
json: {}
isLogin: 1 #需要登录
develop_host: develop_host:
backend: http://backend.paas-develop.env backend: http://backend.paas-develop.env
doctor: http://doctor.paas-develop.env doctor: http://doctor.paas-develop.envgit
# backend: https://backend.igengmei.com # backend: https://backend.igengmei.com
...@@ -44,6 +44,24 @@ TAG_DATA=os.path.join(BASE_DIR, "backend_auto/test_doctor_data/web2_data", "tag_ ...@@ -44,6 +44,24 @@ TAG_DATA=os.path.join(BASE_DIR, "backend_auto/test_doctor_data/web2_data", "tag_
#医生后台 - 发布商品选择类目doctor #医生后台 - 发布商品选择类目doctor
DOCTOR_DATA=os.path.join(BASE_DIR, "backend_auto/test_doctor_data/web_data", "doctor_submechanisms.yaml") DOCTOR_DATA=os.path.join(BASE_DIR, "backend_auto/test_doctor_data/web_data", "doctor_submechanisms.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")
#医生后台-编辑商品
DETAIL_DATA=os.path.join(BASE_DIR, "backend_auto/test_doctor_data/glmer_data", "service_detail.yaml")
#医生后台-我的商品-下线商品
OFFLINE_DATA=os.path.join(BASE_DIR, "backend_auto/test_doctor_data/web_data", "service_offline.yaml")
#医生后台-我的商品-删除商品
DELETE_DATA=os.path.join(BASE_DIR, "backend_auto/test_doctor_data/web2_data", "service_delete.yaml")
#医生后台-编辑可标准化商品
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_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") KEYWORDS = os.path.join(BASE_DIR, "backend_auto/test_backend_data/search_data", "keywords.yaml")
...@@ -120,6 +138,7 @@ MY_CONVERSATION = os.path.join(BASE_DIR, "backend_auto/test_backend_data/my_conv ...@@ -120,6 +138,7 @@ MY_CONVERSATION = os.path.join(BASE_DIR, "backend_auto/test_backend_data/my_conv
#消息 #消息
MESSAGE_READ_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "conversation_request.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") 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") UNREAD_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "notification_request.yaml")
...@@ -174,6 +193,9 @@ SHOPCART_ADD = os.path.join(BASE_DIR, "backend_auto/test_backend_data/shopcart_d ...@@ -174,6 +193,9 @@ SHOPCART_ADD = os.path.join(BASE_DIR, "backend_auto/test_backend_data/shopcart_d
#商祥页-美券列表 #商祥页-美券列表
HYBRID_GIFT_LIST_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "hybrid_gift_list_request.yaml") HYBRID_GIFT_LIST_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "hybrid_gift_list_request.yaml")
GIFT_LIST_DATA = os.path.join(BASE_DIR, "backend_auto/test_backend_data/hybrid_gift_list_data", "gift_list_data.yaml") GIFT_LIST_DATA = os.path.join(BASE_DIR, "backend_auto/test_backend_data/hybrid_gift_list_data", "gift_list_data.yaml")
#商祥页-优惠券列表-领取
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 #捜索结果页-医生/医院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")
...@@ -220,6 +242,26 @@ REPLY_ANSWER = os.path.join(BASE_DIR, "backend_auto/test_backend_data/question_d ...@@ -220,6 +242,26 @@ REPLY_ANSWER = os.path.join(BASE_DIR, "backend_auto/test_backend_data/question_d
#回答详情页 #回答详情页
DETAIL_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "answer_request.yaml") DETAIL_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "answer_request.yaml")
DETAIL = os.path.join(BASE_DIR, "backend_auto/test_backend_data/answer_data", "detail.yaml") DETAIL = os.path.join(BASE_DIR, "backend_auto/test_backend_data/answer_data", "detail.yaml")
#品类聚合页面医生tab列表
HOSPITAL_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "search_request.yaml")
HOSPITAL = os.path.join(BASE_DIR, "backend_auto/test_backend_data/search_data", "hospital.yaml")
#城市筛选器
FILTER_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "filter_request.yaml")
FILTER = os.path.join(BASE_DIR, "backend_auto/test_backend_data/filter_data", "service_home_city_v2.yaml")
#医生后台-全部私信列表
CONVERSATION=os.path.join(BASE_DIR, "backend_auto/test_doctor_data/web_data", "conversation.yaml")
#医生后台-未读私信列表
CONVERSATIONUNREADLIST=os.path.join(BASE_DIR, "backend_auto/test_doctor_data/web_data", "conversation_unread_list.yaml")
#医生后台-发送商品按钮
SERVICE=os.path.join(BASE_DIR, "backend_auto/test_doctor_data/web_data", "service.yaml")
#医生后台-发送案例
CONVERSATIONDIARY=os.path.join(BASE_DIR, "backend_auto/test_doctor_data/web_data", "conversation_diary.yaml")
#医生后台-发送优惠券
CONVERSATIONCOUPON=os.path.join(BASE_DIR, "backend_auto/test_doctor_data/web_data", "conversation_coupon.yaml")
if __name__ == '__main__': if __name__ == '__main__':
......
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.conversation_request import conversation_request
class TestDetailMessageid:
data = BaseRequest().api_load(path_setting.DETAIL_MESSAGEID)
detailmessageid_case, detailmessageid_data = get_ids(data, "detail_messageid")
@pytest.mark.parametrize("param",detailmessageid_data,ids=detailmessageid_case)
def test_detail_messageid(self,param):
r = conversation_request().detail_messageid(param["os_version"], param["last_msg_id"], param["offset_msg_id"])
if r["error"] == 0:
results = r.get("data").get("results", [])
assert len(results) <= param["assert"]
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.filter_request import filter_request
class TestServiceHomeCityV2:
data = BaseRequest().api_load(path_setting.FILTER)
servicehomecityv2_case, servicehomecityv2_data = get_ids(data, "service_home_city_v2")
@pytest.mark.parametrize("param", servicehomecityv2_data, ids=servicehomecityv2_case)
def test_service_home_city_v2(self, param):
r = filter_request().service_home_city_v2(param["current_city_id"], param["lat"], param["lng"])
# print('feng=', r)
if r["error"] == 0:
assert len(r["data"]["area"]) > 0
import pytest
from all_backend_api.hybrid_get_gift_request import hybrid_get_gift_request
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
class TestGiftListData:
data = BaseRequest().api_load(path_setting.GET_GIFT_DATA)
get_gift_data_case, get_gift_data_data = get_ids(data, "get_gift_data")
@pytest.mark.parametrize("param", get_gift_data_data, ids=get_gift_data_case)
def test_get_gift_data(self, param):
r = hybrid_get_gift_request().get_gift_data(param["gift_id"])
if r["error"] == 1:
assert r["message"] == param["assert_message"]
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.search_request import search_request
class TestHospital:
data = BaseRequest().api_load(path_setting.HOSPITAL)
hospital_case, hospital_data = get_ids(data, "hospital")
@pytest.mark.parametrize("param", hospital_data, ids=hospital_case)
def test_hospital(self, param):
r = search_request().hospital(param["cp_id"], param["tag_id"], param["q"], param["count"], param["device_id"])
# print('feng=', r)
if r["error"] == 0:
assert r["data"] != param["assert"]
detail_messageid:
#验证成功case
-
case: "私信详情页最新一页的消息内容"
os_version: 10
last_msg_id: 0
offset_msg_id: 0
assert: 20
#城市筛选器
service_home_city_v2:
-
case: "城市筛选器接口"
current_city_id: ""
lat: "40.002"
lng: "116.487252"
assert: 0
get_gift_data:
-
case: "校验接口返回成功case"
gift_id: "111"
assert_message: "来晚咯,美券已领完!"
\ No newline at end of file
hospital:
#品类聚合页医生tab
-
case: "品类聚合页面医生tab"
assert: null
cp_id: 82
tag_id: []
q: "眼部整形"
count: 10
device_id: 869378034450718
import pytest
import path_setting
from all_doctor_api.glmer_request import glmer_request
from ids_list import get_ids
from in_common.base_request import BaseRequest
class TestServiceDetail:
service_detail = BaseRequest().api_load(path_setting.DETAIL_DATA)
ServiceDetail_case, ServiceDetail_data = get_ids(service_detail, "service_detail")
@pytest.mark.parametrize("params",ServiceDetail_data,ids=ServiceDetail_case)
def test_ServiceDetail(self,params):
r =glmer_request().service_detail()
print("------",r)
if r["code"] == 0:
assert r["code"] == params["assert"]
import pytest
import path_setting
from all_doctor_api.glmer_request import glmer_request
from ids_list import get_ids
from in_common.base_request import BaseRequest
class TestServiceRegister:
service_register = BaseRequest().api_load(path_setting.REGISTER_DATA)
ServiceRegister_case, ServiceRegister_data = get_ids(service_register, "service_register")
@pytest.mark.parametrize("params",ServiceRegister_data,ids=ServiceRegister_case)
def test_ServiceRegister(self,params):
r =glmer_request().service_register(params['name'],params['project_type'],params['upgrade'],params['short_description'],params['doctor_id'],params['start_time'],params['end_time'],params['photo_details'],params['image_header'],params['video_token'],params['service_type'],params['is_specialreview'],params['reservation'],params['have_extra_pay'],params['is_draft'],params['items'],params['csrfmiddlewaretoken'])
if r["code"] == 0:
assert r["code"] == params["assert"]
# elif r["error"] == 1:
# assert r["message"] == params["assert"]
import pytest
import path_setting
from all_doctor_api.glmer_request import glmer_request
from ids_list import get_ids
from in_common.base_request import BaseRequest
class TestTagProperties:
tag_properties = BaseRequest().api_load(path_setting.PROPERTIES_DATA)
TagProperties_case, TagProperties_data = get_ids(tag_properties, "tag_properties")
@pytest.mark.parametrize("params",TagProperties_data,ids=TagProperties_case)
def test_TagProperties(self,params):
r =glmer_request().tag_properties(params['catalog_ids'])
print("------",r)
if r["error"] == 0:
assert r["error"] == params["assert"]
import pytest
import path_setting
from all_doctor_api.web2_request import web2_request
from ids_list import get_ids
from in_common.base_request import BaseRequest
class TestServiceDelete:
service_delete=BaseRequest().api_load(path_setting.DELETE_DATA)
ServiceDelete_case, ServiceDeletet_data = get_ids(service_delete, "service_delete")
@pytest.mark.parametrize("params", ServiceDeletet_data, ids=ServiceDelete_case)
def test_ServiceDelete(self, params):
r = web2_request().service_delete(params['is_delete'], params['service_register_id'], params['csrfmiddlewaretoken'])
print("======", r)
if r["error"] == 0:
assert r["error"] == params["assert"]
# elif r["error"] == 1:
# assert r["message"] == params["assert"]
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_doctor_api.web_request import web_request
class TestConversation:
data = BaseRequest().api_load(path_setting.CONVERSATION)
conversation_case, conversation_data = get_ids(data, "conversation")
@pytest.mark.parametrize("param",conversation_data,ids=conversation_case)
def test_conversation(self, param):
'''全部私信列表'''
r = web_request().conversation(param["is_star"], param["page"])
if r["error"] == 0:
conversation = r.get("data").get("conversation", [])
assert len(conversation) <= param["assert"]
assert r["data"]["size"] <= param["assert_size"]
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_doctor_api.web_request import web_request
class TestService:
data = BaseRequest().api_load(path_setting.CONVERSATIONCOUPON)
conversationcoupon_case, conversationcoupon_data = get_ids(data, "conversation_coupon")
@pytest.mark.parametrize("param",conversationcoupon_data,ids=conversationcoupon_case)
def test_conversation_coupon(self, param):
'''发送美券按钮'''
r = web_request().conversation_coupon(param["doctor_user_id"])
if r["error"] == 0:
data1 = r.get("data", [])
assert len(data1) >= param["assert"]
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_doctor_api.web_request import web_request
class TestConversationDiary:
data = BaseRequest().api_load(path_setting.CONVERSATIONDIARY)
conversationdiary_case, conversationdiary_data = get_ids(data, "conversation_diary")
@pytest.mark.parametrize("param",conversationdiary_data,ids=conversationdiary_case)
def test_conversation_diary(self, param):
'''点击发送案例按钮'''
r = web_request().conversation_diary(param["doctor_user_id"])
print(r)
if r["error"] == 0:
data = r.get("data", [])
assert len(data) >= param["assert"]
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_doctor_api.web_request import web_request
class TestConversationUnreadList:
data = BaseRequest().api_load(path_setting.CONVERSATIONUNREADLIST)
unreadlist_case, unreadlist_data = get_ids(data, "conversation_unread_list")
@pytest.mark.parametrize("param",unreadlist_data,ids=unreadlist_case)
def test_conversation_unread_list(self, param):
'''未读私信列表'''
r = web_request().conversation_unread_list(param["page"])
if r["error"] == 0:
conversation = r.get("data").get("conversation", [])
assert len(conversation) <= param["assert"]
assert r["data"]["size"] <= param["assert_size"]
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_doctor_api.web_request import web_request
class TestService:
data = BaseRequest().api_load(path_setting.SERVICE)
service_case, service_data = get_ids(data, "service")
@pytest.mark.parametrize("param",service_data,ids=service_case)
def test_service(self, param):
'''未读私信列表'''
r = web_request().service()
if r["error"] == 0:
data = r.get("data").get("data", [])
assert len(data) <= param["assert"]
assert r["data"]["size"] <= param["assert_size"]
import pytest
import path_setting
from all_doctor_api.web_request import web_request
from ids_list import get_ids
from in_common.base_request import BaseRequest
class TestServiceOffline:
service_offline = BaseRequest().api_load(path_setting.OFFLINE_DATA)
ServiceOffline_case, ServiceOffline_data = get_ids(service_offline, "service_offline")
@pytest.mark.parametrize("params",ServiceOffline_data,ids=ServiceOffline_case)
def test_ServiceOffline_data(self,params):
r = web_request().service_offline(params['id'],params['csrfmiddlewaretoken'])
print("=======",r)
if r["error"] == 0:
assert r["error"] == params["assert"]
service_detail:
-
case: "编辑商品-进入商品详情页 "
assert: 0
service_register:
#我的商品菜单下有数据返回1
-
case: "发布(新增)商品-保存商品"
name: "激光溶脂瘦脸"
project_type: "[236]"
upgrade: "true"
short_description: "测试"
doctor_id: "wangyang"
start_time: "1624377600"
end_time: "1627660800"
photo_details: "<p>12</p>"
image_header: "https://heras.igengmei.com/service/2021/06/01/0b9b110e60"
video_token: "UPCOYIJkZOMcdd9FDzpBqYjzWUh55fBpVi3AhWpL:nBdvXYz_CR7wNcuroo3TLyvuQiY=:eyJzY29wZSI6InZpZGVvIiwiZGVhZGxpbmUiOjE2MjI1MTg2NTd9"
service_type: "0"
is_specialreview: "false"
reservation: "1"
have_extra_pay: "false"
is_draft: "0"
items: '[{"gengmei_price":100,"original_price":200,"is_online":true}]'
csrfmiddlewaretoken: "PC8uTySuxipukIMuqNV1OPB376C2ZZ3g"
assert: 0
tag_properties:
-
case: "我的商品-编辑可标准化商品 "
catalog_ids: "[115,141]"
assert: 0
service_delete:
#我的商品-删除下线商品
-
case: "我的商品-删除下线商品"
is_delete: "1"
service_register_id: "209863"
csrfmiddlewaretoken: "PC8uTySuxipukIMuqNV1OPB376C2ZZ3g"
assert: 0
conversation:
#全部私信case
-
case: "请求成功,有数据返回的第一页数据"
is_star: 0
page: 1
assert_size: 10
assert: 10
conversation_coupon:
#私信点击发送优惠券case
-
case: "点击私信发送优惠券按钮"
doctor_user_id: "602329"
assert: 0
-
case: "点击私信发送优惠券按钮接口报错"
doctor_user_id: "602329"
assert: 0
assert_message: '缺少参数: doctor_user_id'
assert_data: None
conversation_diary:
#私信点击发送案例case
-
case: "点击私信发送案例按钮"
doctor_user_id: 602329
assert: 0
conversation_unread_list:
#未读私信case
-
case: "请求成功,有未读消息"
page: 1
assert_size: 10
assert: 10
service:
#私信点击发送商品case
-
case: "点击私信发送商品按钮"
#page: 1
assert_size: 10
assert: 10
service_offline:
-
case: "我的商品-下线商品"
id: 209992
csrfmiddlewaretoken: PC8uTySuxipukIMuqNV1OPB376C2ZZ3g
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