Commit 9d925952 authored by 陈雪's avatar 陈雪

冲突

parents d541b757 d72713fa
No preview for this file type
......@@ -103,3 +103,5 @@ venv.bak/
# mypy
.mypy_cache/
host.yaml
\ No newline at end of file
#查看日记本相册页面
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
......@@ -104,6 +104,12 @@ class janus_request(BaseRequest):
return self.api_send(self.data['keyword_tip'])
# 新版本我的美券列表
def product_my_list(self,start_num,tab_id):
self.params['start_num'] = start_num
self.params['tab_id'] = tab_id
return self.api_send(self.data['coupon_my_list'])
if __name__ == '__main__':
#打印购物车-猜你喜欢列表接口返回
......@@ -121,4 +127,4 @@ if __name__ == '__main__':
print(janus_request().polymer())
print("fgx")
print(janus_request().product_my_list(0, 0))
\ No newline at end of file
......@@ -98,6 +98,13 @@ keyword_tip:
#新版本我的美券
coupon_my_list:
method: get
url: /api/janus/product/coupon/my_list
params:
start_num: ${start_num}
tab_id: ${tab_id}
isLogin: 1
import path_setting
from in_common.base_request import BaseRequest
class orders_request(BaseRequest):
def __init__(self):
self.data = self.api_load(path_setting.ORDERS_MY_V2_CONFIG)
# 我的订单列表
def my_v2(self,start_num,status,version):
self.params["start_num"] = start_num
self.params["status"] = status
self.params["version"] = version
return self.api_send(self.data["my_v2"])
if __name__ == '__main__':
print(orders_request().my_v2(0,1,"7.44.0"))
my_v2:
method: get
url: /api/orders/my/v2
params:
start_num: ${start_num}
status: ${status}
version: ${version}
isLogin: 1
import path_setting
from in_common.base_request import BaseRequest
class pay_request(BaseRequest):
def __init__(self):
self.wechat_pay = self.api_load(path_setting.WECHAT_PAY)
def wechat_prepay(self, settlement_id):
self.params["settlement_id"] = settlement_id
return self.api_send(self.wechat_pay["wechat_prepay"])
def alipay_prepay(self, settlement_id, version,is_huabei,huabei_period):
self.params["settlement_id"] = settlement_id
self.params["version"] = version
self.params["is_huabei"] = is_huabei
self.params["huabei_period"] = huabei_period
return self.api_send(self.wechat_pay["alipay_prepay"])
def jump(self,settlement_id):
self.params["settlement_id"] = settlement_id
return self.api_send(self.wechat_pay["jump"])
if __name__ == '__main__':
# print(settlement_request().preview_v1("beijing", "599428", 1, 1, 1, "true", 0))
print(pay_request().wechat_prepay(522139664651))
\ No newline at end of file
wechat_prepay:
method: post
url: /pay/wechat/prepay
params:
current_city_id: "beijing"
version: 7.44.0
data:
settlement_id: ${settlement_id}
isLogin: 1
alipay_prepay:
method: post
url: /pay/alipay/prepay
params:
current_city_id: "beijing"
version: 7.44.0
data:
settlement_id: ${settlement_id}
version: ${version}
is_huabei: ${is_huabei}
huabei_period: ${huabei_period}
isLogin: 1
jump:
method: post
url: /pay/jump
params:
current_city_id: "beijing"
version: 7.44.0
data:
settlement_id: ${settlement_id}
isLogin: 1
#推荐内容
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"])
import path_setting
from in_common.base_request import BaseRequest
class settlement_request(BaseRequest):
def __init__(self):
self.preview = self.api_load(path_setting.PREVIEW_V1)
def preview_v1(self, current_city_id, service_item_id, number, use_platform_coupon, use_doctor_coupon, use_coupon_grey, is_create_groupbuy):
self.params["current_city_id"] = current_city_id
self.params["service_item_id"] = service_item_id
self.params["number"] = number
self.params["use_platform_coupon"] = use_platform_coupon
self.params["use_doctor_coupon"] =use_doctor_coupon
self.params["use_coupon_grey"] = use_coupon_grey
self.params["is_create_groupbuy"] = is_create_groupbuy
return self.api_send(self.preview["preview_v1"])
def pay_v1(self, actual_pay, payment_final_price, is_contains_groupbuy_order,mul_orders_number):
self.params["actual_pay"] = actual_pay
self.params["payment_final_price"] = payment_final_price
self.params["is_contains_groupbuy_order"] = is_contains_groupbuy_order
self.params["mul_orders_number"] = mul_orders_number
return self.api_send(self.preview["pay_v1"])
def create_v1(self,service_item_id, number,platform_coupon_id,use_point,is_doctor_see,doctor_coupon_id,insurance_info,is_create_groupbuy):
self.params["service_item_id"] = service_item_id
self.params["number"] = number
self.params["platform_coupon_id"] = platform_coupon_id
self.params["use_point"] = use_point
self.params["is_doctor_see"] = is_doctor_see
self.params["doctor_coupon_id"] = doctor_coupon_id
self.params["insurance_info"] = insurance_info
self.params["is_create_groupbuy"] = is_create_groupbuy
return self.api_send(self.preview["create_v1"])
def pay(self,id):
self.params["id"] = id
return self.api_send(self.preview["pay"])
def detail(self, id):
self.params["id"] = id
return self.api_send(self.preview["detail"])
def delete(self, id, cancel_reason_value):
self.params["id"] = id
self.params["cancel_reason_value"] = cancel_reason_value
return self.api_send(self.preview["delete"])
if __name__ == '__main__':
# print(settlement_request().preview_v1("beijing", "599428", 1, 1, 1, "true", 0))
print(settlement_request().delete("522139664651","不想买了"))
\ No newline at end of file
preview_v1:
method: post
url: /api/settlement/preview/v1
params:
current_city_id: ${current_city_id}
data:
service_item_id: ${service_item_id}
number: ${number}
use_platform_coupon: ${use_platform_coupon}
use_doctor_coupon: ${use_doctor_coupon}
use_coupon_grey: ${use_coupon_grey}
is_create_groupbuy: ${is_create_groupbuy}
json: {}
isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
pay_v1:
method: get
url: /api/settlement/pay/v1
params:
current_city_id: "beijing"
actual_pay: ${actual_pay}
payment_final_price: ${payment_final_price}
is_contains_groupbuy_order: ${is_contains_groupbuy_order}
mul_orders_number: ${mul_orders_number}
data: {}
json: {}
isLogin: 1
create_v1:
method: post
url: /api/settlement/create/v1
params:
current_city_id: "beijing"
version: 7.44.0
data:
service_item_id: ${service_item_id}
number: ${number}
phone: "18301089978"
platform_coupon_id: ${platform_coupon_id}
use_point: ${use_point}
is_doctor_see: ${is_doctor_see}
doctor_coupon_id: ${doctor_coupon_id}
insurance_info: ${insurance_info}
is_create_groupbuy: ${is_create_groupbuy}
isLogin: 1
pay:
method: get
url: /api/settlement/pay
params:
current_city_id: "beijing"
id: ${id}
version: 7.44.0
data: {}
isLogin: 1
detail:
method: get
url: /api/settlement/detail
params:
current_city_id: "beijing"
id: ${id}
version: 7.44.0
data: {}
isLogin: 1
delete:
method: post
url: /api/settlement/delete
params:
current_city_id: "beijing"
version: 7.44.0
data:
id: ${id}
cancel_reason_value: ${cancel_reason_value}
json: {}
isLogin: 1
#查看用户帖子详情页
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 visual_beauty_card_request(BaseRequest):
def __init__(self):
#自定义专题-更美次卡橱窗组件商品
self.data = self.api_load(path_setting.VISUAL_BEAUTY_CARD_SERVICES_CONFIG)
#自定义专题-更美次卡商品列表筛选器
self.data = self.api_load(path_setting.BEAUTYCARD_FILTERS_CONFIG)
#自定义专题-更美次卡橱窗组件商品
def visual_beauty_card_services(self, unit_id, current_city_id, page, page_size, version, device_id = '97B6764B-2135-4761-9911-701C38CBC272'):
self.params["unit_id"] = unit_id
self.params["current_city_id"] = current_city_id
self.params["page"] = page
self.params["page_size"] = page_size
self.params["version"] = version
return self.api_send(self.data['visual_beauty_card_services'])
#自定义专题-更美次卡商品列表筛选器
def beautycard_filters(self, unit_id, current_city_id, version, device_id = '97B6764B-2135-4761-9911-701C38CBC272'):
self.params["unit_id"] = unit_id
self.params["current_city_id"] = current_city_id
self.params["version"] = version
return self.api_send(self.data['beautycard_filters'])
#自定义专题-更美次卡商品列表组件商品
def beautycard_skus(self, unit_id, tag_id, area, sort_type, page, page_size, device_id = '97B6764B-2135-4761-9911-701C38CBC272'):
self.params["unit_id"] = unit_id
self.params["tag_id"] = tag_id
self.params["area"] = area
self.params["sort_type"] = sort_type
self.params["page"] = page
self.params["page_size"] = page_size
return self.api_send(self.data['beautycard_skus'])
\ No newline at end of file
visual_beauty_card_services:
method: GET
url: /api/janus/visual_beauty_card/services
params:
#组件id
unit_id : ${unit_id}
current_city_id : ${current_city_id}
#分页
page : ${page}
#分页大小
page_size : ${page_size}
version : ${version}
data: {}
json: {}
beautycard_filters:
method: GET
url: /api/janus/visual_beauty_card/list_unit/filters
params:
#组件id
unit_id : ${unit_id}
current_city_id : ${current_city_id}
version : ${version}
data: {}
json: {}
beautycard_skus:
method: GET
url: /api/janus/visual_beauty_card/list_unit/skus
params:
#组件id
unit_id : ${unit_id}
#类型筛选器(-1: 全部类型)
tag_id : ${tag_id}
#城市筛选器
area : ${area}
#排序方式(0: 默认排序, 1: 销量排序, 2: 价格排序, 3: 上架时间排序)
sort_type : ${sort_type}
#分页
page : ${page}
#分页大小
page_size : ${page_size}
data: {}
json: {}
......@@ -2,6 +2,4 @@ develop_host:
backend: http://backend.paas-develop.env
# doctor: http://doctor.paas-develop.env
# backend: https://backend.igengmei.com
......@@ -69,10 +69,18 @@ class BaseRequest:
# headers=user_headers,
data=req.get('data'),
json=req.get('json'),
# verify=False
# proxies={"http":"172.30.9.226:8888"}
)
return r.json()
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):
......
......@@ -31,7 +31,8 @@ class LoginFunction:
url=url,
params=self.params["backend_login"]["params"],
data=self.params["backend_login"]["data"],
headers={'Connection': 'close'}
headers={'Connection': 'close'},
# verify=False
)
return s
......
......@@ -9,6 +9,16 @@ backend_login:
vfc_type:
face_token:
#backend_login:
# method: POST
# url: /api/accounts/login/password
# params:
# current_city_id: "beijing"
# data:
# phone: "+8618646292152"
# password: 111111
doctor_login:
method: post
url: /api/web/account/login
......
This diff is collapsed.
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"]
......@@ -14,7 +14,7 @@ class TestThirdPhoneLogin:
def test_thirdphone_login(self,param):
r = thirdphonelogin_request().thirdphone_login(param["version"],param["phone_data"],param["phone_from_type"])
print('______',r)
if r["error"] == 1:
assert r['message'] == param["assert"]
\ 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.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 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 TestProductMyLiSt:
data = BaseRequest().api_load(path_setting.JANUS_PRODUCT_MY_LIST_DATA)
product_my_list_detail_case, product_my_list_detail_data = get_ids(data, "product_my_list")
@pytest.mark.parametrize("param", product_my_list_detail_data, ids=product_my_list_detail_case)
def test_product_my_list(self, param):
r = janus_request().product_my_list(param["start_num"], param["tab_id"])
assert r["error"] == 0
coupon_list = r["data"]["coupon_list"]
print(len(coupon_list))
assert 0 <= len(coupon_list) <= 20
if len(coupon_list) < 10:
assert r["data"]["no_more_data"] is True
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.orders_request import orders_request
class TestOrdersMyV2Waituse:
data = BaseRequest().api_load(path_setting.ORDERS_MY_V2_DATA)
my_order_waituse_case, my_order_waituse_data = get_ids(data, "waituse")
@pytest.mark.parametrize("param",my_order_waituse_data,ids=my_order_waituse_case)
def test_orders_waituse(self,param):
r = orders_request().my_v2(param["start_num"], param["status"], param["version"])
if r["error"] == 0:
orders = r["data"]["orders"]
for order in orders:
# 这个是次卡
if order["type"] == 4:
# 订单信息
order_id = order["order"]["order_id"]
order_status = order["order"]["order_status"]["status"]
order_statust = order["order"]["order_status"]["text"]
gm_url = order["gm_url"]
print(order_id, order_status, order_statust, gm_url)
assert order_status == param["beauty_card_order_status"]
assert order_statust == param["beauty_card_order_statust"]
assert gm_url == param["beauty_card_order_gmurl"].format(order_id)
# 按钮信息,预约
beauty_card_payment_order_wait_used_title = order["buttons"][0]["title"]
beauty_card_payment_order_wait_used_url = order["buttons"][0]["url"]
assert beauty_card_payment_order_wait_used_title == param["beauty_card_button_title"]
assert beauty_card_payment_order_wait_used_url == param["beauty_card_button_gmurl"].format(order_id)
# 7.44.0加的领取面膜按钮
beauty_card_free_service_title = order["buttons"][1]["title"]
assert beauty_card_free_service_title == param["beauty_card_button_mianmo_title"]
# 普通美购订单
if order["type"] == 0:
# 订单信息
order_id = order["order"]["order_id"]
order_status = order["order"]["order_status"]["status"]
order_statust = order["order"]["order_status"]["text"]
assert order_status == param["putong_card_order_status"]
assert order_statust == param["putong_card_order_statust"]
print(order_status, order_statust)
import pytest
import path_setting
from all_backend_api.pay_request import pay_request
from all_backend_api.settlement_request import settlement_request
from ids_list import get_ids
from in_common.base_request import BaseRequest
class TestAlipayPay:
data = BaseRequest().api_load(path_setting.ALIPAYDATA)
alipay_case, alipay_data = get_ids(data, "alipay_prepay")
@pytest.mark.parametrize("param", alipay_data, ids=alipay_case)
def test_alipay_prepay(self, param):
create_resp = settlement_request().create_v1(param["service_item_id"],param["number"],param["platform_coupon_id"],param["use_point"],
param["is_doctor_see"],param["doctor_coupon_id"],param["insurance_info"],param["is_create_groupbuy"])
settlement_id = create_resp["data"]["id"]
r = pay_request().alipay_prepay(settlement_id,param["version"],param["is_huabei"],param["huabei_period"])
print(r)
assert r["error"] == param["assert"]
import pytest
import path_setting
from all_backend_api.pay_request import pay_request
from all_backend_api.settlement_request import settlement_request
from ids_list import get_ids
from in_common.base_request import BaseRequest
class TestJump:
data = BaseRequest().api_load(path_setting.JUMPDATA)
jump_case, jump_data = get_ids(data, "jump")
@pytest.mark.parametrize("param", jump_data, ids=jump_case)
def test_jump(self, param):
create_resp = settlement_request().create_v1(param["service_item_id"],param["number"],param["platform_coupon_id"],param["use_point"],
param["is_doctor_see"],param["doctor_coupon_id"],param["insurance_info"],param["is_create_groupbuy"])
settlement_id = create_resp["data"]["id"]
r = pay_request().jump(settlement_id)
print(r)
assert r["error"] == param["assert"]
import pytest
import path_setting
from all_backend_api.pay_request import pay_request
from all_backend_api.settlement_request import settlement_request
from ids_list import get_ids
from in_common.base_request import BaseRequest
class TestWechatPrepay:
data = BaseRequest().api_load(path_setting.WECHARTPAYDATA)
wechart_case, wechart_data = get_ids(data, "wechart_pay")
@pytest.mark.parametrize("param", wechart_data, ids=wechart_case)
def test_wechart_prepay(self, param):
create_resp = settlement_request().create_v1(param["service_item_id"],param["number"],param["platform_coupon_id"],param["use_point"],
param["is_doctor_see"],param["doctor_coupon_id"],param["insurance_info"],param["is_create_groupbuy"])
settlement_id = create_resp["data"]["id"]
r = pay_request().wechat_prepay(settlement_id)
print(r)
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.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
import path_setting
from all_backend_api.settlement_request import settlement_request
from ids_list import get_ids
from in_common.base_request import BaseRequest
class TestCreateV1:
data = BaseRequest().api_load(path_setting.CREATE)
create_case, create_data = get_ids(data, "create_v1")
print(create_data)
@pytest.mark.parametrize("param", create_data, ids=create_case)
def test_create_v1(self, param):
r = settlement_request().create_v1(param["service_item_id"],param["number"],param["platform_coupon_id"],
param["use_point"],param["is_doctor_see"],param["doctor_coupon_id"],
param["insurance_info"],param["is_create_groupbuy"])
print(r)
assert r["error"] == param["assert"]
import pytest
import path_setting
from all_backend_api.settlement_request import settlement_request
from ids_list import get_ids
from in_common.base_request import BaseRequest
class TestPay:
data = BaseRequest().api_load(path_setting.PAY)
pay_case, pay_data = get_ids(data, "pay")
@pytest.mark.parametrize("param", pay_data, ids=pay_case)
def test_pay(self, param):
pay_r = settlement_request().create_v1(param["service_item_id"],param["number"],param["platform_coupon_id"],param["use_point"],param["is_doctor_see"],param["doctor_coupon_id"],param["insurance_info"],param["is_create_groupbuy"])
id = pay_r["data"]["id"]
r = settlement_request().pay(id)
assert r["error"] == param["assert"]
import pytest
import path_setting
from all_backend_api.settlement_request import settlement_request
from ids_list import get_ids
from in_common.base_request import BaseRequest
class TestPayV1:
data = BaseRequest().api_load(path_setting.PAY_V1)
pay_case, pay_data = get_ids(data, "pay_v1")
@pytest.mark.parametrize("param", pay_data, ids=pay_case)
def test_pay_v1(self, param):
r = settlement_request().pay_v1(param["actual_pay"],param["payment_final_price"],param["is_contains_groupbuy_order"],param["mul_orders_number"])
print(r)
assert r["error"] == param["assert"]
import pytest
import path_setting
from all_backend_api.settlement_request import settlement_request
from ids_list import get_ids
from in_common.base_request import BaseRequest
class TestPreviewV1:
data = BaseRequest().api_load(path_setting.PREVIEW)
preview_case, preview_data = get_ids(data, "preview_v1")
@pytest.mark.parametrize("param", preview_data, ids=preview_case)
def test_preview_v1(self, param):
r = settlement_request().preview_v1(param["current_city_id"],param["service_item_id"],param["number"],param["use_platform_coupon"],param["use_doctor_coupon"],param["use_coupon_grey"],param["is_create_groupbuy"])
print(r)
assert r["error"] == param["assert"]
import pytest
import path_setting
from all_backend_api.orders_request import orders_request
from ids_list import get_ids
from in_common.base_request import BaseRequest
from all_backend_api.settlement_request import settlement_request
class TestSettlementDelete:
data = BaseRequest().api_load(path_setting.SETTLEMENTDELETE)
delete_case, delete_data = get_ids(data, "settlement_delete")
@pytest.mark.parametrize("param", delete_data, ids=delete_case)
def test_settlement_delete(self, param):
r = orders_request().my_v2(param["start_num"],param["status"],param["version"])
for item in r["data"]["orders"]:
item = item
break
# print("999999999999999",item["settlement_id"])
if item["settlement_status"] == "0":
id = item["settlement_id"]
r = settlement_request().delete(id,param["cancel_reason_value"])
assert r["message"] == param["assert"]
else:
print("无可取消订单")
# print(r)
# if r["error"] == 0:
# assert r["error"] == param["assert"]
# else:
# assert r["error"] == param["assert"]
import pytest
import path_setting
from all_backend_api.settlement_request import settlement_request
from ids_list import get_ids
from in_common.base_request import BaseRequest
class TestSettlementDetail:
data = BaseRequest().api_load(path_setting.SETTLEMENTDETAIL)
detail_case, detail_data = get_ids(data, "settlement_detail")
@pytest.mark.parametrize("param", detail_data, ids=detail_case)
def test_settlement_detail(self, param):
r = settlement_request().detail(param["id"])
if r["error"] == 0:
assert r["error"] == param["assert"]
else:
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.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
import pytest
import path_setting
from all_backend_api.visual_beauty_card import visual_beauty_card_request
from ids_list import get_ids
from in_common.base_request import BaseRequest
#次卡商品列表筛选器接口
class TestBeautyCardFilters:
data = BaseRequest().api_load(path_setting.BEAUTYCARD_FILTERS)
beautycard_filters_case, beautycard_filters_data = get_ids(data, "beautycard_filters")
@pytest.mark.parametrize("param", beautycard_filters_data, ids=beautycard_filters_case)
def test_beautycard_filters(self, param):
print('次卡商品列表筛选器')
r = visual_beauty_card_request().beautycard_filters(param["unit_id"], param["current_city_id"], param["version"])
if r["data"]:
print('次卡商品列表筛选器下拉列表有值')
assert len(r["data"]["field"]) != param["assert"]
assert len(r["data"]["areas"]) != param["assert"]
assert len(r["data"]["order"]) != param["assert"]
\ No newline at end of file
import pytest
import path_setting
from all_backend_api.visual_beauty_card import visual_beauty_card_request
from ids_list import get_ids
from in_common.base_request import BaseRequest
#次卡商品列表组件商品
class TestBeautyCardSkus:
data = BaseRequest().api_load(path_setting.BEAUTYCARD_SKUS)
beautycard_skus_case, beautycard_skus_data = get_ids(data, "beautycard_skus")
@pytest.mark.parametrize("param", beautycard_skus_data, ids=beautycard_skus_case)
def test_beautycard_skus(self, param):
print('次卡商品列表组件商品')
r = visual_beauty_card_request().beautycard_skus(param["unit_id"], param["tag_id"], param["area"], param["sort_type"], param["page"], param["page_size"])
if r["data"]:
print('次卡商品列表组件有商品召回')
assert len(r["data"]["beautycards"]) != param["assert"]
\ No newline at end of file
import pytest
import path_setting
from all_backend_api.visual_beauty_card import visual_beauty_card_request
from ids_list import get_ids
from in_common.base_request import BaseRequest
#次卡橱窗商品
class TestVisualBeautyCardServices:
data = BaseRequest().api_load(path_setting.VISUAL_BEAUTY_CARD_SERVICES)
visual_beauty_card_services_case, visual_beauty_card_services_data = get_ids(data, "visual_beauty_card_services")
@pytest.mark.parametrize("param", visual_beauty_card_services_data, ids=visual_beauty_card_services_case)
def test_visual_beauty_card_services(self, param):
print('次卡橱窗')
r = visual_beauty_card_request().visual_beauty_card_services(param["unit_id"], param["current_city_id"], param["page"], param["page_size"], param["version"])
if r["data"]["beautycards"]:
print('次卡橱窗有商品')
assert len(r["data"]["beautycards"]) != param["assert"]
\ No newline at end of file
login_thirdphone:
- case: "无版本号手机号一键登录case"
-
case: "无版本号手机号一键登录case"
phone_data: '{
"token" : "A4-lVEf_Fk2ekkxSFgSZ59yD6bPaIxHWzJfsGgaEBDrbZzFyxMueOODIoBeXXQuHU8REjG42jvyjQa2a3rkDm8ufKlI8DL3ny2FfxnUrnuQOycWRaHKN3664onbOetr54dvb4wkVaV7X33yBlw7u_ZCNqIOwTnRQ9kPgHDBpvyN4NTdYYf2tJWhF4VeiVOqc7OiRz-Nzt08AUvbtWpw6sPQjA==",
"appId" : "xK5yFMfJ"
......@@ -9,7 +10,8 @@ login_thirdphone:
version:
assert: "获取手机号失败"
- case: "大于7.32手机号一键登录case"
-
case: "大于7.32手机号一键登录case"
phone_data: '{
"token" : "A4-lVEf_Fk2ekkxSFgSZ59yD6bPaIxHWzJfsGgaEBDrbZzFyxMueOODIoBeXXQuHU8REjG42jvyjQa2a3rkDm8ufKlI8DL3ny2FfxnUrnuQOycWRaHKN3664onbOetr54dvb4wkVaV7X33yBlw7u_ZCNqIOwTnRQ9kPgHDBpvyN4NTdYYf2tJWhF4VeiVOqc7OiRz-Nzt08AUvbtWpw6sPQjA==",
"appId" : "xK5yFMfJ"
......@@ -18,7 +20,8 @@ login_thirdphone:
version: "7.43.0"
assert: "获取手机号失败"
- case: "小于7.32手机号一键登录case"
-
case: "小于7.32手机号一键登录case"
phone_data: '{
"token" : "A4-lVEf_Fk2ekkxSFgSZ59yD6bPaIxHWzJfsGgaEBDrbZzFyxMueOODIoBeXXQuHU8REjG42jvyjQa2a3rkDm8ufKlI8DL3ny2FfxnUrnuQOycWRaHKN3664onbOetr54dvb4wkVaV7X33yBlw7u_ZCNqIOwTnRQ9kPgHDBpvyN4NTdYYf2tJWhF4VeiVOqc7OiRz-Nzt08AUvbtWpw6sPQjA==",
"appId" : "xK5yFMfJ"
......
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
product_my_list:
-
case: "未使用美券列表"
start_num: 0
tab_id: 0
-
case: "已使用美券列表"
start_num: 0
tab_id: 1
-
case: "已过期"
start_num: 0
tab_id: 2
\ No newline at end of file
waituse:
#待使用
-
case: "待使用tab"
start_num: 0
status: 1
version: "7.44.0"
beauty_card_order_status : 4
beauty_card_order_statust : "待使用"
beauty_card_order_gmurl : "gengmei://order_beauty_card_detail?order_id={}&type=4"
beauty_card_button_title : "预约服务"
beauty_card_button_gmurl : "gengmei://order_beauty_card_reserve?order_id={}"
beauty_card_button_mianmo_title : "立即领取面膜"
putong_card_order_status : "1"
putong_card_order_statust : "待使用"
\ No newline at end of file
alipay_prepay:
-
case: "普通美购下单流程--支付宝支付方式"
version: v1
is_huabei: 0
huabei_period: 0
service_item_id: 473317
number: 1
platform_coupon_id: ""
use_point: 0
is_doctor_see: 1
doctor_coupon_id: ""
insurance_info: "[]"
is_create_groupbuy: 0
assert: 0
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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