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

Initial commit

parents
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/
# Translations
*.mo
*.pot
# Django stuff:
*.log
local_settings.py
db.sqlite3
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/_build/
# PyBuilder
target/
# Jupyter Notebook
.ipynb_checkpoints
# pyenv
.python-version
# celery beat schedule file
celerybeat-schedule
# SageMath parsed files
*.sage.py
# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
# Spyder project settings
.spyderproject
.spyproject
# Rope project settings
.ropeproject
.idea
# mkdocs documentation
/site
# mypy
.mypy_cache/
host.yaml
.DS_Store
*/.DS_Store
\ No newline at end of file
FROM ccr.ccs.tencentyun.com/gm-base/py3.8:v1.0
COPY ./requirements.txt /tmp
WORKDIR /srv/apps/backend_auto/
RUN apk add --no-cache --virtual .build-deps \
bzip2-dev \
coreutils \
dpkg-dev dpkg \
expat-dev \
findutils \
gcc \
gdbm-dev \
libc-dev \
libffi-dev \
libnsl-dev \
libressl-dev \
libtirpc-dev \
linux-headers \
make \
ncurses-dev \
pax-utils \
readline-dev \
sqlite-dev \
tcl-dev \
tk \
tk-dev \
xz-dev \
zlib-dev \
# 业务相关依赖和安装工具
linux-headers \
python-dev \
# librdkafka-dev=0.11.6-r1 \
mariadb-client \
mariadb-dev \
git \
openssh \
\
# 取消ssh第一次链接的确认
&& echo "StrictHostKeyChecking no" >> /etc/ssh/ssh_config \
# && pip install six verlib \
&& pip install --no-cache-dir -r /tmp/requirements.txt
COPY . /srv/apps/backend_auto/
# 先这样 最好用环境变量 如果配置变多后 再挂载
RUN apk add curl && apk del .build-deps && echo "develop_host:" > host.yaml && echo " url: http://backend-service" >> host.yaml
# 代码里有写死的 backend_auto
WORKDIR /srv/apps/backend_auto/
CMD python run.py
\ No newline at end of file
@Library('gm-pipeline-library') _
pipeline {
agent any
options {
// Console output add timestamps
timestamps()
// Disallow concurrent executions of the Pipeline
disableConcurrentBuilds()
// On failure, retry the entire Pipeline the specified number of times.
retry(1)
}
parameters {
choice(name: 'CACHE', choices: ['', '--no-cache'], description: 'docker build 是否使用cache,默认使用,不使用为--no-cache')
}
environment {
// Image Tag branch.time.hash
TAG = dockerTag()
// Image Full Tag
IMAGE = "${DOCKER_REGISTRY}/gm-backend/autotest-backend:$TAG"
ALIAS = "${DOCKER_REGISTRY}/gm-backend/autotest-backend:v1.0.0"
}
stages {
stage("Begin") {
steps {
dingNotify "before"
}
}
stage('Build Image') {
steps {
sh "docker build . ${params.CACHE} -t $IMAGE -f ./Dockerfile"
sh "docker push $IMAGE"
sh "docker tag $IMAGE $ALIAS && docker push $ALIAS"
}
}
}
post {
always {
dingNotify "after", "${currentBuild.currentResult}"
}
}
}
\ No newline at end of file
import path_setting
from in_common.base_request import BaseRequest
class account_request(BaseRequest):
def __init__(self):
self.loginvfc = self.api_load(path_setting.APYAML_CONFIG)
def login_vfc(self,current_city_id,phone_num,vfc_code,vfc_type="",face_token=""):
self.params["current_city_id"] = current_city_id
self.params["phone_num"] = phone_num
self.params["vfc_code"] = vfc_code
self.params["vfc_type"] = vfc_type
self.params["face_token"] = face_token
return self.api_send(self.loginvfc["login_vfc"])
if __name__ == '__main__':
# print(account_request().user_info())
print(account_request.loginvfc(""))
\ No newline at end of file
login_vfc:
method: post
url: /api/account/login/login_vfc
params:
current_city_id: ${current_city_id}
data:
phone_num: ${phone_num}
vfc_code: ${vfc_code}
vfc_type: ${vfc_type}
face_token: ${face_token}
json: {}
isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
import path_setting
from in_common.base_request import BaseRequest
import pytest
class send_reqest(BaseRequest):
def __init__(self):
self.data = self.api_load(path_setting.LOGIN_CONFIG)
print(self.data)
def login_passwd(self,current_city_id,phone,password,face_token=""):
self.params["current_city_id"] = current_city_id
self.params["phone"] = phone
self.params["password"] = password
self.params["face_token"] = face_token
return self.api_send(self.data["password"])
if __name__ == '__main__':
print(send_reqest().login_passwd("beijing", "17796839512", 123456, ""))
password:
method: post
url: /api/accounts/login/password
params:
current_city_id: ${current_city_id}
data:
phone: ${phone}
password: ${password}
face_token: ${face_token}
json: {}
import path_setting
from in_common.base_request import BaseRequest
class answer_request(BaseRequest):
def __init__(self):
self.abc = self.api_load(path_setting.DETAIL_CONFIG)
# print(self.abc)
# 回答详情页
def detail(self, current_city_id, answer_id=""):
self.params["current_city_id"] = current_city_id
self.params["answer_id"] = answer_id
return self.api_send(self.abc["detail"])
# 回答详情页点赞
def vote(self, answer_id=""):
self.params["answer_id"] = answer_id
return self.api_send(self.abc["vote"])
# 回答详情页取消点赞
def cancel_vote(self, answer_id=""):
self.params["answer_id"] = answer_id
return self.api_send(self.abc["cancel_vote"])
#回答详情页
detail:
method: get
url: /api/answer/detail
params:
current_city_id: ${current_city_id}
data:
answer_id: ${answer_id}
json: {}
# isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
#回答详情页——点赞
vote:
method: post
url: /api/answer/vote
params:
current_city_id: ${current_city_id}
data:
answer_id: ${answer_id}
json: {}
isLogin: 1
#回答详情页——取消点赞
cancel_vote:
method: post
url: /api/answer/cancel_vote
params:
current_city_id: ${current_city_id}
data:
answer_id: ${answer_id}
json: {}
isLogin: 1
import path_setting
from in_common.base_request import BaseRequest
class common_request(BaseRequest):
def __init__(self):
self.data = self.api_load(path_setting.DIARY_COMMON_CONFIG)
# 日记贴评论列表--一级评论列表
def diary_common_reply(self, id, type):
self.params["id"] = id
self.params["type"] = type
return self.api_send(self.data["reply_detail"])
# 日记贴评论列表--二级评论
def topic_sub_common(self, id, type, reply_id):
self.params["id"] = id
self.params["type"] = type
self.params["reply_id"] = reply_id
return self.api_send(self.data["sub_common"])
#日记本的评论列表---一级评论列表
reply_detail:
method: get
url: /api/common/reply
params:
id: ${id}
type: ${type}
data: {}
json: {}
isLogin: 0 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
#日记本列表--日记贴--二级评论列表
sub_common:
method: get
url: /api/common/reply/sub_reply
params:
id: ${id}
type: ${type}
reply_id: ${reply_id}
data: {}
json: {}
isLogin: 0 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
import path_setting
from in_common.base_request import BaseRequest
class conversation_request(BaseRequest):
def __init__(self):
self.messageread = self.api_load(path_setting.MESSAGE_READ_CONFIG)
def message_read(self,current_city_id,release,message_ids):
self.params["current_city_id"] = current_city_id
self.params["release"] = release
#self.params["uqid"] = uqid
self.params["message_ids"] = message_ids
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__':
print(conversation_request().message_read("beijing", 1,'[10622,10626,10646,10651]'))
print(conversation_request().detail_messageid(10, 0, 0))
message_read:
method: post
url: /api/conversation/message/read
params:
current_city_id: ${current_city_id}
release: ${release}
#uqid: ${uqid}
data:
message_ids: ${message_ids}
json: {}
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 diary_request(BaseRequest):
def __init__(self):
self.data = self.api_load(path_setting.DIARY_CONFIG)
# 收藏
def diary_isfavor(self):
return self.api_send(self.data["isfavor"])
# 取消收藏
def diary_cancelfavor(self):
return self.api_send(self.data["cancelfavor"])
# 更新日记本
def diary_operation(self, diary_id, title, operation_timestamp, doctor_name, hospital_name):
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 diary_data(self, current_city_id, diary_referrer, sort, count , start_num):
self.params["current_city_id"] = current_city_id
self.params["diary_referrer"] = diary_referrer
self.params["sort"] = sort
self.params["count"] = count
self.params["start_num"] = start_num
return self.api_send(self.data["diary_data"])
# 日记本美购相关
def diary_service(self, diary_id, service_id):
self.params["diary_id"] = diary_id
self.params["service_id"] = service_id
return self.api_send(self.data["diary_service"])
# 日记更新
def diary_update(self, topic_list):
self.params["topic_list"] = topic_list
return self.api_send(self.data["update"])
#日记本收藏
isfavor:
method: post
url: /api/diary/favor/17586195
params:
data: {}
json: {}
isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
#日记本取消收藏
cancelfavor:
method: delete
url: /api/diary/favor/17586195
params:
data: {}
json: {}
isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
#
#日记本修改信息
operation:
method: post
url: /api/diary/additional_info/v2
params:
data:
diary_id: ${diary_id}
title: ${title}
operation_timestamp: ${operation_timestamp}
doctor_name: ${doctor_name}
hospital_name: ${hospital_name}
json: {}
isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
#查看日记修改信息页面
additional_info:
method: get
url: /api/diary/operation/17586198/
params:
data: {}
json: {}
isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
#详情页内容
diary_data:
method: get
url: /api/diary/topic/15261339/_data
params:
current_city_id: ${current_city_id}
diary_referrer: ${diary_referrer}
sort: ${sort}
count: ${count}
start_num: ${start_num}
data:
json: {}
#美购相关
diary_service:
method: get
url: /api/diary/services
params:
diary_id: ${diary_id}
service_id: ${service_id}
data:
json: {}
#更新日记本的修改信息
update:
method: post
url: /api/diary/update_v2/17586198
params:
data:
topic_list: ${topic_list}
json: {}
isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
import path_setting
from in_common.base_request import BaseRequest
class doctor_request(BaseRequest):
def __init__(self):
self.data = self.api_load(path_setting.DOCTOR_ARTICLE_CONFIG)
#医生/医院主页-医生说/医院说列表
def article(self, doctor_id):
self.params["doctor_id"] = doctor_id
return self.api_send(self.data["article"])
#医生主页详情
def detail(self):
return self.api_send(self.data["detail"])
#医生主页案例列表
def diary(self, doctor_id):
self.params["doctor_id"] = doctor_id
return self.api_send(self.data["diary"])
if __name__ == '__main__':
#打印医生/医院主页-医生说/医院说列表接口返回
print(doctor_request().article("9918ad7eb8f511e58f8200163e000a4a"))
#打印医生主页详情接口返回
print(doctor_request.detail())
#打印医生主页案例列表接口返回
print(doctor_request.diary("5bd9f05cad51403d853ba8c881989e23"))
\ No newline at end of file
#医生/医院主页——医生说/医院说
article:
method: get
url: /api/doctor/article
params:
doctor_id: ${doctor_id}
count: 10
page: 1
own_page: 0
doctor_type: 0
data: {}
json: {}
#医生主页详情
detail:
method: get
url: /api/doctor/5bd9f05cad51403d853ba8c881989e23/detail
params: {}
data: {}
json: {}
#医生主页案例列表
diary:
method: get
url: /api/doctor/diary
params:
doctor_id: ${doctor_id}
count: 4
page: 1
data: {}
json: {}
\ No newline at end of file
import path_setting
from in_common.base_request import BaseRequest
class doctor_v2_request(BaseRequest):
def __init__(self):
self.data = self.api_load(path_setting.DOCTOR_V2_CONFIG)
#医生主页商品列表
def services(self):
return self.api_send(self.data["services"])
if __name__ == '__main__':
#打印医生主页商品列表接口返回
print(doctor_v2_request().services())
\ No newline at end of file
#医生主页商品列表
services:
method: get
url: /api/doctor_v2/5bd9f05cad51403d853ba8c881989e23/services
params:
offset: 0
show_tag_distro: 1
tag_id: all
size: 10
data: {}
json: {}
\ No newline at end of file
import path_setting
from in_common.base_request import BaseRequest
class eyelids_request(BaseRequest):
def __init__(self):
self.data = self.api_load(path_setting.EYELIDS_DIARY_CARDS_CONFIG)
# 模拟整形,双眼皮,发型,美瞳,眉毛推荐日记
def diary_cards(self,current_city_id,page,page_size,tag_names):
self.params["current_city_id"] = current_city_id
self.params["page"] = page
self.params["page_size"] = page_size
self.params["tag_names"] = tag_names
return self.api_send(self.data["diary_cards"])
if __name__ == '__main__':
tag_names = '["埋线双眼皮","定点双眼皮","切开双眼皮"]'
print(eyelids_request().diary_cards("beijing","1","10",tag_names))
\ No newline at end of file
diary_cards:
method: get
url: /api/eyelids/diary_cards
params:
current_city_id: ${current_city_id}
page: ${page}
page_size: ${page_size}
tag_names: ${tag_names}
import path_setting
from in_common.base_request import BaseRequest
class face_request(BaseRequest):
def __init__(self):
self.data = self.api_load(path_setting.FACE_DIARY_CARDS_CONFIG)
# 根据多个标签推荐日记
def diarys_cards(self,facial_type2tag_names):
self.params["facial_type2tag_names"] = facial_type2tag_names
return self.api_send(self.data["face_diarys"])
# 3D 底部feed流
def plastic_feeds(self, tag_id, face_id, tag_id_list, page_size, version):
self.params["tag_id"] = tag_id
self.params["face_id"] = face_id
self.params["tag_id_list"] = tag_id_list
self.params["page_size"] = page_size
self.params["version"] = version
return self.api_send(self.data["plastic_feeds"])
if __name__ == '__main__':
# facial_type2tag_names = '{"2":["玻尿酸垫下巴","自体脂肪垫下巴"],"3":["半永久纹眉","植眉"]}'
# print(face_request().diarys_cards(facial_type2tag_names))
print(face_request().plastic_feeds('2371,2372,2247,3032,2274,2277,2242,2348,2597,2318,2551,2341,2389', 9,
'[[845, 498, 497, 494], [880, 484, 3254], [276], [1070, 373, 372, 350], [494, 315], [1293, 1050], [284, 282], [254, 251], [1000, 494, 312], [295, 272, 253], [1376, 1365, 1088, 892, 395, 385], [427, 327], [3214, 1377, 1306, 1051, 327, 229]]', 10, "7.44.0"))
\ No newline at end of file
face_diarys:
method: get
url: /api/face/diary/cards
params:
facial_type2tag_names: ${facial_type2tag_names}
plastic_feeds:
method: get
url: /api/face/plastic/feeds
params:
tag_id: ${tag_id}
face_id: ${face_id}
tag_id_list: ${tag_id_list}
page_size: ${page_size}
version: ${version}
\ No newline at end of file
import path_setting
from in_common.base_request import BaseRequest
class feed_request(BaseRequest):
def __init__(self):
self.data = self.api_load(path_setting.FEED_INDEXV9_CONFIG)
self.data = self.api_load(path_setting.CONFIG_LIST_CONFIG)
self.data = self.api_load(path_setting.COMMUNITY_CONFIG)
self.data = self.api_load(path_setting.FREE_RECRUIT_BANNER_CONFIG)
def index_v9(self,tabtype,version,current_city_id):
self.params["tabtype"] = tabtype
self.params["version"] = version
self.params["current_city_id"] = current_city_id
return self.api_send(self.data["index_v9"])
#社区tab页签到和招募活动列表
def config_list(self,version):
self.params["version"] = version
return self.api_send(self.data["config_list"])
# 社区tab页feed流
def community(self, version, tabtype, tags_id, tab_id):
self.params["version"] = version
self.params["tabtype"] = tabtype
self.params["tags_id"] = tags_id
self.params["tab_id"] = tab_id
return self.api_send(self.data["community"])
# 免费招募列表的背景图片
def free_recruit_banner(self, version, json):
self.params["version"] = version
self.params["json"] = json
return self.api_send(self.data["free_recruit_banner"])
# 免费招募列表
def free_recruit_list(self, version, json, tab_type, page, size):
self.params["version"] = version
self.params["json"] = json
self.params["tab_type"] = tab_type
self.params["page"] = page
self.params["size"] = size
return self.api_send(self.data["free_recruit_list"])
if __name__ == '__main__':
print(feed_request().index_v9("choice", "7.42.2", "beijing"))
#社区tab页签到和招募活动列表
print(feed_request().config_list("7.44.0"))
#免费招募列表背景图片
print(feed_request().free_recruit_banner("7.44.1", " "))
# 免费招募列表
print(feed_request().free_recruit_list("7.44.1", " ", "1", "1", "10"))
\ No newline at end of file
index_v9:
method: get
url: /api/feed/index/v9
params:
tabtype: ${tabtype}
version: ${version}
current_city_id: ${current_city_id}
data:
json: {}
isLogin: 1
#社区tab签到和招募活动列表
config_list:
method: get
url: /api/feed/community_activity/config_list
params:
version: ${version}
data:
json: {}
isLogin: 1
#社区tab页feed流
community:
method: get
url: /api/feed/index/community
params:
version: ${version}
tabtype: choice
tags_id: []
tab_id: 0
data:
json: {}
isLogin: 1
#招募活动列表背景图片
free_recruit_banner:
method: get
url: /api/feed/free_recruit/free_recruit_banner
params:
version: ${version}
json: ${json}
data:
json: { }
isLogin: 1
#招募活动列表
free_recruit_list:
method: get
url: /api/feed/free_recruit/list
params:
version: ${version}
json: ${json}
tab_type: ${tab_type}
page: ${page}
size: ${size}
data:
json: { }
isLogin: 1
\ No newline at end of file
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 gmai_request(BaseRequest):
def __init__(self):
self.data = self.api_load(path_setting.GMAI_SKIN_NEWREPORT_CONFIG)
# 测颜值结果页
def skin_newReport(self,version,image_url):
self.params["version"] = version
self.params["image_url"] = image_url
return self.api_send(self.data["skin_newReport"])
# 模拟双眼皮
def eyelids_plastic(self,version,image_url,style_id):
self.params["version"] = version
self.params["image_url"] = image_url
self.params["style_id"] = style_id
return self.api_send(self.data["eyelids_plastic"])
# 模拟发型,眉毛,美瞳效果
def simulate_analyze(self,device_id,image_url,style_id,type_id):
self.params["device_id"] = device_id
self.params["image_url"] = image_url
self.params["style_id"] = style_id
self.params["type_id"] = type_id
return self.api_send(self.data["simulate_analyze"])
# AI测颜值及对应评价内容
def plastic_analysis_v3(self,device_id,image_url,landmark,cheek_style_classify_id):
self.params["device_id"] = device_id
self.params["image_url"] = image_url
self.params["landmark"] = landmark
self.params["cheek_style_classify_id"] = cheek_style_classify_id
return self.api_send(self.data["analysis_v3"])
# 获取模拟配置文件(发型,美瞳,眉毛,双眼皮)
def simulate_conf(self,type_id):
self.params["type_id"] = type_id
return self.api_send(self.data["simulate_conf"])
# 3D整形获取风格脸信息,并且对应的评价内容
def plastic_analystic_v2(self,device_id,image_url,landmark,cheek_style_classify_id):
self.params["device_id"] = device_id
self.params["image_url"] = image_url
self.params["landmark"] = landmark
self.params["cheek_style_classify_id"] = cheek_style_classify_id
return self.api_send(self.data["plastic_analystic_v2"])
# 获取3D变脸风格参数
def plastic_cheek_style_classify(self,version):
self.params["version"] = version
return self.api_send(self.data["plastic_cheek_style_classify"])
# 验证用户之前是否使用过测肤质,绑定用户
def skin_user_had_test(self,device_id):
self.params["device_id"] = device_id
return self.api_send(self.data["skin_user_had_test"])
if __name__ == '__main__':
print(gmai_request().skin_user_had_test("androidid_7255c3398845cdd5"))
# print(gmai_request().plastic_cheek_style_classify("7.44.0"))
# landmark = '[{"x":168.96603,"y":496.76886},{"x":168.35735,"y":527.7101},{"x":169.548,"y":558.3961},{"x":171.72018,"y":588.8369},{"x":174.93307,"y":619.26794},{"x":179.31195,"y":649.03467},{"x":184.17123,"y":678.6978},{"x":191.05627,"y":707.8003},{"x":200.86497,"y":735.76196},{"x":214.62796,"y":761.79736},{"x":231.40042,"y":785.7622},{"x":250.59685,"y":807.22406},{"x":272.07196,"y":826.8049},{"x":295.4251,"y":843.86194},{"x":321.47278,"y":856.83124},{"x":349.9967,"y":864.5885},{"x":379.85767,"y":866.998},{"x":409.25287,"y":865.863},{"x":437.7829,"y":859.18054},{"x":463.35132,"y":846.88574},{"x":486.354,"y":830.38916},{"x":507.7304,"y":811.95135},{"x":527.778,"y":791.59247},{"x":545.7143,"y":769.32104},{"x":561.4353,"y":745.4949},{"x":573.70917,"y":719.9794},{"x":583.3716,"y":690.47156},{"x":591.3898,"y":660.6565},{"x":598.52515,"y":631.38513},{"x":604.5137,"y":601.75684},{"x":609.14844,"y":572.0621},{"x":612.0713,"y":541.85956},{"x":613.5779,"y":511.5329},{"x":203.42625,"y":444.83066},{"x":229.21182,"y":410.30188},{"x":270.9198,"y":399.64984},{"x":313.56497,"y":407.32513},{"x":354.0185,"y":422.54175},{"x":441.31384,"y":427.71216},{"x":482.0569,"y":416.21152},{"x":524.1508,"y":412.38593},{"x":563.6658,"y":426.22824},{"x":585.87964,"y":462.41913},{"x":394.46844,"y":504.41254},{"x":393.96762,"y":546.5007},{"x":393.30322,"y":588.8532},{"x":392.592,"y":631.0979},{"x":342.77267,"y":664.1739},{"x":364.95947,"y":668.7595},{"x":390.1893,"y":673.2006},{"x":415.25336,"y":670.5106},{"x":436.7552,"y":666.998},{"x":242.81853,"y":506.60803},{"x":262.98138,"y":497.55713},{"x":305.08954,"y":499.77777},{"x":321.22906,"y":513.3391},{"x":301.56146,"y":521.4862},{"x":260.00668,"y":519.3686},{"x":462.97388,"y":517.84485},{"x":480.18396,"y":505.8437},{"x":522.09973,"y":506.45386},{"x":540.26013,"y":517.4052},{"x":523.0011,"y":528.3126},{"x":482.06146,"y":527.1489},{"x":239.75659,"y":436.6534},{"x":277.67075,"y":433.85788},{"x":315.04602,"y":438.8376},{"x":351.56638,"y":447.66888},{"x":441.58453,"y":452.58017},{"x":477.96664,"y":447.28973},{"x":515.05225,"y":445.83618},{"x":551.5746,"y":451.62656},{"x":284.38373,"y":496.0074},{"x":280.49805,"y":523.8891},{"x":284.44955,"y":508.43988},{"x":501.19617,"y":503.6411},{"x":502.51047,"y":530.9885},{"x":501.47836,"y":515.5879},{"x":357.51913,"y":508.84628},{"x":428.91504,"y":511.1767},{"x":341.02893,"y":607.7458},{"x":442.021,"y":610.8187},{"x":324.796,"y":641.13324},{"x":456.35925,"y":645.5844},{"x":304.6747,"y":728.90186},{"x":334.5838,"y":715.599},{"x":369.0162,"y":710.4512},{"x":390.31683,"y":714.9321},{"x":411.64032,"y":711.3696},{"x":445.83594,"y":718.7887},{"x":474.80075,"y":735.1745},{"x":451.05292,"y":753.0734},{"x":421.3767,"y":761.7219},{"x":390.41638,"y":763.2075},{"x":358.4326,"y":759.44385},{"x":328.53287,"y":748.5295},{"x":311.38818,"y":729.83777},{"x":350.23193,"y":734.1919},{"x":390.38123,"y":737.72284},{"x":429.7071,"y":736.18054},{"x":468.49692,"y":735.4535},{"x":430.71494,"y":739.61053},{"x":391.11005,"y":741.01697},{"x":349.98578,"y":737.08875},{"x":284.5382,"y":508.54742},{"x":501.50644,"y":515.53107}]'
# print(gmai_request().plastic_analystic_v2("869412032478155", "2021/06/01/1524/8a28dd0a3b8e",landmark,1))
# print(gmai_request().simulate_conf("-1"))
# print(gmai_request().simulate_analyze("869412032478155","2021/06/02/1456/68c702f50309","3","7"))
# landmark = '[{"x":248.60858,"y":454.0434},{"x":247.92863,"y":476.7021},{"x":248.8779,"y":499.36874},{"x":251.12755,"y":521.8638},{"x":254.58401,"y":544.24164},{"x":259.10333,"y":566.1669},{"x":264.02515,"y":588.0588},{"x":270.59506,"y":609.44214},{"x":279.6361,"y":629.6998},{"x":291.60773,"y":648.29407},{"x":305.6806,"y":665.26465},{"x":321.33615,"y":680.4736},{"x":338.2943,"y":694.64526},{"x":356.13144,"y":707.5386},{"x":375.71283,"y":717.8617},{"x":397.27545,"y":724.19965},{"x":419.9613,"y":726.1914},{"x":441.62817,"y":725.2733},{"x":462.6242,"y":719.917},{"x":481.41635,"y":710.3818},{"x":498.45187,"y":697.98035},{"x":514.59436,"y":684.40234},{"x":529.7782,"y":669.4685},{"x":543.08704,"y":653.1195},{"x":554.60706,"y":635.73456},{"x":563.3266,"y":617.3142},{"x":570.0075,"y":596.0911},{"x":575.7123,"y":574.78046},{"x":581.05774,"y":554.0385},{"x":585.48157,"y":533.1105},{"x":588.66907,"y":512.06683},{"x":590.4706,"y":490.68823},{"x":591.2653,"y":469.50403},{"x":279.37485,"y":410.2143},{"x":299.98352,"y":383.6742},{"x":331.64465,"y":375.0197},{"x":364.35858,"y":381.4741},{"x":395.4406,"y":394.20447},{"x":466.45248,"y":397.95},{"x":496.4015,"y":389.2094},{"x":527.33295,"y":386.7473},{"x":555.7313,"y":398.20285},{"x":571.48254,"y":425.62354},{"x":427.4568,"y":456.95285},{"x":426.77496,"y":483.84033},{"x":426.04883,"y":510.83325},{"x":425.32236,"y":537.75256},{"x":385.83856,"y":572.9858},{"x":403.71045,"y":573.0551},{"x":423.23145,"y":574.53534},{"x":442.28857,"y":574.4508},{"x":459.13876,"y":574.9396},{"x":307.80756,"y":458.6329},{"x":323.8154,"y":450.41855},{"x":359.07312,"y":453.8022},{"x":371.75238,"y":466.2728},{"x":355.36838,"y":470.9956},{"x":321.71375,"y":468.2021},{"x":479.14362,"y":470.68353},{"x":492.57837,"y":459.77023},{"x":526.78955,"y":459.34094},{"x":540.76917,"y":469.22626},{"x":526.91675,"y":477.2774},{"x":494.3828,"y":476.6469},{"x":307.39963,"y":402.42038},{"x":336.54358,"y":400.2494},{"x":365.31128,"y":405.05597},{"x":393.4093,"y":412.95276},{"x":466.55408,"y":416.23398},{"x":493.2259,"y":412.04782},{"x":520.28235,"y":410.81372},{"x":546.7446,"y":415.7663},{"x":341.78073,"y":449.21838},{"x":338.20166,"y":471.98853},{"x":342.39044,"y":460.15692},{"x":509.66327,"y":456.7909},{"x":510.57373,"y":479.22314},{"x":508.77704,"y":467.26038},{"x":399.44565,"y":461.61548},{"x":453.4572,"y":463.86423},{"x":384.4139,"y":527.5456},{"x":463.68613,"y":530.3157},{"x":369.6485,"y":554.5674},{"x":475.98178,"y":558.04224},{"x":358.72372,"y":632.25916},{"x":379.92645,"y":612.99927},{"x":406.5278,"y":600.8932},{"x":422.78525,"y":604.4064},{"x":439.0467,"y":601.5054},{"x":463.0918,"y":613.59924},{"x":480.34888,"y":633.28406},{"x":463.28207,"y":645.23676},{"x":442.62195,"y":651.3627},{"x":420.9704,"y":652.71295},{"x":398.036,"y":651.2082},{"x":376.4565,"y":644.82745},{"x":363.59555,"y":631.5963},{"x":392.39032,"y":626.09314},{"x":422.20786,"y":626.16754},{"x":449.31833,"y":626.3133},{"x":475.72333,"y":632.3503},{"x":448.87988,"y":625.9888},{"x":421.7511,"y":626.1827},{"x":392.28534,"y":625.9193},{"x":342.4176,"y":460.03064},{"x":508.8405,"y":467.07236}]'
# 测颜值和 上次结果
# print(gmai_request().plastic_analysis_v3("869412032478155", "2021/06/01/1524/8a28dd0a3b8e",landmark,1))
# print(gmai_request().plastic_analysis_v3("869412032478155", "", "", 1))
# print(gmai_request().skin_newReport("7.43.0","https://pic.igengmei.com/2021/05/11/1440/25e4bf45673f-s"))
# print(gmai_request().eyelids_plastic("7.43.0", "2021/05/12/1457/cdbe8652117d","3"))
skin_newReport:
method: post
url: /gm_ai/skin/new_report
params:
version: ${version}
data:
image_url: ${image_url}
eyelids_plastic:
method: post
url: /gm_ai/eyelids/plastic
params:
version: ${version}
data:
image_url: ${image_url}
style_id: ${style_id}
analysis_v3:
method: post
url: /gm_ai/plastic/analysis_v3
params:
device_id: ${device_id}
data:
image_url: ${image_url}
landmark: ${landmark}
cheek_style_classify_id: ${cheek_style_classify_id}
simulate_analyze:
method: post
url: /gm_ai/simulate/analyze
params:
device_id: ${device_id}
data:
image_url: ${image_url}
style_id: ${style_id}
type_id: ${type_id}
simulate_conf:
method: get
url: /gm_ai/simulate/conf
params:
type_id: ${type_id}
plastic_analystic_v2:
method: post
url: /gm_ai/plastic/analysis_v2
params:
device_id: ${device_id}
data:
image_url: ${image_url}
landmark: ${landmark}
cheek_style_classify_id: ${cheek_style_classify_id}
plastic_cheek_style_classify:
method: get
url: /gm_ai/plastic/cheek_style_classify
params:
version: ${version}
skin_user_had_test:
method: get
url: /gm_ai/skin/user_had_test
params:
device_id: ${device_id}
isLogin: 1
\ No newline at end of file
import path_setting
from in_common.base_request import BaseRequest
class hospital_request(BaseRequest):
def __init__(self):
self.data = self.api_load(path_setting.HOSPITAL_DIARY_CONFIG)
#医院主页日记列表
def diary(self, hospital):
self.params["hospital"] = hospital
return self.api_send(self.data["diary"])
if __name__ == '__main__':
#打印医院主页日记列表接口返回
print(hospital_request().diary("bjxyjcpfbyy"))
\ No newline at end of file
#医院主页日记列表
diary:
method: get
url: /api/hospital/diary
params:
hospital: ${hospital}
count: 4
page: 1
own_page: 0
tag_id:
data: {}
json: {}
\ No newline at end of file
import path_setting
from in_common.base_request import BaseRequest
class hospitals_request(BaseRequest):
def __init__(self):
self.data = self.api_load(path_setting.HDYAML_CONFIG)
#医院主页详情
def detail(self):
return self.api_send(self.data["detail"])
#医院主页医生列表
def doctor(self):
return self.api_send(self.data["doctor"])
if __name__ == '__main__':
#打印医院主页详情接口返回
print(hospitals_request().detail())
#打印医院主页医生列表接口返回
print(hospitals_request().doctor())
\ No newline at end of file
#医院主页详情
detail:
method: get
url: /api/hospitals/bjxyjcpfbyy/detail
params: {}
data: {}
json: {}
#医院主页医生列表
doctor:
method: get
url: /api/hospitals/bjxyjcpfbyy/doctors
params:
related: 0
data: {}
json: {}
\ No newline at end of file
import path_setting
from in_common.base_request import BaseRequest
class hospitals_v2_request(BaseRequest):
def __init__(self):
self.data = self.api_load(path_setting.HOSPITAL_SERVICE_CONFIG)
#医院主页商品列表
def services(self):
return self.api_send(self.data["services"])
if __name__ == '__main__':
#打印医院主页商品列表接口返回
print(hospitals_v2_request().services())
\ No newline at end of file
#医院主页商品列表
services:
method: get
url: /api/hospitals_v2/bjxyjcpfbyy/services
params:
offset: 0
show_tag_distro: 1
tag_id: "all"
size: 10
data: {}
json: {}
\ No newline at end of file
import path_setting
from in_common.base_request import BaseRequest
class hybrid_api_topic_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)
#日记本列表--日记贴点赞
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 hybrid_diary_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"])
#查看日记本相册页面
album:
method: get
url: /hybrid/diary/album/17586198/_data
params:
data: {}
json: {}
isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
\ No newline at end of file
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
import path_setting
from in_common.base_request import BaseRequest
class hybrid_gift_list_request(BaseRequest):
def __init__(self):
self.data = self.api_load(path_setting.HYBRID_GIFT_LIST_CONFIG)
#商祥页-美券列表
def gift_list_data(self, service_id, gift_type, page):
self.params["service_id"] = service_id
self.params["gift_type"] = gift_type
self.params["page"] = page
return self.api_send(self.data["gift_list_data"])
if __name__ == '__main__':
#打印商祥页-美券列表接口返回
print(hybrid_gift_list_request().gift_list_data("5857263", 1, 1))
\ No newline at end of file
#商祥页-美券列表
gift_list_data:
method: get
url: /hybrid/gift_list/_data
params:
service_id: ${service_id}
gift_type: ${gift_type}
page: ${page}
data: {}
json: {}
isLogin: 1
\ No newline at end of file
import path_setting
from in_common.base_request import BaseRequest
class hybrid_promotion_request(BaseRequest):
def __init__(self):
self.data = self.api_load(path_setting.HYBRID_PROMOTION_CONFIG)
#商祥页-sku信息
def related_service_data(self, service_id, page):
self.params["service_id"] = service_id
self.params["page"] = page
return self.api_send(self.data["related_service_data"])
if __name__ == '__main__':
#打印商祥页-推荐商品列表接口返回
print(hybrid_promotion_request().related_service_data("5815040", 1))
#商祥页-推荐商品列表
related_service_data:
method: get
url: /hybrid/promotion/related_service/_data
params:
service_id: ${service_id}
page: ${page}
data: {}
json: {}
\ No newline at end of file
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'])
# 问答详情页问题详情
def question_v1(self):
return self.api_send(self.data['question_v1'])
# 问答详情页--回答列表
def question_new_answer_list(self, question_id):
self.params['question_id'] = question_id
return self.api_send(self.data['question_new_answer_list'])
if __name__ == '__main__':
# print(self.data)
# 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: {}
#问答详情页--问题详情
question_v1:
method: GET
url: /hybrid/question_v1/210502
params:
data: {}
json: {}
isLogin: 1
#问答详情页--回答列表
question_new_answer_list:
method: GET
url: /hybrid/question/new_answer_list/_data
params:
question_id: ${question_id}
data: {}
json: {}
isLogin: 1
import path_setting
from in_common.base_request import BaseRequest
class im_request(BaseRequest):
def __init__(self):
self.data = self.api_load(path_setting.CONVERSATION_DETAIL_CONFIG)
def conversation_detail(self, current_city_id, begin_msg_id, conversation_type, end_msg_id,referrer):
self.params["current_city_id"] = current_city_id
self.params["begin_msg_id"] = begin_msg_id
self.params["conversation_type"] = conversation_type
self.params["end_msg_id"] = end_msg_id
self.params["referrer"] = referrer
return self.api_send(self.data["conversation_detail"])
def auto_msg(self, trace_id, conversation_id):
self.params["trace_id"] = trace_id
self.params["conversation_id"] = conversation_id
return self.api_send(self.data["auto_msg"])
def send_msg(self, conversation_id, is_system, referrer, referrer_id, msg_type, content, extra):
self.params["conversation_id"] = conversation_id
self.params["is_system"] = is_system
self.params["referrer"] = referrer
self.params["referrer_id"] = referrer_id
self.params["msg_type"] = msg_type
self.params["content"] = content
self.params["extra"] = extra
return self.api_send(self.data["send_msg"])
if __name__ == '__main__':
print(im_request().conversation_detail("beijing", 0, 4, 0, "message_home"))
print("第二个接口")
print(im_request().auto_msg("2021/04/22/1722/70a1791606d5",368))
print("send_msg")
print(im_request().send_msg("368", 0, "message_home", "", 0, "您好,我想咨询一下", {}))
conversation_detail:
method: get
url: /api/im/conversation/detail
params:
current_city_id: ${current_city_id}
begin_msg_id: ${begin_msg_id}
conversation_type: ${conversation_type}
end_msg_id: ${begin_msg_id}
referrer: ${referrer}
data: {}
json: {}
isLogin: 1 #需要登录的接口
auto_msg:
method: post
url: /api/im/auto_msg
params:
trace_id: ${trace_id}
data:
conversation_id: ${conversation_id}
json: {}
isLogin: 1 #需要登录的接口
send_msg:
method: post
url: /api/im/send_msg
params: {}
data:
conversation_id: ${conversation_id}
is_system: ${is_system}
referrer: ${referrer}
referrer_id: ${referrer_id}
msg_type: ${msg_type}
content: ${content}
extra: ${extra}
json: {}
isLogin: 1 #需要登录的接口
\ No newline at end of file
import path_setting
from in_common.base_request import BaseRequest
class janus_request(BaseRequest):
def __init__(self):
#捜索结果页-综合/百科tab
self.data = self.api_load(path_setting.CONTENTV7_CONFIG)
#医院主页捜索
self.data = self.api_load(path_setting.HOSPITALSEARCH_CONFIG)
#品类聚合页面商品列表
self.data = self.api_load(path_setting.TAG_SERVICE_CONFIG)
#品类聚合页面标签和专场
self.data = self.api_load(path_setting.POLYMER_CONFIG)
#医生医院sug列表
self.data = self.api_load(path_setting.KEYWORDTIP_CONFIG)
#次卡商详页
self.data = self.api_load(path_setting.BEAUTY_CARD_DETAIL_CONFIG)
#直播-点击【设置封面】
self.data = self.api_load(path_setting.PAGE_RULES_CONFIG)
#搜索结果页-综合/百科tab
def content_v7(self, query, device_id, current_city_id, version, is_first, tab_type, offset):
#搜索词
self.params['query'] = query
#设备号
self.params['device_id'] = device_id
#当前城市
self.params['current_city_id'] = current_city_id
#APP版本
self.params['version'] = version
#是否为第一次请求
self.params['is_first'] = is_first
#类型
self.params['tab_type'] = tab_type
#请求的页数 0,10,20
self.params['offset'] = offset
return self.api_send(self.data['content_v7'])
#医院主页搜索
def hospital_search(self, query, device_id, hospital_id, current_city_id, version, offset, size):
#搜索词
self.params['query'] = query
#设备号
self.params['device_id'] = device_id
#医院id
self.params['hospital_id'] = hospital_id
#当前城市
self.params['current_city_id'] = current_city_id
#APP版本
self.params['version'] = version
#请求的页数 0,10,20
self.params['offset'] = offset
# 单页请求数量
self.params['size'] = size
return self.api_send(self.data['hospital_search'])
#购物车-猜你喜欢列表
def mine_guess_you_like(self):
return self.api_send(self.data["mine_guess_you_like"])
#商祥页-详情
def product_detail(self, service_id, service_item_id, version):
self.params["service_id"] = service_id
self.params["service_item_id"] = service_item_id
self.params["version"] = version
return self.api_send(self.data["product_detail"])
#商祥页-sku信息
def sku_info(self, service_id, service_item_id):
self.params["service_id"] = service_id
self.params["service_item_id"] = service_item_id
return self.api_send(self.data["sku_info"])
#商祥页-美券列表-我的美券点击-744版本及以后-新接口
def product_coupon_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["product_coupon_my_list"])
# 品类聚合页面商品列表
def tag_service(self, size, tag_ids, offset, tag_id, version, device_id):
print("fgx")
self.params['size'] = size
self.params['tag_ids'] = tag_ids
self.params['offset'] = offset
self.params['tag_id'] = tag_id
self.params['version'] = version
self.params['device_id'] = device_id
return self.api_send(self.data["tag_service"])
# 品类聚合页面标签和专场
def polymer(self, version, category_polymer_id, device_id):
self.params['version'] = version
self.params['category_polymer_id'] = category_polymer_id
self.params['device_id'] = device_id
return self.api_send(self.data["polymer"])
#医生医院sug列表
def keyword_tip(self, query, lat, lng, version, device_id = '97B6764B-2135-4761-9911-701C38CBC272', tab_type = '0'):
self.params['query'] = query
self.params['lat'] = lat
self.params['lng'] = lng
self.params['version'] = version
return self.api_send(self.data['keyword_tip'])
#次卡-确认订单
def beauty_card_order_confirm(self, sku_id, number, use_bc_coupon, bc_coupon_id):
self.params["sku_id"] = sku_id
self.params["number"] = number
self.params["use_bc_coupon"] = use_bc_coupon
self.params["bc_coupon_id"] = bc_coupon_id
return self.api_send(self.data["beauty_card_order_confirm"])
#次卡-确认订单页面-修改手机号
def beauty_card_update_phone(self, authorize_phone, authorize_phone_type, vfc_code):
self.params["authorize_phone"] = authorize_phone
self.params["authorize_phone_type"] = authorize_phone_type
self.params["vfc_code"] = vfc_code
return self.api_send(self.data["beauty_card_update_phone"])
#次卡-提交订单
def beauty_card_order_submit(self, phone, sku_id, number, is_doctor_see, gain_coupon_id, deduction_price):
self.params["phone"] = phone
self.params["sku_id"] = sku_id
self.params["number"] = number
self.params["is_doctor_see"] = is_doctor_see
self.params["gain_coupon_id"] = gain_coupon_id
self.params["deduction_price"] = deduction_price
return self.api_send(self.data["beauty_card_order_submit"])
#次卡-支付平台
def beauty_card_payment_method(self, payment_id):
self.params["payment_id"] = payment_id
return self.api_send(self.data["beauty_card_payment_method"])
#次卡-微信支付
def beauty_card_prepay_wechat(self, payment_id):
self.params["payment_id"] = payment_id
return self.api_send(self.data["beauty_card_prepay_wechat"])
#次卡-支付宝支付
def beauty_card_prepay_alipay(self, is_huabei, payment_id):
self.params["is_huabei"] = is_huabei
self.params["payment_id"] = payment_id
return self.api_send(self.data["beauty_card_prepay_alipay"])
#次卡-订单详情
def beauty_card_payment_detail(self, payment_id):
self.params["payment_id"] = payment_id
return self.api_send(self.data["beauty_card_payment_detail"])
#次卡-取消订单
def beauty_card_payment_delete(self, payment_id):
self.params["payment_id"] = payment_id
return self.api_send(self.data["beauty_card_payment_delete"])
#次卡-申请退款
def beauty_card_refund_info(self, order_id):
self.params["order_id"] = order_id
return self.api_send(self.data["beauty_card_refund_info"])
#次卡-提交退款申请
def beauty_card_refund_submit(self, order_id, reason_id, reason_text, reason_type):
self.params["order_id"] = order_id
self.params["reason_id"] = reason_id
self.params["reason_text"] = reason_text
self.params["reason_type"] = reason_type
return self.api_send(self.data["beauty_card_refund_submit"])
# 新版本我的美券列表
def product_my_list(self,start_num,tab_id):
self.params['start_num'] = start_num
self.params['tab_id'] = tab_id
return self.api_send(self.data['coupon_my_list'])
# 次卡订单详情页(未使用 和 部分使用 和 已使用)
def beauty_card_order_detail(self,order_id):
self.params['order_id'] = order_id
return self.api_send(self.data['beauty_card_order_detail'])
# 次卡商详页
def beauty_card_detail(self, spu_id, sku_id, welfareId, version, current_city_id, lat, lng ):
self.params['spu_id'] = spu_id
self.params['sku_id'] = sku_id
self.params['welfareId'] = welfareId
self.params['version'] = version
self.params['current_city_id'] = current_city_id
self.params['lat'] = lat
self.params['lng'] = lng
return self.api_send(self.data["beauty_card_detail"])
# 次卡商详-适应机构列表
def service_hospital(self, offset, sku_id, size, version, current_city_id, lat, lng):
self.params['offset'] = offset
self.params['sku_id'] = sku_id
self.params['size'] = size
self.params['version'] = version
self.params['current_city_id'] = current_city_id
self.params['lat'] = lat
self.params['lng'] = lng
return self.api_send(self.data["service_hospital"])
# 直播-点击【设置封面】
def page_rules(self, version, current_city_id, page_name, device_id = '97B6764B-2135-4761-9911-701C38CBC272'):
self.params['version'] = version
self.params['current_city_id'] = current_city_id
self.params['page_name'] = page_name
return self.api_send(self.data["page_rules"])
if __name__ == '__main__':
# #打印购物车-猜你喜欢列表接口返回
# print(janus_request().mine_guess_you_like())
# #打印商祥页-详情接口返回
# print(janus_request().product_detail("5857263", "618788", "7.43.0"))
# #打印商祥页-sku信息接口返回
# print(janus_request().sku_info("5857263", "618788"))
# #打印商祥页-美券列表-我的美券点击-744版本及以后-新接口返回
# print(janus_request().product_coupon_my_list(0, 0))
#
# #品类聚合页面商品列表接口返回
# print(janus_request().tag_service())
# print("fgx")
#
# #品类聚合页面标签和专场
# print(janus_request().polymer())
# print("fgx")
#
# #打印次卡-确认订单接口返回
# print(janus_request().beauty_card_order_confirm("10176", 1, 1, 0))
# #打印次卡-确认订单页面-修改手机号接口返回
# print(janus_request().beauty_card_update_phone("+8612348543876", 1, "084430"))
# #打印次卡-提交订单接口返回
# print(janus_request().beauty_card_order_submit("12345678912", "10176", 1, 1, 0, 0))
# #打印次卡-支付平台接口返回
# print(janus_request().beauty_card_payment_method("101670448736595"))
#
# print(janus_request().product_my_list(0, 0))
# # 次卡商详页-适应机构
# print(janus_request().beauty_card_detail("100018", "10046", "100018", "7.44.0", "beijing", "40.001879", "116.487194"))
# # 次卡商详页
# print(janus_request().service_hospital("0", "10046", "1", "7.44.0", "beijing", "40.001879", "116.487194"))
# #打印购物车-猜你喜欢列表接口返回
# print(janus_request().mine_guess_you_like())
# #打印商祥页-详情接口返回
# print(janus_request().product_detail("5857263", "618788", "7.43.0"))
# #打印商祥页-sku信息接口返回
# print(janus_request().sku_info("5857263", "618788"))
# #打印商祥页-美券列表-我的美券点击-744版本及以后-新接口返回
# print(janus_request().product_coupon_my_list(0, 0))
#
# #品类聚合页面商品列表接口返回
# print(janus_request().tag_service())
# print("fgx")
#
# #品类聚合页面标签和专场
# print(janus_request().polymer())
# print("fgx")
#
# #打印次卡-确认订单接口返回
# print(janus_request().beauty_card_order_confirm("10176", 1, 1, 0))
# #打印次卡-确认订单页面-修改手机号接口返回
# print(janus_request().beauty_card_update_phone("+8612348543876", 1, "084430"))
# #打印次卡-提交订单接口返回
# print(janus_request().beauty_card_order_submit("12345678912", "10176", 1, 1, 0, 0))
# #打印次卡-支付平台接口返回
# print(janus_request().beauty_card_payment_method("101670448736595"))
# #打印次卡-微信支付接口返回
# print(janus_request().beauty_card_prepay_wechat("101353630959868"))
# # 打印次卡-支付宝支付接口返回
# print(janus_request().beauty_card_prepay_alipay(0, "101353630959868"))
# #打印次卡 - 订单详情接口返回
# print(janus_request().beauty_card_payment_detail("101353630959868"))
# #打印次卡 - 取消订单接口返回
# print(janus_request().beauty_card_payment_delete("101353630959868"))
# #打印次卡-申请退款接口返回
# print(janus_request().beauty_card_refund_info("102217820485006"))
# #打印次卡-提交退款申请接口返回
# print(janus_request().beauty_card_refund_submit("102813852173916", 3, "个人身体原因", 0))
# print(janus_request().beauty_card_order_detail(102247770691611))
# print(janus_request().product_my_list(0, 0))
#直播-点击【设置封面】
print("直播-点击【设置封面】")
print(janus_request().page_rules("744.2", "beijing", "post_add_pic"))
content_v7:
method : get
url : /api/janus/search/v7/content
params :
query: ${query}
device_id: ${device_id}
current_city_id: ${current_city_id}
version: ${version}
is_first: ${is_first}
tab_type: ${tab_type}
offset: ${offset}
data: {}
json: {}
hospital_search:
method: get
url: /api/janus/search/hospital_search
params:
query: ${query}
device_id: ${device_id}
hospital_id: ${hospital_id}
current_city_id: ${current_city_id}
version: ${version}
offset: ${offset}
size : ${size}
data: { }
json: { }
#购物车-猜你喜欢
mine_guess_you_like:
method: get
url: /api/janus/product/mine_guess_you_like
params: {}
data: {}
json: {}
isLogin: 1
#商祥页-详情
product_detail:
method: get
url: /api/janus/product/detail
params:
service_id: ${service_id}
service_item_id: ${service_item_id}
version: ${version}
data: {}
json: {}
#商祥页-sku信息
sku_info:
method: get
url: /api/janus/product/detail/sku_info
params:
service_id: ${service_id}
service_item_id: ${service_item_id}
data: {}
json: {}
#商祥页-美券列表-我的美券点击-744版本及以后-新接口
product_coupon_my_list:
method: get
url: /api/janus/product/coupon/my_list
params:
start_num: ${start_num}
tab_id: ${tab_id}
data: {}
json: {}
isLogin: 1
#品类聚合页面商品列表的
tag_service:
method: GET
url: /api/janus/product/tag_service
params:
size: ${size}
tag_ids: ${tag_ids}
offset: ${offset}
tag_id: ${tag_id}
version: ${version}
device_id: ${device_id}
data: { }
json: { }
#品类聚合页标签和专场
polymer:
method: GET
url: /api/janus/product/polymer
params:
version: ${version}
category_polymer_id: ${category_polymer_id}
device_id: ${device_id}
data: { }
json: { }
#医生医院sug列表
keyword_tip:
method: GET
url: /api/janus/search/keyword/tip
params:
query: ${query}
lat: ${lat}
lng: ${lng}
version: ${version}
data: {}
json: {}
#次卡-确认订单
beauty_card_order_confirm:
method: post
url: /api/janus/beauty_card/order/confirm
params: {}
data:
sku_id: ${sku_id}
number: ${number}
bctraceid: ""
use_bc_coupon: ${use_bc_coupon}
bc_coupon_id: ${bc_coupon_id}
json: {}
isLogin: 1
#次卡-确认订单页面-修改手机号
beauty_card_update_phone:
method: post
url: /api/janus/beauty_card/update_phone
params: {}
data:
authorize_phone: ${authorize_phone}
authorize_phone_type: ${authorize_phone_type}
vfc_code: ${vfc_code}
json: {}
isLogin: 1
#次卡商详页
beauty_card_detail:
method: GET
url: /api/janus/beauty_card/detail
params:
spu_id: ${spu_id}
sku_id: ${sku_id}
welfareId: ${welfareId}
version: ${version}
current_city_id: ${current_city_id}
lat: ${lat}
lng: ${lng}
data: { }
json: { }
#次卡商详页-适应机构列表
service_hospital:
method: GET
url: /api/janus/beauty_card/service_hospital
params:
offset: ${offset}
sku_id: ${sku_id}
size: ${size}
version: ${version}
current_city_id: ${current_city_id}
lat: ${lat}
lng: ${lng}
data: { }
json: { }
#次卡-提交订单
beauty_card_order_submit:
method: post
url: /api/janus/beauty_card/order/submit
params: {}
data:
phone: ${phone}
sku_id: ${sku_id}
number: ${number}
is_doctor_see: ${is_doctor_see}
gain_coupon_id: ${gain_coupon_id}
deduction_price: ${deduction_price}
json: {}
isLogin: 1
#次卡-支付平台
beauty_card_payment_method:
method: get
url: /api/janus/beauty_card/payment_method
params:
payment_id: ${payment_id}
data: {}
json: {}
isLogin: 1
#次卡-微信支付
beauty_card_prepay_wechat:
method: post
url: /api/janus/beauty_card/prepay/wechat
params: {}
data:
payment_id: ${payment_id}
json: {}
isLogin: 1
#次卡-支付宝支付
beauty_card_prepay_alipay:
method: post
url: /api/janus/beauty_card/prepay/alipay
params: {}
data:
is_huabei: ${is_huabei}
payment_id: ${payment_id}
json: {}
isLogin: 1
##次卡-支付宝支付-花呗分期
#beauty_card_prepay_alipay_huabei:
# method: post
# url: /api/janus/beauty_card/prepay/alipay
# params: {}
# data:
# huabei_period: ${huabei_period}
# is_huabei: ${is_huabei}
# payment_id: ${payment_id}
# json: {}
# isLogin: 1
#次卡-订单详情
beauty_card_payment_detail:
method: get
url: /api/janus/beauty_card/payment/detail
params:
payment_id: ${payment_id}
data: {}
json: {}
isLogin: 1
#次卡-取消订单
beauty_card_payment_delete:
method: post
url: /api/janus/beauty_card/payment/delete
params: {}
data:
payment_id: ${payment_id}
json: {}
isLogin: 1
#次卡-申请退款
beauty_card_refund_info:
method: get
url: /api/janus/beauty_card/refund/info
params:
order_id: ${order_id}
data: {}
json: {}
isLogin: 1
#次卡-提交退款申请
beauty_card_refund_submit:
method: post
url: /api/janus/beauty_card/refund/submit
params: {}
data:
order_id: ${order_id}
reason_id: ${reason_id}
reason_text: ${reason_text}
reason_type: ${reason_type}
json: {}
isLogin: 1
#新版本我的美券
coupon_my_list:
method: get
url: /api/janus/product/coupon/my_list
params:
start_num: ${start_num}
tab_id: ${tab_id}
isLogin: 1
#次卡-订单详情(未使用 和 部分使用 和 已使用)
beauty_card_order_detail:
method: get
url: /api/janus/beauty_card/order/detail
params:
order_id: ${order_id}
data: {}
json: {}
isLogin: 1
#直播-点击【设置封面】
page_rules:
method: GET
url: /api/janus/sales_lead/page_rules
params:
version: ${version}
current_city_id: ${current_city_id}
page_name: ${page_name}
data: {}
json: {}
isLogin: 1
\ No newline at end of file
import path_setting
from in_common.base_request import BaseRequest
class living_request(BaseRequest):
def __init__(self):
self.data = self.api_load(path_setting.LIVEYAML_CONFIG)
#获取弹幕
def danmu_v2(self,channel_id,msg_id,user_id=""):
self.params["channel_id"] = channel_id
self.params["msg_id"] = msg_id
self.params["user_id"] = user_id
return self.api_send(self.data["danmu_v2"])
#主播开播
def pushlive_info(self,title,cover_url,notice,tag_id,clarity,device_type):
self.params["title"] = title
self.params["cover_url"] = cover_url
self.params["notice"] = notice
self.params["tag_id"] = tag_id
self.params["clarity"] = clarity
self.params["device_type"] = device_type
return self.api_send(self.data["pushlive_info"])
if __name__ == '__main__':
(living_request().danmu_v2("739", "1"))
(living_request().pushlive_info("小冤家", "2021/04/22/1003/cef471cff5e6", "", "1", "1", "1"))
\ No newline at end of file
#获取弹幕
danmu_v2:
method: get
url: /api/live/danmu_v2
params:
channel_id: ${channel_id}
msg_id: ${msg_id}
user_id: ${user_id}
data: {}
json: {}
#主播开播
pushlive_info:
method: get
url: /api/live/push_live_info
params:
title: ${title}
cover_url: ${cover_url}
notice: ${notice}
tag_id: ${tag_id}
clarity: ${clarity}
device_type: ${device_type}
data: {}
json: {}
isLogin: 1
import path_setting
from in_common.base_request import BaseRequest
class my_conversation_request(BaseRequest):
def __init__(self):
self.data = self.api_load(path_setting.MY_CONVERSATION_CONFIG)
def my_conversation(self,current_city_id,start_num,count,):
self.params["current_city_id"] = current_city_id
self.params["start_num"] = start_num
self.params["count"] = count
return self.api_send(self.data["my_conversation"])
if __name__ == '__main__':
print(my_conversation_request().my_conversation("beijing", "0", 10))
\ No newline at end of file
my_conversation:
method: get
url: /api/my_conversation/
params:
current_city_id: ${current_city_id}
start_num: ${start_num}
count: 10
data: {}
json: {}
isLogin: 1 #需要登录的接口
\ No newline at end of file
import path_setting
from in_common.base_request import BaseRequest
class notification_request(BaseRequest):
def __init__(self):
self.data = self.api_load(path_setting.UNREAD_CONFIG)
def unread(self,uqid,trace_id,):
self.params["uqid"] = uqid
self.params["trace_id"] = trace_id
return self.api_send(self.data["unread"])
def readall(self,uqid,trace_id,ua):
self.params["uqid"] = uqid
self.params["trace_id"] = trace_id
self.params["ua"] = ua
return self.api_send(self.data["readall"])
if __name__ == '__main__':
#print(notification_request().unread("1B519701-A4F5-453E-9D99-140B5AF697A0", "2021/04/22/1722/46cf97b999b0"))
print(notification_request().readall("1B519701-A4F5-453E-9D99-140B5AF697A0", "2021/05/19/1526/19fcd4c4be47","Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148"))
#未读消息数
unread:
method: get
url: /api/notification/unread
params:
uqid: ${uqid}
trace_id: ${trace_id}
data: {}
json: {}
isLogin: 1 #需要登录的接口
#标记为已读
readall:
method: post
url: /api/notification/readall
params:
uqid: ${uqid}
trace_id: ${trace_id}
ua: ${ua}
data: {}
json: {}
isLogin: 1 #需要登录的接口
\ No newline at end of file
import path_setting
from in_common.base_request import BaseRequest
class oneimage_request(BaseRequest):
def __init__(self):
self.data = self.api_load(path_setting.ONEIMAGE_SHARE_V4_CONFIG)
# 测颜值结果页
def share_v4(self,version,face_id):
self.params["version"] = version
self.params["face_id"] = face_id
return self.api_send(self.data["share_v4"])
# 测颜值结果页,根据五官推荐美购接口
def recomend_services(self,version,business_tags_names):
self.params["version"] = version
self.params["business_tags_names"] = business_tags_names
return self.api_send(self.data["recomend_services"])
if __name__ == '__main__':
print(oneimage_request().share_v4("7.42.2", "27320150"))
business_tags_names = '[[],[],["玻尿酸垫下巴","自体脂肪垫下巴","硅胶垫下巴","膨体垫下巴"],["半永久纹眉","植眉"],["玻尿酸丰唇","胶原蛋白填充丰唇","自体脂肪丰唇"],[],["开内眼角"],["射频提升","热拉提","热拉提plus","热玛吉","超声提升"],["热玛吉"],[],["注射瘦脸","激光溶脂瘦脸","取颊脂垫瘦脸","光纤溶脂瘦脸","下颌角整形"]]'
print(oneimage_request().recomend_services("7.42.2", business_tags_names))
\ No newline at end of file
#测肤结果页
share_v4:
method: post
url: /api/one_image/share/v4
params:
version: ${version}
data:
face_id: ${face_id}
json: {}
#测肤结果根据五官推荐美购
recomend_services:
method: get
url: /api/one_image/recomend/services
params:
version: ${version}
business_tags_names: ${business_tags_names}
json: {}
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"])
#我的订单-各状态订单数量
def my_status(self):
return self.api_send(self.data["my_status"])
if __name__ == '__main__':
print(orders_request().my_v2(0,1,"7.44.0"))
#打印我的订单-各状态订单数量接口返回
print(orders_request().my_status())
my_v2:
method: get
url: /api/orders/my/v2
params:
start_num: ${start_num}
status: ${status}
version: ${version}
isLogin: 1
#我的订单-各状态订单数量
my_status:
method: get
url: /api/orders/my/status
params: {}
data: {}
json: {}
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 private_conversation_request(BaseRequest):
def __init__(self):
self.data = self.api_load(path_setting.PRIVATE_CONVERSATION_CONFIG)
def private_conversation(self, content, target_uid, referrer,referrer_id, is_system, quick_consultation_id, diary_id, from_live):
self.params["content"] = content
self.params["target_uid"] = target_uid
self.params["referrer"] = referrer
self.params["referrer_id"] = referrer_id
self.params["is_system"] = is_system
self.params["quick_consultation_id"] = quick_consultation_id
self.params["diary_id"] = diary_id
self.params["from_live"] = from_live
return self.api_send(self.data["private_conversation"])
if __name__ == '__main__':
print(private_conversation_request().private_conversation("你好", "35874935", "message_home", "", 0, "", "", ""))
\ No newline at end of file
private_conversation:
method: post
url: /api/private_conversation/
params: {}
data:
content: ${content}
target_uid: ${target_uid}
referrer: ${referrer}
referrer_id: ${referrer_id}
is_system: ${is_system}
quick_consultation_id: ${quick_consultation_id}
diary_id: ${diary_id}
from_live: ${from_live}
json: {}
isLogin: 1 #需要登录的接口
\ No newline at end of file
import path_setting
from in_common.base_request import BaseRequest
class qa_request(BaseRequest):
def __init__(self):
self.data = self.api_load(path_setting.QA_CONFIG)
# print(self.replyanswer)
# 帖子收藏
def favor(self, answer_id):
self.params["answer_id"] = answer_id
return self.api_send(self.data["favor"])
# 帖子取消收藏
def cancelfavor(self, answer_id):
self.params["answer_id"] = answer_id
return self.api_send(self.data["cancelfavor"])
#问题收藏
favor:
method: post
url: /api/qa/favor
params:
data:
answer_id: ${answer_id}
json: {}
isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
#问题取消收藏
cancelfavor:
method: post
url: /api/qa/favor/cancel
params:
data:
answer_id: ${answer_id}
json: {}
isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
import path_setting
from in_common.base_request import BaseRequest
class question_request(BaseRequest):
def __init__(self):
self.replyanswer = self.api_load(path_setting.QUESTION_CONFIG)
# print(self.replyanswer)
# 回答详情页- 一/二级评论
def reply_answer(self, current_city_id, answer_id, content, user_id=""):
self.params["current_city_id"] = current_city_id
self.params["answer_id"] = answer_id
self.params["content"] = content
self.params["user_id"] = user_id
return self.api_send(self.replyanswer["reply_answer"])
#回答详情页- 一/二级评论
reply_answer:
method: post
url: /api/question/reply_answer
params:
current_city_id: ${current_city_id}
data:
answer_id: ${answer_id}
content: ${content}
user_id: ${user_id}
json: {}
isLogin: 1
\ No newline at end of file
import path_setting
from in_common.base_request import BaseRequest
class scan_request(BaseRequest):
def __init__(self):
self.data = self.api_load(path_setting.SCAN_DIARY_CARDS_CONFIG)
# 测颜值底部feed流
def scan_diary_cards(self, current_city_id, page,count, feature_results, feed_type):
self.params["current_city_id"] = current_city_id
self.params["page"] = page
self.params["count"] = count
self.params["feature_results"] = feature_results
self.params["feed_type"] = feed_type
return self.api_send(self.data["scan_diary_cards"])
if __name__ == '__main__':
print(scan_request().scan_diary_cards("beijing",1,10,'["细凤眼","眼距过宽","双眼皮","一字眉","流畅","厚唇","宽鼻翼","重度眼袋","尖下巴","无法令纹","娃娃脸",""]',1))
scan_diary_cards:
method: get
url: /api/scan/diary_cards
params:
current_city_id: ${current_city_id}
page: ${page}
count: ${count}
feature_results: ${feature_results}
feed_type: ${feed_type}
\ No newline at end of file
import path_setting
from in_common.base_request import BaseRequest
class search_request(BaseRequest):
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.CONTENTV6_CONFIG) #content_v6路径
self.data = self.api_load(path_setting.HOT_CONFIG) # hot路径
#搜索首页-热门搜索模块(点击搜索框即调接口)
def keywords(self,current_city_id,search_tab):
self.params["current_city_id"] = current_city_id
self.params["search_tab"] = search_tab
return self.api_send(self.data["keywords"])
#搜索结果页-医生/医院tab
def content_v6(self, query, device_id, current_city_id, version, is_first, tab_type, offset, size):
#搜索词
self.params['query'] = query
#设备号
self.params['device_id'] = device_id
#当前城市
self.params['current_city_id'] = current_city_id
#APP版本
self.params['version'] = version
#是否为第一次请求
self.params['is_first'] = is_first
#类型
self.params['tab_type'] = tab_type
#请求的页数 0,10,20
self.params['offset'] = offset
# 请求的size
self.params['size'] = size
return self.api_send(self.data["content_v6"])
# 搜索首页-更美热门榜模块(点击搜索框即调接口)
def hot(self, version, device_id = '97B6764B-2135-4761-9911-701C38CBC272'):
self.params["version"] = version
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"))
#搜索首页-热门搜索模块(点击搜索框即调接口)
keywords:
method: get
#接口地址
url: /api/search/keywords
#列出所有定义函数时的参数
params:
current_city_id: ${current_city_id}
search_tab: ${search_tab}
data: {}
json: {}
#搜索结果页-医生/医院tab
content_v6:
method: get
#接口地址
url: /api/search/v6/content
#列出所有定义函数时的参数
params:
query: ${query}
device_id: ${device_id}
current_city_id: ${current_city_id}
version: ${version}
is_first: ${is_first}
tab_type: ${tab_type}
offset: ${offset}
size: ${size}
data: {}
json: {}
# 搜索首页-更美热门榜模块(点击搜索框即调接口)
hot:
method: get
#接口地址
url: /api/search/hot
#列出所有定义函数时的参数
params:
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 service_request(BaseRequest):
def __init__(self):
self.data = self.api_load(path_setting.HOME_V5_CONFIG) #/all_backend_api/service_request.yaml
def home_v5(self):
return self.api_send(self.data["home_v5"])
#商祥页-收藏
def service_favor(self):
return self.api_send(self.data["service_favor"])
if __name__ == '__main__':
print(service_request().home_v5())
#打印商祥页-收藏接口返回
print(service_request().service_favor())
\ No newline at end of file
home_v5:
method: get
url: /api/service/home/v5
params: {}
data: {}
json: {}
#商祥页-收藏
service_favor:
method: post
url: /api/service/favor/5857263/
params: {}
data: {}
json: {}
isLogin: 1
\ No newline at end of file
import path_setting
from in_common.base_request import BaseRequest
class services_request(BaseRequest):
def __init__(self):
self.data = self.api_load(path_setting.SERVICES_CONFIG)
#商祥页-分享
def share_data(self, p_id, u_id):
self.params["p_id"] = p_id
self.params["u_id"] = u_id
return self.api_send(self.data["share_data"])
if __name__ == '__main__':
#打印商祥页-分享接口返回
print(services_request().share_data("5857263", "618788"))
\ No newline at end of file
#商祥页-分享
share_data:
method: get
url: /api/services/share_data
params:
p_id: ${p_id}
u_id: ${u_id}
data: {}
json: {}
\ No newline at end of file
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
import path_setting
from in_common.base_request import BaseRequest
class shopcart_request(BaseRequest):
def __init__(self):
self.data = self.api_load(path_setting.SHOPCART_CONFIG)
#购物车列表
def list(self):
return self.api_send(self.data["list"])
#商祥页-加入购物车
def add(self, from_live, number, service_item_id):
self.params["from_live"] = from_live
self.params["number"] = number
self.params["service_item_id"] = service_item_id
return self.api_send(self.data["add"])
if __name__ == '__main__':
#打印购物车列表接口返回
print(shopcart_request().list())
#打印商祥页-加入购物车接口返回
print(shopcart_request().add("", 1, "618788"))
\ No newline at end of file
#购物车列表
list:
method: get
url: /api/shopcart/list/v2
params: {}
data: {}
json: {}
isLogin: 1
#商祥页-加入购物车
add:
method: post
url: /api/shopcart/add/v1
params: {}
data:
from_live: ${from_live}
number: ${number}
service_item_id: ${service_item_id}
json: {}
isLogin: 1
\ No newline at end of file
import path_setting
from in_common.base_request import BaseRequest
class skin_request(BaseRequest):
def __init__(self):
self.data = self.api_load(path_setting.SKIN_RECOMMEND_SERVICE_CONFIG)
# 测肤质底部feed流
def skin_recommend_service(self, device_id, current_city_id, appeal_tag_ids, offset, size):
self.params["current_city_id"] = current_city_id
self.params["appeal_tag_ids"] = appeal_tag_ids
self.params["offset"] = offset
self.params["size"] = size
self.params["device_id"] = device_id
return self.api_send(self.data["skin_recommend_service"])
if __name__ == '__main__':
print(skin_request().skin_recommend_service("androidid_7255c3398845cdd5", "beijing", '[2306,2303,2551,2355,2322,2337]', 0, 10))
skin_recommend_service:
method: get
url: /api/skin/recommend_service
params:
current_city_id: ${current_city_id}
offset: ${offset}
size: ${size}
appeal_tag_ids: ${appeal_tag_ids}
device_id: ${device_id}
\ No newline at end of file
login_thirdphone:
method: post
url: /api/account/login/third_phone_login
params:
version: ${version}
data:
phone_data: ${phone_data}
phone_from_type: ${phone_from_type}
json: {}
\ No newline at end of file
import path_setting
from in_common.base_request import BaseRequest
class thirdphonelogin_request(BaseRequest):
def __init__(self):
self.thirdphonelogin = self.api_load(path_setting.THIRD_PHONE_LOGIN_CONFIG)
def thirdphone_login(self,version,phone_data,phone_from_type):
self.params["version"] = version
self.params["phone_data"] = phone_data
self.params["phone_from_type"] = phone_from_type
return self.api_send(self.thirdphonelogin["login_thirdphone"])
#日记贴一级评论创建[这个是非本身日记贴:21116006]--暂时未解决复写yaml文件的问题所以单独把创建评论踢出去
reply_create:
method: post
url: /api/topic/reply/create/21249632/
params:
channel: ${channel}
data:
content: ${content}
json: {}
isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
#日记贴二级评论创建[这个是非本身日记贴:21116006]
sub_reply_create:
method: post
url: /api/topic/reply/create/21249632/
params:
channel: ${channel}
data:
content: ${content}
replied_id: ${replied_id}
json: {}
isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
\ No newline at end of file
import path_setting
from in_common.base_request import BaseRequest
class topic_reply_create_request(BaseRequest):
def __init__(self):
self.data = self.api_load(path_setting.TOPIC_REPLY_CREATE_CONFIG)
def topic_reply_create(self, content, channel):
self.params["content"] = content
self.params["channel"] = channel
return self.api_send(self.data["reply_create"])
def topic_sub_reply_create(self, content, channel, replied_id):
self.params["content"] = content
self.params["channel"] = channel
self.params["replied_id"] = replied_id
return self.api_send(self.data["sub_reply_create"])
import path_setting
from in_common.base_request import BaseRequest
class topic_request(BaseRequest):
def __init__(self):
self.data = self.api_load(path_setting.TOPIC_CONFIG)
# 详情页内部--点赞
def topic_vote(self, topic_id):
self.params["topic_id"] = topic_id
return self.api_send(self.data["vote"])
# 详情页内部-取消点赞
def topic_cancelvote(self, topic_id):
self.params["topic_id"] = topic_id
return self.api_send(self.data["cancelvote"])
# 进入日记贴详情页-用来判断这篇日记贴点赞过没
def topic_detail(self, topic_id):
self.params["topic_id"] = topic_id
return self.api_send(self.data["detail"])
# def diary_test(self):
# return self.api_send(self.data["detail"])
# if __name__ == '__main__':
# r = diary_vote_request.diary_detail(21249959)
# print(r)
#日记贴详情页--日记贴点赞
vote:
method: post
url: /api/topic/vote/
params:
data:
topic_id: ${topic_id}
json: {}
isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
#取消点赞
cancelvote:
method: delete
url: /api/topic/vote/
params:
topic_id: ${topic_id}
data: {}
json: {}
isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
#详情页内容
detail:
method: get
url: /api/topic/v1
params:
topic_id: ${topic_id}
data: {}
json: {}
isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
##日记贴相关美购--暂时没有
#topic_service:
# method: get
# url: /api/diary/services
# params:
# diary_id: ${diary_id}
# service_id: ${service_id}
# data:
# json: {}
##日记贴一级评论创建[这个是非本身日记贴:21116006]--暂时未解决复写yaml文件的问题所以单独把创建评论踢出去
#reply_create:
# method: post
# url: /api/topic/reply/create/21249632/
# params:
# channel: ${channel}
# data:
# content: ${content}
# json: {}
# isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
#
#
##日记贴二级评论创建[这个是非本身日记贴:21116006]
#sub_reply_create:
# method: post
# url: /api/topic/reply/create/21249632/
# params:
# channel: ${channel}
# data:
# content: ${content}
# replied_id: ${replied_id}
# json: {}
# isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
\ No newline at end of file
#日记贴评论点赞
topic_reply_vote:
method: post
url: /hybrid/api/topicreply/vote/_data
params:
data:
id: ${id}
json: {}
isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
topic_reply_cancelvote:
method: post
url: /hybrid/api/topicreply/cancel_vote/_data
params:
data:
id: ${id}
json: {}
isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
#
import path_setting
from in_common.base_request import BaseRequest
class topicreply_vote_request(BaseRequest):
def __init__(self):
self.data = self.api_load(path_setting.TOPIC_REPLY_VOTE_CONFIG)
def topic_reply_vote(self, id):
self.params["id"] = id
return self.api_send(self.data["topic_reply_vote"])
def topic_reply_cancelvote(self, id):
self.params["id"] = id
return self.api_send(self.data["topic_reply_cancelvote"])
# 进入日记贴详情页-用来判断这篇日记贴点赞过没
# 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
class tractate_request(BaseRequest):
def __init__(self):
self.data = self.api_load(path_setting.TRACTATE_CONFIG)
# 帖子详情页内容
def tractate_detail(self, current_city_id, tractate_id, data_type):
self.params["current_city_id"] = current_city_id
self.params["tractate_id"] = tractate_id
self.params["data_type"] = data_type
return self.api_send(self.data["tractate_detail"])
# 帖子相关美购
def tractate_related_service(self, current_city_id, tractate_id, data_type):
self.params["current_city_id"] = current_city_id
self.params["tractate_id"] = tractate_id
self.params["data_type"] = data_type
return self.api_send(self.data["related_service"])
# 帖子外显评论
def reply(self, current_city_id, id, data_type):
self.params["current_city_id"] = current_city_id
self.params["id"] = id
self.params["data_type"] = data_type
return self.api_send(self.data["reply"])
# 帖子收藏
def favor(self, tractate_id, data_type):
self.params["tractate_id"] = tractate_id
self.params["data_type"] = data_type
return self.api_send(self.data["favor"])
# 帖子取消收藏
def cancelfavor(self, tractate_id, data_type):
self.params["tractate_id"] = tractate_id
self.params["data_type"] = data_type
return self.api_send(self.data["cancelfavor"])
# 帖子点赞
def tractate_vote(self, tractate_id, data_type, reply_id):
self.params["tractate_id"] = tractate_id
self.params["data_type"] = data_type
self.params["reply_id"] = reply_id
return self.api_send(self.data["tractate_vote"])
# 帖子取消点赞
def tractate_cancelvote(self, tractate_id, data_type, reply_id):
self.params["tractate_id"] = tractate_id
self.params["data_type"] = data_type
self.params["reply_id"] = reply_id
return self.api_send(self.data["tractate_cancelvote"])
# 帖子创建一级&二级评论
def publish_reply(self, tractate_id, data_type, reply_id, content):
self.params["tractate_id"] = tractate_id
self.params["data_type"] = data_type
self.params["reply_id"] = reply_id
self.params["content"] = content
return self.api_send(self.data["publish_reply"])
#查看用户帖子详情页
tractate_detail:
method: get
url: /api/tractate/new_detail
params:
current_city_id: ${current_city_id}
tractate_id: ${tractate_id}
data_type: ${data_type}
data: {}
json: {}
isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
#查看用户帖子相关美购详情
related_service:
method: get
url: /api/tractate/related_service
params:
current_city_id: ${current_city_id}
tractate_id: ${tractate_id}
data_type: ${data_type}
data: {}
json: {}
isLogin: 0 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
#查看用户帖子外显评论
reply:
method: get
url: /api/tractate/reply
params:
current_city_id: ${current_city_id}
id: ${id}
data_type: ${data_type}
data: {}
json: {}
isLogin: 0 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
#帖子收藏
favor:
method: post
url: /api/tractate/favor
params:
data:
data_type: ${data_type}
tractate_id: ${tractate_id}
json: {}
isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
#帖子取消收藏
cancelfavor:
method: post
url: /api/tractate/favor/cancel
params:
data:
data_type: ${data_type}
tractate_id: ${tractate_id}
json: {}
isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
#帖子点赞
tractate_vote:
method: post
url: /api/tractate/vote
params:
data:
tractate_id: ${tractate_id}
data_type: ${data_type}
reply_id: ${reply_id}
json: {}
isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
#帖子取消点赞
tractate_cancelvote:
method: post
url: /api/tractate/vote/cancel
params:
data:
tractate_id: ${tractate_id}
data_type: ${data_type}
reply_id: ${reply_id}
json: {}
isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
#
#帖子创建一级评论
publish_reply:
method: post
url: /api/tractate/publish_reply
params:
data:
tractate_id: ${tractate_id}
data_type: ${data_type}
reply_id: ${reply_id}
content: ${content}
json: {}
isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
#
\ No newline at end of file
import path_setting
from in_common.base_request import BaseRequest
class user_request(BaseRequest):
def __init__(self):
self.data = self.api_load(path_setting.PERSONAL_CENTER_CONFIG)
def personal_center(self):
return self.api_send(self.data["personal_center"])
def __init__(self):
self.data = self.api_load(path_setting.USER_ANSWER_CONFIG)
#医院主页问答列表
def answer(self, user):
self.params["user"] = user
return self.api_send(self.data["answer"])
#日记贴相关部分配置
def __init__(self):
self.data = self.api_load(path_setting.TOPIC_FAVOR_CONFIG)
#日记贴帖子相关-收藏
def topic_favor(self):
return self.api_send(self.data["favor"])
#日记贴取消收藏
def topic_canclefavor(self):
return self.api_send(self.data["canclefavor"])
if __name__ == '__main__':
#个人中心
print(user_request().personal_center())
#打印医生/医院主页问答列表接口返回
print(user_request().answer("21476198"))
# 日记贴收藏&取消收藏
# print(user_request().topic_favor())
# print(user_request().topic_canclefavor())
personal_center:
method: GET
url: /api/user/personal_center
params:
choose_id: 0
community_id: 0
version: 7.42.0
data: {}
json: {}
isLogin: 1
#医院主页-问答接口
answer:
method: get
url: /api/user/answer
params:
user: ${user}
count: 10
page: 1
data: {}
json: {}
#日记贴--收藏
favor:
method: post
url: /api/user/problem_favor/21249632/
params:
data: {}
json: {}
isLogin: 1
#日记贴--取消收藏
canclefavor:
method: delete
url: /api/user/problem_favor/21249632/
params:
data: {}
json: {}
isLogin: 1
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: {}
import path_setting
from in_common.base_request import BaseRequest
class xcx_request(BaseRequest):
def __init__(self):
self.data = self.api_load(path_setting.XCX_GENGMEI_GET_WXACODE_UNLIMITED_CONFIG)
# 测颜值结果页获取小程序分享二维码
def gengmei_get_wxacode_unlimited(self,page,scene):
self.params["page"] = page
self.params["scene"] = scene
return self.api_send(self.data["get_wxacode_unlimited"])
if __name__ == '__main__':
print(xcx_request().gengmei_get_wxacode_unlimited("pages/scanFace/report/main","scan_code=gm_code&fid=27923989"))
get_wxacode_unlimited:
# 获取
method: get
url: /xcx/gengmei/get_wxacode_unlimited
params:
page: ${page}
scene: ${scene}
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
import path_setting
from in_common.base_request import BaseRequest
class web2_request(BaseRequest):
def __init__(self):
self.SERVICE_URL = self.api_load(path_setting.SERVICE_URL)
# self.SERVICE_REVIEW_URL = self.api_load(path_setting.SERVICE_REVIEW_URL)
def service_list(self, page,pagesize,is_online,extra_filter_choice):
#我的商品查询列表
self.params["page"] = page
self.params["pagesize"] = pagesize
self.params["is_online"] = is_online
self.params["extra_filter_choice"] = extra_filter_choice
return self.api_send(self.SERVICE_URL["service_list"])
def service_review_list(self,page,pagesize,type):
#商品审核查询列表
self.params["page"] = page
self.params["pagesize"] = pagesize
self.params["type"] = type
return self.api_send(self.SERVICE_URL["service_review_list"])
def servicereview_option(self,id, type,csrfmiddlewaretoken):
#商品审核-撤回审核、取消申请
self.params["id"] = id
self.params["type"] = type
self.params["csrfmiddlewaretoken"] = csrfmiddlewaretoken
return self.api_send(self.SERVICE_URL["servicereview_option"])
def tag_all(self) :
#发布商品-选择类目跳转发布商品页面tag接口
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"])
def service_deletelist(self,page):
#我的商品-商品回收站
self.params["page"] = page
return self.api_send(self.SERVICE_URL["service_deletelist"])
def artemis_ad_add_shopping_cart_info(self):
#我的购物车
return self.api_send(self.SERVICE_URL["artemis_ad_add_shopping_cart_info"])
def artemis_add_value_order_id_detail(self):
"我的服务订单-已购买"
return self.api_send(self.SERVICE_URL["artemis_add_value_order_id_detail"])
if __name__ == '__main__':
print(web2_request().service_list("1", "10", "-1", "-1"))
print(web2_request().service_review_list("1", "10", "0"))
print(web2_request().servicereview_option("209989", "1", "PC8uTySuxipukIMuqNV1OPB376C2ZZ3g"))
print(web2_request().tag_all())
print(web2_request().service_delete("1","209863","PC8uTySuxipukIMuqNV1OPB376C2ZZ3g"))
print(web2_request().service_deletelist("1"))#商品回收站
print(web2_request().artemis_ad_add_shopping_cart_info())
print(web2_request().artemis_add_value_order_id_detail())
service_list:
method: get
url: /api/web2/service/list
params:
page: ${page}
pagesize: ${pagesize}
is_online: ${is_online}
extra_filter_choice: ${extra_filter_choice}
data: {}
json: {}
isLogin: 1
service_review_list:
method: get
url: /api/web2/service/review/list
params:
page: ${page}
pagesize: ${pagesize}
type: ${type}
data: {}
json: {}
isLogin: 1
servicereview_option:
method: POST
url: /api/web2/servicereview/option
params: {}
data:
id: ${id}
type: ${type}
csrfmiddlewaretoken: ${csrfmiddlewaretoken}
json: {}
isLogin: 1
tag_all:
method: get
url: /api/web2/tag/all
param: {}
data: {}
json: {}
isLogin: 1
service_delete:
method: POST
url: /api/web2/service/delete
params: {}
data:
is_delete: ${is_delete}
service_register_id: ${service_register_id}
csrfmiddlewaretoken: ${csrfmiddlewaretoken}
json: {}
isLogin: 1
service_deletelist:
method: get
url: /api/web2/service/delete/list
params:
page: ${page}
data: {}
json: {}
isLogin: 1
artemis_ad_add_shopping_cart_info:
method: get
url: /api/web2/artemis/ad/add_shopping_cart/info
params: {}
data: {}
json: {}
isLogin: 1 #需要登录
artemis_add_value_order_id_detail:
method: get
url: /api/web2/artemis/add_value_order/957727877165/detail
params: {}
data: {}
json: {}
isLogin: 1 #需要登录
\ No newline at end of file
import path_setting
from in_common.base_request import BaseRequest
class web_request(BaseRequest):
def __init__(self):
self.ACCOUNT_URL = self.api_load(path_setting.ACCOUNT_URL)
def account_unreadbadgecount(self) :
return self.api_send(self.ACCOUNT_URL["account_unreadbadgecount"])
def article_videotoken(self) :
return self.api_send(self.ACCOUNT_URL["article_videotoken"])
def doctor_submechanisms(self) :
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"])
def service_all(self):
return self.api_send(self.ACCOUNT_URL["service_all"])
def conversation_user_id(self, type, content, doctor_user_id, t, csrfmiddlewaretoken):
self.params["type"] = type
self.params["content"] = content
self.params["doctor_user_id"] = doctor_user_id
self.params["t"] = t
self.params["csrfmiddlewaretoken"] = csrfmiddlewaretoken
return self.api_send(self.ACCOUNT_URL["conversation_user_id"])
# def file_upload(self, img_type,csrfmiddlewaretoken,id,name,type,lastModifiedDate,size,file):
# self.params["img_type"] = img_type
# self.params["csrfmiddlewaretoken"] = csrfmiddlewaretoken
# self.params["id"] = id
# self.params["name"] = name
# self.params["type"] = type
# self.params["lastModifiedDate"] = lastModifiedDate
# self.params["size"] = size
# self.params["file"] = file
# return self.api_send(self.ACCOUNT_URL["file_upload"])
def cpc_homepage(self):
return self.api_send(self.ACCOUNT_URL["cpc_homepage"])
def artemis_ad_type_list(self):
return self.api_send(self.ACCOUNT_URL["artemis_ad_type_list"])
def artemis_order_list(self, status, page):
self.params["status"] = status
self.params["page"] = page
return self.api_send(self.ACCOUNT_URL["artemis_order_list"])
def artemis_order_id_detail(self):
"上线中订单详情页"
return self.api_send(self.ACCOUNT_URL["artemis_order_id_detail"])
if __name__ == '__main__':
print(web_request().account_unreadbadgecount())
print(web_request().article_videotoken())
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(web_request().conversation_diary(602329))
print(web_request().conversation_coupon(602329))
print(web_request().service_all())
# print(web_request().file_upload("19","PC8uTySuxipukIMuqNV1OPB376C2ZZ3g","WU_FILE_0","lADPDg7mQdiUTiLNAZDNAZA_400_400.jpg_720x720g.jpg","image/jpeg","Mon Apr 26 2021 11:29:45 GMT+0800 (中国标准时间)","17688","(binary)"))
print(web_request().conversation_user_id(0, "您好", 602329, "271caac2ae1687ca0a56ee18115b8183", "NLeTxEx1BOQo1zjv2us9BQ00ViMAHGpJ"))
print(web_request().cpc_homepage())
print(web_request().artemis_ad_type_list())
print("发送")
print(web_request().artemis_order_list(0, 1))
print(web_request().artemis_order_list(1, 1))
print(web_request().artemis_order_list(2, 1))
print(web_request().artemis_order_id_detail())
\ No newline at end of file
account_unreadbadgecount:
method: get
url: /api/web/account/unread_badge_count
param: {}
data: {}
json: {}
isLogin: 1
article_videotoken:
method: get
url: /api/web/article/video_token
param: {}
data: {}
json: {}
isLogin: 1
doctor_submechanisms:
method: get
url: /api/web/doctor/submechanisms
param: {}
data: {}
json: {}
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 #需要登录
service_all:
method: get
url: /api/web/service/all
params: {}
data: {}
json: {}
isLogin: 1
#file_upload:
# method: post
# url: /api/web/file/upload
# param: {}
# data:
# img_type: ${img_type}
# csrfmiddlewaretoken: ${csrfmiddlewaretoken}
# id: ${id}
# name: ${name}
# type: ${type}
# lastModifiedDate: ${lastModifiedDate}
# size: ${size}
# file: ${file}
# json: {}
# isLogin: 1
conversation_user_id:
method: post
url: /api/web/conversation/602329_33909952
params: {}
data:
type: ${type}
content: ${content}
doctor_user_id: ${doctor_user_id}
t: ${t}
csrfmiddlewaretoken: ${csrfmiddlewaretoken}
json: {}
isLogin: 1 #需要登录
cpc_homepage:
method: get
url: /api/web/cpc/homepage
params: {}
data: {}
json: {}
isLogin: 1 #需要登录
artemis_ad_type_list:
method: get
url: /api/web/artemis/ad/type_list
params: {}
data: {}
json: {}
isLogin: 1 #需要登录
artemis_order_list:
method: get
url: /api/web/artemis/order/list
params:
status: ${status}
page: ${page}
data: {}
json: {}
isLogin: 1 #需要登录
artemis_order_id_detail:
method: get
url: /api/web/artemis/order/509151034657/detail
params: {}
data: {}
json: {}
isLogin: 1 #需要登录
\ No newline at end of file
import path_setting
from in_common.base_request import BaseRequest
class beautycard_request(BaseRequest):
def __init__(self):
#更美次卡-获取已添加页面次卡spu/sku列表
self.data = self.api_load(path_setting.GET_RELATED_BC_CONFIG)
#更美次卡-删除/批量删除已添加页面次卡
self.data = self.api_load(path_setting.DELETE_RELATED_BC_CONFIG)
#更美次卡-已添加页面全部导出
self.data = self.api_load(path_setting.EXPORT_RELATED_BC_CONFIG)
#更美次卡-更改次卡排序
self.data = self.api_load(path_setting.UPDATE_BC_RANK_CONFIG)
#更美次卡-按次卡sku_id导入,导入校验
self.data = self.api_load(path_setting.CHECK_SKU_IDS_CONFIG)
#更美次卡-获取已添加页面次卡spu/sku列表
def get_related_bc(self, unit_id, bc_sku_id, bc_spu_id, page, page_size):
self.params["unit_id"] = unit_id
self.params["bc_sku_id"] = bc_sku_id
self.params["bc_spu_id"] = bc_spu_id
self.params["page"] = page
self.params["page_size"] = page_size
return self.api_send(self.data["get_related_bc"])
#更美次卡-删除/批量删除已添加页面次卡
def delete_related_bc(self, unit_id, bc_sku_ids, bc_spu_ids, related_type):
self.params["unit_id"] = unit_id
self.params["bc_sku_ids"] = bc_sku_ids
self.params["bc_spu_ids"] = bc_spu_ids
self.params["related_type"] = related_type
return self.api_send(self.data["delete_related_bc"])
#更美次卡-已添加页面全部导出
def export_related_bc(self, unit_id, bc_sku_id, bc_spu_id):
self.params["unit_id"] = unit_id
self.params["bc_sku_id"] = bc_sku_id
self.params["bc_spu_id"] = bc_spu_id
return self.api_send(self.data["export_related_bc"])
#更美次卡-更改次卡排序
def update_bc_rank(self, unit_id, related_id, related_type, rank):
self.params["unit_id"] = unit_id
self.params["related_id"] = related_id
self.params["related_type"] = related_type
self.params["rank"] = rank
return self.api_send(self.data["update_bc_rank"])
#更美次卡-按次卡sku_id导入,导入校验
def check_sku_ids(self, bc_skus):
self.params["bc_skus"] = bc_skus
return self.api_send(self.data["check_sku_ids"])
#更美次卡-按次卡spu_id导入,导入校验
def check_spu_ids(self, bc_spus):
self.params["bc_spus"] = bc_spus
return self.api_send(self.data["check_spu_ids"])
if __name__ == '__main__':
print(beautycard_request().get_related_bc("20105", "", "", "0", "10"))
print(beautycard_request().delete_related_bc("19931", "[10163]", "[]", "8"))
print(beautycard_request().export_related_bc("19933", "", ""))
print(beautycard_request().update_bc_rank("20105", "100023", "7", "11"))
\ No newline at end of file
#更美次卡-获取已添加页面次卡spu/sku列表
get_related_bc:
method : GET
url : /achelous/visual/beauty_card/get_related_bc
params :
unit_id : ${unit_id}
bc_sku_id : ${bc_sku_id}
bc_spu_id : ${bc_spu_id}
page : ${page}
page_size : ${page_size}
data : {}
json : {}
isLogin : 1
#更美次卡-删除/批量删除已添加页面次卡
delete_related_bc:
method : POST
url : /achelous/visual/beauty_card/delete_related_bc
params : {}
data :
unit_id : ${unit_id}
bc_sku_ids : ${bc_sku_ids}
bc_spu_ids : ${bc_spu_ids}
related_type : ${related_type}
json : {}
isLogin : 1
#更美次卡-已添加页面全部导出
export_related_bc:
method : GET
url : /achelous/visual/beauty_card/export_related_bc
params :
unit_id : ${unit_id}
bc_sku_id : ${bc_sku_id}
bc_spu_id : ${bc_spu_id}
data : {}
json : {}
isLogin : 1
#更美次卡-更改次卡排序
update_bc_rank:
method : POST
url : /achelous/visual/beauty_card/update_bc_rank
params : {}
data :
unit_id: ${unit_id}
related_id: ${related_id}
related_type: ${related_type}
rank: ${rank}
json : {}
isLogin : 1
#更美次卡-按次卡sku_id导入,导入校验
check_sku_ids:
method : POST
url : /achelous/visual/beauty_card/check_sku_ids
params : {}
data :
bc_skus: ${bc_skus}
json : {}
isLogin : 1
#更美次卡-按次卡spu_id导入,导入校验
check_spu_ids:
method : POST
url : /achelous/visual/beauty_card/check_spu_ids
params : {}
data :
bc_spus: ${bc_spus}
json : {}
isLogin : 1
\ No newline at end of file
import path_setting
from in_common.base_request import BaseRequest
class login_request(BaseRequest):
def __init__(self):
#om后台-登录
self.data = self.api_load(path_setting.OMLOGIN_CONFIG)
#om后台-登录
def om_login(self, username, password):
self.params["username"] = username
self.params["password"] = password
return self.api_send(self.data["om_login"])
if __name__ == '__main__':
print(login_request().om_login("admin", "123123"))
\ No newline at end of file
#om后台-登录
om_login:
method : POST
url : /achelous/account/login
params: {}
data :
username: ${username}
password: ${password}
json : {}
'''
钩子函数,解决ids乱码问题
'''
def pytest_collection_modifyitems(items):
for item in items:
item.name = item.name.encode("utf-8").decode("unicode_escape")
item._nodeid = item.nodeid.encode("utf-8").decode("unicode_escape")
'''
此文件是用来将case转换成list
'''
def get_ids(data: object, path: object) -> object:
"""
@rtype:
"""
params = data[path]
case = []
for ids in params:
case.append(ids["case"])
# print('-@@@@@@@@@@@@',case,params)
return case, params
import json
import random
import string
import requests
import yaml
from jsonpath import jsonpath
from login_session_function import LoginFunction
# from pymysql import OperationalError
import path_setting
class BaseRequest:
params = {}
@classmethod
def format(cls, r):
cls.r = r
print(json.dumps(json.loads(r.text), indent=2, ensure_ascii=False))
# 封装yaml文件读取
@classmethod
def yaml_load(cls, path) -> list:
with open(path, encoding='utf-8') as f:
return yaml.safe_load(f)
# 调用yaml加载文件API加载
def api_load(self, path: object) -> object:
return self.yaml_load(path)
def jsonpath(self, path, r=None, **kwargs):
if r is None:
r = self.r.json()
return jsonpath(r, path)
def api_send(self, req: object) -> object:
host = self.api_load(path_setting.HOSTYAML_CONFIG)
# 获取调用该方法的路径
import inspect
ins_file = inspect.stack()[1].filename
ins_dir = ins_file.split('/')[-2]
host_service = ins_dir.split('_')[1]
# default: backend
if host_service not in host['develop_host']:
host_service = 'backend'
url_host = host['develop_host'][host_service]
# if host["develop_host"].get("doctor") is not None:
# url_host = host['develop_host']['doctor']
# elif host["develop_host"].get("backend") is not None:
# url_host = host['develop_host']['backend']
raw = yaml.dump(req) # 将一个python对象生成为yaml文档
for key, value in self.params.items():
raw = raw.replace(f"${{{key}}}", repr(value))
req = yaml.safe_load(raw)
print('req:', req)
s = requests
if req.get('isLogin'):
s = LoginFunction().get_session()
# 调用具体case的url
r = s.request(
req['method'],
url=url_host + req['url'],
params=req.get('params'),
# headers=user_headers,
data=req.get('data'),
json=req.get('json'),
# verify=False
# proxies={"http":"172.30.9.226:8888"}
)
print("0000000",r)
# 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):
return ''.join(random.sample(string.ascii_lowercase + string.digits, 32))
'''
def get_cookie(self, req: dict):
host = self.api_load(path_setting.HOSTYAML_CONFIG)
print(host)
r = requests.request(
req['method'],
url=host['develop_host']['url'] + req['url'],
params=req['params'],
headers=req['headers'],
data=req['data'],
json=req['json']
)
dict = {}
for i in r.cookies:
dict[i.name] = i.value
headers = '_gtid={};sessionid={}'.format(dict["_gtid"], dict["sessionid"])
return headers
def read_header(self):
with open("../in_common/get_cookie.txt", 'r', encoding='utf-8') as f:
cookies = f.read()
headers = {"cookie": cookies}
return headers
'''
if __name__ == '__main__':
# BaseRequest().api_load("../api/api.yaml")
print(BaseRequest().trace_id())
import path_setting
import requests
import yaml
"""
此文件是封装session的
"""
class LoginFunction:
def __init__(self):
self.host = self.login_yaml_load(path_setting.HOSTYAML_CONFIG)
self.params = self.login_yaml_load(path_setting.LOGIN_FUNCTION_DATA)
def login_yaml_load(self, path) -> list:
with open(path, encoding='utf-8') as f:
return yaml.safe_load(f)
def get_session(self):
hostList = self.host['develop_host']
for key in hostList:
if 'backend' == key:
return self.get_develop_session()
if 'doctor' == key:
return self.get_doctor_session()
elif 'om' == key:
return self.get_om_session()
def get_develop_session(self):
url = self.host["develop_host"]["backend"] + self.params["backend_login"]["url"]
s = requests.session()
r = s.request(
self.params["backend_login"]["method"],
url=url,
params=self.params["backend_login"]["params"],
data=self.params["backend_login"]["data"],
headers={'Connection': 'close'},
# verify=False
)
return s
def get_doctor_session(self):
url = self.host["develop_host"]["doctor"] + self.params["doctor_login"]["url"]
s = requests.session()
r = s.request(
self.params["doctor_login"]["method"],
url=url,
params=self.params["doctor_login"]["params"],
data=self.params["doctor_login"]["data"],
headers={'Connection': 'close'}
)
return s
def get_om_session(self):
url = self.host["develop_host"]["om"] + self.params["om_login"]["url"]
s = requests.session()
r = s.request(
self.params["om_login"]["method"],
url=url,
params=self.params["om_login"]["params"],
data=self.params["om_login"]["data"],
headers={'Connection': 'close'}
)
return s
if __name__ == '__main__':
LoginFunction().get_session()
\ No newline at end of file
backend_login:
method: POST
url: /api/account/login/login_vfc
params:
current_city_id: "beijing"
data:
phone_num: "+8612345678912"
vfc_code: 1234
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
params: {}
data:
name: "12345654321"
password: 123456
method: password
csrfmiddlewaretoken: "PKHywf6cMBZUkc5WfklO71bQNoMztAfv"
om_login:
method: post
url: /achelous/account/login
params: {}
data:
username: "admin"
password: "123123"
\ No newline at end of file
import os, sys
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
sys.path.append(BASE_DIR)
HOSTYAML_CONFIG = os.path.join(BASE_DIR, "backend_auto", "host.yaml")
LOGIN_FUNCTION_DATA = os.path.join(BASE_DIR, "backend_auto", "login_session_function.yaml")
APYAML_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "account_request.yaml")
LOGIN_VFC = os.path.join(BASE_DIR, "backend_auto/test_backend_data/account_data", "login_vfc.yaml")
# 日记本总接口配置
DIARY_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "diary_request.yaml")
#日记本详情页--字段判空
DIARY_DATA = os.path.join(BASE_DIR, "backend_auto/test_backend_data/diary_data", "topic_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_data", "diary_service.yaml")
#日记本收藏&取消收藏
DIARY_FAVOR = os.path.join(BASE_DIR, "backend_auto/test_backend_data/diary_data", "favor.yaml")
# 日记本修改日记信息operation--目前好像直接用接口写无权限稍后解决
DIARY_OPERATION_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "diary_operation.yaml")
DIARY_OPERATION = os.path.join(BASE_DIR, "backend_auto/test_backend_data/diary_data", "diary_operation.yaml")
# 日记本创建日记贴信息-
DIARY_UPDATE_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "diary_update.yaml")
DIARY_UPDATE = os.path.join(BASE_DIR, "backend_auto/test_backend_data/diary_data", "diary_update.yaml")
# 日记本进入相册页
DIARY_ALBUM_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "hybrid_diary_request.yaml")
DIARY_ALBUM = os.path.join(BASE_DIR, "backend_auto/test_backend_data/hybrid_data", "diary_album.yaml")
# 日记本列表-日记贴点赞相关()
DIARY_VOTE_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "hybrid_api_topic_request.yaml")
DIARY_VOTE = os.path.join(BASE_DIR, "backend_auto/test_backend_data/hybrid_data", "api_topic_vote.yaml")
# 日记本&帖子&日记贴&帖子&问答各个详情页下方推荐内容
PERSONAL_RECOMMENDS_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "personal_recommends.yaml")
PERSONAL_RECOMMENDS = os.path.join(BASE_DIR, "backend_auto/test_backend_data/personal_data", "personal_recommends.yaml")
# 日记本列表-展示评论列表---也是总的common的配置
DIARY_COMMON_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "common_request.yaml")
# 日记本列表-一级评论展示评论列表
DIARY_COMMON_REPLY = os.path.join(BASE_DIR, "backend_auto/test_backend_data/common_data", "reply.yaml")
# 日记贴-子评论列表
TOPIC_SUB_COMMON = os.path.join(BASE_DIR, "backend_auto/test_backend_data/common_data", "sub_common.yaml")
# 日记贴-创建一级评论&二级评论
TOPIC_REPLY_CREATE_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "topic_reply_create.yaml")
TOPIC_REPLY_CREATE = os.path.join(BASE_DIR, "backend_auto/test_backend_data/topic_data", "topic_reply_create.yaml")
# 日记贴-一级评论点赞&取消点赞topicreply
TOPIC_REPLY_VOTE_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "topicreply_vote.yaml")
TOPIC_REPLY_VOTE = os.path.join(BASE_DIR, "backend_auto/test_backend_data/topic_data", "reply_vote.yaml")
# 日记贴-收藏&取消收藏--config文件代表,data代表接口
TOPIC_FAVOR_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "user_request.yaml")
TOPIC_FAVOR = os.path.join(BASE_DIR, "backend_auto/test_backend_data/user_data", "problem_favor.yaml")
# 日记贴-topic总的接口的请求配置
TOPIC_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "topic_request.yaml")
# 日记贴-详情页内容
TOPIC_DETAIL = os.path.join(BASE_DIR, "backend_auto/test_backend_data/topic_data", "v1.yaml")
# 日记贴-点赞&取消点赞--详情页内部
TOPIC_VOTE = os.path.join(BASE_DIR, "backend_auto/test_backend_data/topic_data", "vote.yaml")
# 帖子详情页内容--也是总的tractate接口的配置
TRACTATE_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "tractate_request.yaml")
# 帖子详情页内容
TRACTATE_DETAIL = os.path.join(BASE_DIR, "backend_auto/test_backend_data/tractate_data", "new_detail.yaml")
# 帖子详情页--相关美购&推荐美购
TRACTATE_RELATED_SERVICE = os.path.join(BASE_DIR, "backend_auto/test_backend_data/tractate_data", "related_service.yaml")
# 帖子详情页--外显评论
TRACTATE_REPLY = os.path.join(BASE_DIR, "backend_auto/test_backend_data/tractate_data", "reply.yaml")
# 帖子详情页--收藏&取消收藏
TRACTATE_FAVOR = os.path.join(BASE_DIR, "backend_auto/test_backend_data/tractate_data", "favor.yaml")
# 帖子详情页--点赞&取消点赞
TRACTATE_VOTE = os.path.join(BASE_DIR, "backend_auto/test_backend_data/tractate_data", "vote.yaml")
# 帖子详情页--一级评论创建
TRACTATE_PUBLISH_REPLY = os.path.join(BASE_DIR, "backend_auto/test_backend_data/tractate_data", "publish_reply.yaml")
# 问答详情页--问题详情
QUESTION_DETAIL = os.path.join(BASE_DIR, "backend_auto/test_backend_data/hybrid_data", "question_v1.yaml")
# 问答详情页--回答列表
ANSWER_LIST = os.path.join(BASE_DIR, "backend_auto/test_backend_data/hybrid_data", "question_new_answer_list.yaml")
# qa接口总的配置项--问答·相关
QA_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "qa_request.yaml")
# -问题的收藏&取消收藏
QA_FAVOR = os.path.join(BASE_DIR, "backend_auto/test_backend_data/qa_data", "favor.yaml")
# -test的文件,尝试在不动原函数的基础上加参数而不是用默认参数。--没必要
# TEST_QA = os.path.join(BASE_DIR, "backend_auto/test_backend_data/qa_data", "test.yaml")
#搜索首页-热门搜索
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")
#医生后台-我的商品
SERVICE_DATA=os.path.join(BASE_DIR, "backend_auto/test_doctor_data/web2_data", "service_list.yaml")
SERVICE_URL=os.path.join(BASE_DIR, "backend_auto/all_doctor_api", "web2_request.yaml")
#医生后台-商品审核流程
SERVICE_REVIEW_DATA=os.path.join(BASE_DIR, "backend_auto/test_doctor_data/web2_data", "service_review_list.yaml")
#医生后台-新商品审核-撤回审核流程
SERVICEREVIEW_OPTION_DATA=os.path.join(BASE_DIR, "backend_auto/test_doctor_data/web2_data", "servicereview_option.yaml")
#医生后台-发布商品选择类目ACCOUNT
ACCOUNT_URL=os.path.join(BASE_DIR, "backend_auto/all_doctor_api", "web_request.yaml")
ACCOUNT_DATA=os.path.join(BASE_DIR, "backend_auto/test_doctor_data/web_data", "account_unreadbadgecount.yaml")
# 医生后台-发布商品选择类目article
ARTICLE_DATA=os.path.join(BASE_DIR, "backend_auto/test_doctor_data/web_data", "article_videotoken.yaml")
#医生后台 - 发布商品选择类目tag
TAG_DATA=os.path.join(BASE_DIR, "backend_auto/test_doctor_data/web2_data", "tag_all.yaml")
#医生后台 - 发布商品选择类目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")
#医生后台-编辑商品
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")
#医生后台-商品回收站
DELETELIST_DATA=os.path.join(BASE_DIR, "backend_auto/test_doctor_data/web2_data", "service_deletelist.yaml")
#医生后台-上线商品、编辑商品
SERVICEALL_DATA=os.path.join(BASE_DIR, "backend_auto/test_doctor_data/web_data", "service_all.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")
# 测颜值结果页
ONEIMAGE_SHARE_V4_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "oneimage_request.yaml")
ONEIMAGE_SHARE_V4_DATA = os.path.join(BASE_DIR, "backend_auto/test_backend_data/oneimage_data", "share_v4.yaml")
# 测颜值根据五官推荐美购
ONEIMAGE_RECOMEND_SERVICES_DATA = os.path.join(BASE_DIR, "backend_auto/test_backend_data/oneimage_data", "recomend_services.yaml")
# 测颜值结果页获取小程序二维码
XCX_GENGMEI_GET_WXACODE_UNLIMITED_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "xcx_request.yaml")
XCX_GENGMEI_GET_WXACODE_UNLIMITED_DATA = os.path.join(BASE_DIR, "backend_auto/test_backend_data/xcx_data", "gengmei_get_wxacode_unlimited.yaml")
# 测颜值根据标签召回日记
FACE_DIARY_CARDS_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "face_request.yaml")
FACE_DIARY_CARDS_DATA = os.path.join(BASE_DIR, "backend_auto/test_backend_data/face_data", "diary_cards.yaml")
# 3D变脸下feed流
FACE_PLASTIC_FEEDS_DATA = os.path.join(BASE_DIR, "backend_auto/test_backend_data/face_data", "plastic_feeds.yaml")
# 测颜值底部feed流
SCAN_DIARY_CARDS_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "scan_request.yaml")
SCAN_DIARY_CARDS_DATA = os.path.join(BASE_DIR, "backend_auto/test_backend_data/scan_data", "diary_cards.yaml")
# 测肤质feed流
SKIN_RECOMMEND_SERVICE_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "skin_request.yaml")
SKIN_RECOMMEND_SERVICE_DATA = os.path.join(BASE_DIR, "backend_auto/test_backend_data/skin_data", "recommend_service.yaml")
# 测肤结果页 / AI变脸结果页
GMAI_SKIN_NEWREPORT_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "gmai_request.yaml")
GMAI_SKIN_NEWREPORT_DATA = os.path.join(BASE_DIR, "backend_auto/test_backend_data/gmai_data", "skin_newReport.yaml")
# 用户之前是否使用过测肤功能
GMAI_SKIN_USER_HAD_TEST_DATA = os.path.join(BASE_DIR, "backend_auto/test_backend_data/gmai_data", "skin_user_had_test.yaml")
# 模拟双眼皮
GMAI_EYELIDS_PLASTIC_DATA = os.path.join(BASE_DIR, "backend_auto/test_backend_data/gmai_data", "eyelids_plastic.yaml")
# 模拟发型
GMAI_SIMULATE_ANALYZE_DATA = os.path.join(BASE_DIR, "backend_auto/test_backend_data/gmai_data", "simulate_analyze.yaml")
# 获取模拟整形相关配置文件
GMAI_SIMULATE_CONF_DATA = os.path.join(BASE_DIR, "backend_auto/test_backend_data/gmai_data", "simulate_conf.yaml")
# 模拟双眼皮,发型,美瞳,眉毛下日记推荐(根据标签)
EYELIDS_DIARY_CARDS_CONFIG = os.path.join(BASE_DIR,"backend_auto/all_backend_api", "eyelids_request.yaml")
EYELIDS_DIARY_CARDS_DATA = os.path.join(BASE_DIR, "backend_auto/test_backend_data/eyelids_data", "diary_cards.yaml")
# AI变脸结果
GMAI_PLASTIC_ANALYSIS_V3_DATA = os.path.join(BASE_DIR, "backend_auto/test_backend_data/gmai_data", "plastic_analysis_v3.yaml")
# 3D变脸获取参数
GMAI_PLASTIC_CHECCK_STYLE_CLASSTIFY_DATA = os.path.join(BASE_DIR, "backend_auto/test_backend_data/gmai_data", "plastic_cheek_style_classify.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")
# 我的订单列表
ORDERS_MY_V2_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "orders_request.yaml")
# 订单列表
ORDERS_MY_V2_DATA = os.path.join(BASE_DIR, "backend_auto/test_backend_data/orders_data", "my_v2.yaml")
#我的订单-各状态订单数量
ORDER_MY_STATUS = os.path.join(BASE_DIR, "backend_auto/test_backend_data/orders_data", "my_status.yaml")
LOGIN_PASSWD = os.path.join(BASE_DIR, "backend_auto/test_backend_data/accounts_data", "login_passwd.yaml")
LOGIN_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "accounts_request.yaml")
#医院主页详情
HDYAML_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "hospitals_request.yaml")
HOSPITAL_DETAIL = os.path.join(BASE_DIR, "backend_auto/test_backend_data/hospitals_data", "detail.yaml")
#医院主页医生列表
HOSPITAL_DOCTOR = os.path.join(BASE_DIR, "backend_auto/test_backend_data/hospitals_data", "doctor.yaml")
#医院主页商品列表
HOSPITAL_SERVICE_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "hospitals_v2_request.yaml")
HOSPITAL_SERVICE = os.path.join(BASE_DIR, "backend_auto/test_backend_data/hospitals_v2_data", "services.yaml")
#医院主页日记列表
HOSPITAL_DIARY_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "hospital_request.yaml")
HOSPITAL_DIARY = os.path.join(BASE_DIR, "backend_auto/test_backend_data/hospital_data", "diary.yaml")
#医生/医院主页-医生/医院说列表
DOCTOR_ARTICLE_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "doctor_request.yaml")
DOCTOR_ARTICLE = os.path.join(BASE_DIR, "backend_auto/test_backend_data/doctor_data", "article.yaml")
#医生主页详情
DOCTOR_DETAIL = os.path.join(BASE_DIR, "backend_auto/test_backend_data/doctor_data", "detail.yaml")
#医生主页案例列表
DOCTOR_DIARY = os.path.join(BASE_DIR, "backend_auto/test_backend_data/doctor_data", "diary.yaml")
#医生主页商品列表
DOCTOR_V2_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "doctor_v2_request.yaml")
DOCTOR_V2_SERVICE = os.path.join(BASE_DIR, "backend_auto/test_backend_data/doctor_v2_data", "services.yaml")
#医生/医院主页-问答列表
USER_ANSWER_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "user_request.yaml")
USER_ANSWER = os.path.join(BASE_DIR, "backend_auto/test_backend_data/user_data", "answer.yaml")
#购物车列表
SHOPCART_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "shopcart_request.yaml")
SHOPCART_LIST = os.path.join(BASE_DIR, "backend_auto/test_backend_data/shopcart_data", "list.yaml")
#购物车-猜你喜欢列表
JANUS_MINE_GUESS_YOU_LIKE = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_data", "mine_guess_you_like.yaml")
#消息列表
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")
#消息页未读数
UNREAD_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "notification_request.yaml")
UNREAD = os.path.join(BASE_DIR, "backend_auto/test_backend_data/notification_data", "unread.yaml")
#标记为已读
READALL = os.path.join(BASE_DIR, "backend_auto/test_backend_data/notification_data", "readall.yaml")
#咨询顾问相关
CONVERSATION_DETAIL_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "im_request.yaml")
CONVERSATION_DETAIL = os.path.join(BASE_DIR, "backend_auto/test_backend_data/im_data", "conversation_detail.yaml")
AUTO_MSG = os.path.join(BASE_DIR, "backend_auto/test_backend_data/im_data", "auto_msg.yaml")
SEND_MSG = os.path.join(BASE_DIR, "backend_auto/test_backend_data/im_data", "send_msg.yaml")
#发送消息
PRIVATE_CONVERSATION_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "private_conversation_request.yaml")
PRIVATE_CONVERSATION = os.path.join(BASE_DIR, "backend_auto/test_backend_data/private_conversation_data", "private_conversation.yaml")
HOME_V5_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "service_request.yaml")
HOME_V5=os.path.join(BASE_DIR,"backend_auto/test_backend_data/service_data","home_v5.yaml")
PERSONAL_CENTER_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "user_request.yaml")
PERSONAL_CENTER = os.path.join(BASE_DIR, "backend_auto/test_backend_data/user_data", "personal_center.yaml")
#搜索结果页-综合/百科
CONTENTV7_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "janus_request.yaml")
CONTENTV7 = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_data", "content_v7.yaml")
#医院主页搜索
HOSPITALSEARCH_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "janus_request.yaml")
HOSPITALSEARCH = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_data", "hospital_search.yaml")
#直播
LIVEYAML_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "live_request.yaml")
#直播-获取弹幕
DANMU_V2 = os.path.join(BASE_DIR, "backend_auto/test_backend_data/live_data", "danmu_v2.yaml")
#直播-主播开播
PUSH_LIVE_INFO = os.path.join(BASE_DIR, "backend_auto/test_backend_data/live_data", "pushlive_info.yaml")
#商祥页-详情
JANUS_PRODUCT_DETAIL = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_data", "product_detail.yaml")
#商祥页-sku信息
JANUS_SKU_INFO = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_data", "sku_info.yaml")
#商祥页-收藏
SERVICE_FAVOR = os.path.join(BASE_DIR, "backend_auto/test_backend_data/service_data", "service_favor.yaml")
#商祥页-分享
SERVICES_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "services_request.yaml")
SERVICES_SHARE_DATA = os.path.join(BASE_DIR, "backend_auto/test_backend_data/services_data", "share_data.yaml")
#商祥页-加入购物车
SHOPCART_ADD = os.path.join(BASE_DIR, "backend_auto/test_backend_data/shopcart_data", "add.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")
#商祥页-优惠券列表-领取
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")
#商祥页-美券列表-我的美券点击-744版本及以后-新接口
PRODUCT_COUPON_MY_LIST = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_data", "product_coupon_my_list.yaml")
#商祥页-推荐商品列表
HYBRID_PROMOTION_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "hybrid_promotion_request.yaml")
RELATED_SERVICE_DATA = os.path.join(BASE_DIR, "backend_auto/test_backend_data/hybrid_promotion_data", "related_service_data.yaml")
#次卡-确认订单
BEAUTY_CARD_ORDER_CONFIRM = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_data", "beauty_card_order_confirm.yaml")
#次卡-确认订单页面-修改手机号接口
BEAUTY_CARD_UPDATE_PHONE = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_data", "beauty_card_update_phone.yaml")
#次卡-提交订单
BEAUTY_CARD_ORDER_SUBMIT = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_data", "beauty_card_order_submit.yaml")
#次卡-支付平台
BEAUTY_CARD_PAYMENT_METHOD = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_data", "beauty_card_payment_method.yaml")
#次卡-微信支付
BEAUTY_CARD_PREPAY_WECHAT = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_data", "beauty_card_prepay_wechat.yaml")
#次卡-支付宝支付
BEAUTY_CARD_PREPAY_ALIPAY = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_data", "beauty_card_prepay_alipay.yaml")
#次卡-订单详情
BEAUTY_CARD_PAYMENT_DETAIL = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_data", "beauty_card_payment_detail.yaml")
#次卡-取消订单
BEAUTY_CARD_PAYMENT_DELETE = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_data", "beauty_card_payment_delete.yaml")
#次卡-申请退款
BEAUTY_CARD_REFUND_INFO = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_data", "beauty_card_refund_info.yaml")
#次卡-提交退款申请
BEAUTY_CARD_REFUND_SUBMIT = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_data", "beauty_card_refund_submit.yaml")
# 次卡订单详情页(未使用 部分使用 和 已使用)
BEAUTY_CARD_ORDER_DETAIL_DATA = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_data", "beauty_card_order_detail.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")
#品类聚合页面商品列表
TAG_SERVICE_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "janus_request.yaml")
TAG_SERVICE = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_data", "tag_service.yaml")
#社区tab签到和招募活动
CONFIG_LIST_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "feed_request.yaml")
CONFIG_LIST = os.path.join(BASE_DIR, "backend_auto/test_backend_data/feed_data", "config_list.yaml")
#社区tabfeed流
COMMUNITY_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "feed_request.yaml")
COMMUNITY = os.path.join(BASE_DIR, "backend_auto/test_backend_data/feed_data", "community.yaml")
#品类聚合页面标签和专场
POLYMER_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "janus_request.yaml")
POLYMER = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_data", "polymer.yaml")
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")
#搜索首页-更美热门榜
HOT_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "search_request.yaml")
HOT = os.path.join(BASE_DIR, "backend_auto/test_backend_data/search_data", "hot.yaml")
#回答详情页点赞
VOTE = os.path.join(BASE_DIR, "backend_auto/test_backend_data/answer_data", "vote.yaml")
#回答详情页取消点赞
CANCEL_VOTE = os.path.join(BASE_DIR, "backend_auto/test_backend_data/answer_data", "cancel_vote.yaml")
#回答详情页- 一/二级评论
QUESTION_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "question_request.yaml")
REPLY_ANSWER = os.path.join(BASE_DIR, "backend_auto/test_backend_data/question_data", "reply_answer.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")
#品类聚合页面医生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")
#医生后台-发送私信
CONVERSATIONUSERID=os.path.join(BASE_DIR, "backend_auto/test_doctor_data/web_data", "conversation_user_id.yaml")
#医生后台-服务资源
ADTYPELIST=os.path.join(BASE_DIR, "backend_auto/test_doctor_data/web_data", "artemis_ad_type_list.yaml")
#医生后台-我的购物车
ADADDSHOPPINGCARTINFO=os.path.join(BASE_DIR, "backend_auto/test_doctor_data/web2_data", "artemis_ad_add_shopping_cart_info.yaml")
#医生后台-我的服务订单
ORDERLIST=os.path.join(BASE_DIR, "backend_auto/test_doctor_data/web_data", "artemis_order_list.yaml")
#医生后台-我的服务订单-已上线订单
ORDERIDDETAIL=os.path.join(BASE_DIR, "backend_auto/test_doctor_data/web_data", "artemis_order_id_detail.yaml")
#医生后台-我的服务订单-已购买订单
VALUEORDERIDDETAIL=os.path.join(BASE_DIR, "backend_auto/test_doctor_data/web2_data", "artemis_add_value_order_id_detail.yaml")
#医生后台-点点通商品-概览
CPCHOMEPAGE=os.path.join(BASE_DIR, "backend_auto/test_doctor_data/web_data", "cpc_homepage.yaml")
#更美次卡橱窗组件商品
VISUAL_BEAUTY_CARD_SERVICES_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "visual_beauty_card.yaml")
VISUAL_BEAUTY_CARD_SERVICES = os.path.join(BASE_DIR, "backend_auto/test_backend_data/visual_beauty_card_data", "visual_beauty_card_services.yaml")
#次卡商品列表组件筛选器
BEAUTYCARD_FILTERS_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "visual_beauty_card.yaml")
BEAUTYCARD_FILTERS = os.path.join(BASE_DIR, "backend_auto/test_backend_data/visual_beauty_card_data", "beautycard_filters.yaml")
#次卡商品列表组件商品
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")
PREVIEW = os.path.join(BASE_DIR, "backend_auto/test_backend_data/settlement_data", "preview_v1.yaml")
PAY_V1 = os.path.join(BASE_DIR, "backend_auto/test_backend_data/settlement_data", "pay_v1.yaml")
CREATE = os.path.join(BASE_DIR, "backend_auto/test_backend_data/settlement_data", "create_v1.yaml")
PAY = os.path.join(BASE_DIR, "backend_auto/test_backend_data/settlement_data", "pay.yaml")
SETTLEMENTDETAIL = os.path.join(BASE_DIR, "backend_auto/test_backend_data/settlement_data", "settlement_detail.yaml")
WECHARTPAYDATA = os.path.join(BASE_DIR, "backend_auto/test_backend_data/pay_data", "wechat_prepay.yaml")
ALIPAYDATA = os.path.join(BASE_DIR, "backend_auto/test_backend_data/pay_data", "alipay_prepay.yaml")
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")
#OM后台-登录
OMLOGIN_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_om_api", "login_request.yaml")
OMLOGIN = os.path.join(BASE_DIR, "backend_auto/test_om_data/om_login_data", "om_login.yaml")
#更美次卡-获取已添加页面次卡spu/sku列表
GET_RELATED_BC_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_om_api", "beautycard_request.yaml")
GET_RELATED_BC = os.path.join(BASE_DIR, "backend_auto/test_om_data/beautycard_data", "get_related_bc.yaml")
#更美次卡-删除/批量删除已添加页面次卡
DELETE_RELATED_BC_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_om_api", "beautycard_request.yaml")
DELETE_RELATED_BC = os.path.join(BASE_DIR, "backend_auto/test_om_data/beautycard_data", "delete_related_bc.yaml")
#更美次卡-已添加页面全部导出
EXPORT_RELATED_BC_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_om_api", "beautycard_request.yaml")
EXPORT_RELATED_BC = os.path.join(BASE_DIR, "backend_auto/test_om_data/beautycard_data", "export_related_bc.yaml")
#更美次卡-已添加页面全部导出
UPDATE_BC_RANK_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_om_api", "beautycard_request.yaml")
UPDATE_BC_RANK = os.path.join(BASE_DIR, "backend_auto/test_om_data/beautycard_data", "update_bc_rank.yaml")
#更美次卡-按次卡sku_id导入,导入校验
CHECK_SKU_IDS_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_om_api", "beautycard_request.yaml")
CHECK_SKU_IDS = os.path.join(BASE_DIR, "backend_auto/test_om_data/beautycard_data", "check_sku_ids.yaml")
#更美次卡-按次卡spu_id导入,导入校验
CHECK_SPU_IDS_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_om_api", "beautycard_request.yaml")
CHECK_SPU_IDS = os.path.join(BASE_DIR, "backend_auto/test_om_data/beautycard_data", "check_spu_ids.yaml")
#次卡商详页
BEAUTY_CARD_DETAIL_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "janus_request.yaml")
BEAUTY_CARD_DETAIL = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_data", "beauty_card_detail.yaml")
#次卡商详页-适应机构列表
SERVICE_HOSPITAL_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "janus_request.yaml")
SERVICE_HOSPITAL = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_data", "service_hospital.yaml")
#免费招募背景图片
FREE_RECRUIT_BANNER_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "feed_request.yaml")
FREE_RECRUIT_BANNER = os.path.join(BASE_DIR, "backend_auto/test_backend_data/feed_data", "free_recruit_banner.yaml")
#免费招募活动列表
FREE_RECRUIT_LIST_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "feed_request.yaml")
FREE_RECRUIT_LIST = os.path.join(BASE_DIR, "backend_auto/test_backend_data/feed_data", "free_recruit_list.yaml")
#直播-点击【设置封面】
PAGE_RULES_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "janus_request.yaml")
PAGE_RULES = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_data", "page_rules.yaml")
if __name__ == '__main__':
print("==========",LIVEYAML_CONFIG)
## 项目规划
### 项目划分
- 总分支 master
- 公共分支 common_dev
- 其他分支 参与项目的人每人创建一个已自己名字命名的分支,格式 dyy_dev
### 提交代码及编写规范
- !!!切记一,在本地写代码时,一定要再三确认是在自己的分支进行改动,不要在master分支修改
- !!!切记二:提交代码,Git add时,不要添加in_common文件里面的文件,这个是公共方法,不能随意改动,如果本地误改动了,提交后,会影响整个流程
- 为了便于项目的管理维护,参与者可以将自己的代码确保运行成功的前提下,提交到自己分支,然后每周往commo_dev
分支提交代码,负责人会将common_dev分支每周往master分支合并,参与者可每周一更新本地代码,确保自己的代码是最新的
- 本地代码提交Git仓库时,避免已经上传的代码被覆盖,请Git push之前,先操作git pull,在本地解决好冲突后,再Git push
### 项目分类及维护
- 项目围绕backend进行自动化测试,所以针对项目的分类以及命名,大家尽量以下面的规则维护
![](.readme_images/all_backend_api中Py文件class命名.png)
!![](.readme_images/项目all_backend_api命名规则.png)
![](.readme_images/test_case命名规则.png)
![](.readme_images/data命名规则.png)
- 下图是Charles的接口截图,文件夹分组以红框路径为一组
![](.readme_images/Charles参考截图.png)
### 项目文件的作用
- all_backend_api文件主要放backend请求接口的请求方法和请求参数
- in_common 文件主要放一些公用方法
- test_backend_case 文件主要针对接口请求的返回值做断言
- test_backend_data 文件主要放测试用例的case
- host.yaml 维护测试环境的配置文件
- path_setting.py 文件主要是配置yaml文件的读取路径
- login_session_function.py 文件主要提供获取session的功能,方便需登录的接口获取session 2021-4-19新增
- login_session_function.yaml login_session_function.py文件需要登录的数据 2021-4-19新增
- run.py 统一执行入口
### 关于yaml文明书写的注意事项 2021-4-19新增
- yaml文件对空格换行要求非常严格,所以书写时要特别注意
![](.readme_images/yaml文件错误示范.png)
### 如何写一个用例
- 先在all_backend_api下找到对应的模块,比如我写节点account下面的接口,那就找到account_request.py这个文件,写接口请求
```python
def 接口名(self,对应接口参数,对应接口参数):
self.params["参数名"] = 参数名
self.params["参数名"] = 参数名
self.params["参数名"] = 参数名
return self.api_send(self.data["yaml文件中的key"])
# self.data读取的是account_request.yaml文件中的数据
# self.data["yaml文件中的key"]中的key是yaml文件中的login_vfc
```
![](.readme_images/request请求方法.png)
- 并且需要在该类中,读取path_setting路径中,配置的接口的yaml数据文件
![](.readme_images/接口yaml数据读取.png)
- 然后在account_request.yaml中写接口请求数据(接口路径,传参),结构如图
![](.readme_images/yaml文件.png)
- 然后写test_data,在test_backend_data目录下,找到account_data文件,创建yaml文件,yaml文件格式介绍,如图
![](.readme_images/yaml.png)
- 将用例的路径放到path_setting.py下,这里面有2个路径需要放到里面,第一个是all_backend_api下创建的XXX_request.yaml文件
第二个是test_backend_case下创建的XXX.yaml文件
![](.readme_images/路径.png)
- 接下来写test_case,同样在test_backend_case中找到对应的模块,以account节点为例,在account_case下创建以test开头的文件,
test_login_vfc.py(必须以test开头,pytest识别用例是根据这个关键字查找),方法构成见下图
![](.readme_images/测试用例.png)
- 如果切换环境,可以将host.py文件的域名更换
- 运行测试用例,需要先在pycharm的设置里面,改成pytest
![](.readme_images/pytest.png)
- 然后对应的用例类名前面就有绿色小三角,点击一下就可以运行了
![](.readme_images/运行pytest.png)
- 运行结果如图,可以看出来运行的接口是什么,用例名写清楚可以一目了然看到执行的case
![](.readme_images/用例结果.png)
attrs==20.3.0
certifi==2020.12.5
chardet==4.0.0
idna==2.10
importlib-metadata==3.7.3
iniconfig==1.1.1
jsonpath==0.82
packaging==20.9
pluggy==0.13.1
py==1.10.0
pyparsing==2.4.7
pytest==6.2.2
PyYAML==5.4.1
requests==2.25.1
toml==0.10.2
typing-extensions==3.7.4.3
urllib3==1.26.4
zipp==3.4.1
from test_backend_case.account_case import test_login_vfc
import pytest
pytest.main()
\ 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.account_request import account_request
class TestLoginVfc:
data = BaseRequest().api_load(path_setting.LOGIN_VFC)
loginvfc_case, loginvfc_data = get_ids(data, "login_vfc")
@pytest.mark.parametrize("param",loginvfc_data,ids=loginvfc_case)
def test_login_vfc(self,param):
print(param["vfc_code"])
r = account_request().login_vfc(param["current_city_id"], param["phone_num"], param["vfc_code"])
if r["error"] == 0:
assert r["data"]["account_phone"] == param["assert"]
if r["error"] == 1:
assert r["message"] == param["assert"]
from in_common.base_request import BaseRequest
import path_setting
from ids_list import get_ids
import pytest
from all_backend_api.thirdphonelogin_request import *
class TestThirdPhoneLogin:
data = BaseRequest().api_load(path_setting.THIRD_PHONE_LOGIN)
thirdphonelogin_case,thirdphonelogin_data = get_ids(data,"login_thirdphone")
@pytest.mark.parametrize("param",thirdphonelogin_data,ids = thirdphonelogin_case)
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.accounts_request import send_reqest
class TestLoginPasswd:
data = BaseRequest().api_load(path_setting.LOGIN_PASSWD)
loginpasswd_case, loginpasswd_data = get_ids(data, "password")
@pytest.mark.parametrize("param",loginpasswd_data,ids=loginpasswd_case)
def test_login_passwd(self,param):
print(param["password"])
r = send_reqest().login_passwd(param["current_city_id"], param["phone"], param["password"])
if r["error"] == 1:
assert r["message"] == param["assert"]
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.answer_request import answer_request
class TestCancelVote:
data = BaseRequest().api_load(path_setting.CANCEL_VOTE)
cancelvote_case, cancelvote_data = get_ids(data, "cancel_vote")
@pytest.mark.parametrize("param", cancelvote_data, ids=cancelvote_case)
def test_cancel_vote(self, param):
r = answer_request().cancel_vote(param["answer_id"])
if r["error"] == 1:
assert r["message"] == param["assert"]
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.account_request import account_request
class TestLoginVfc:
data = BaseRequest().api_load(path_setting.LOGIN_VFC)
loginvfc_case, loginvfc_data = get_ids(data, "login_vfc")
@pytest.mark.parametrize("param",loginvfc_data,ids=loginvfc_case)
def test_login_vfc(self,param):
print(param["vfc_code"])
r = account_request().login_vfc(param["current_city_id"], param["phone_num"], param["vfc_code"])
if r["error"] == 0:
assert r["data"]["account_phone"] == param["assert"]
if r["error"] == 1:
assert r["message"] == param["assert"]
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.answer_request import answer_request
class TestVote:
data = BaseRequest().api_load(path_setting.VOTE)
vote_case, vote_data = get_ids(data, "vote")
@pytest.mark.parametrize("param", vote_data, ids=vote_case)
def test_vote(self, param):
r = answer_request().vote(param["answer_id"])
if r["error"] == 1:
assert r["message"] == param["assert"]
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.common_request import common_request
class TestReply:
data = BaseRequest().api_load(path_setting.DIARY_COMMON_REPLY)
diary_common_reply_case, diary_common_reply_data = get_ids(data, "common_reply")
@pytest.mark.parametrize("param", diary_common_reply_data, ids=diary_common_reply_case)
def test_reply(self, param):
# 日记贴的评论列表
r = common_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 "" # 是否点赞
assert r["data"]["reply_data"][0]["_type"] == param["type"] # 校验评论列表返回类型
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.common_request import common_request
class TestRrplySubReply:
data = BaseRequest().api_load(path_setting.TOPIC_SUB_COMMON)
topic_sub_common_case, topic_sub_common_data = get_ids(data, "topic_sub_common")
@pytest.mark.parametrize("param", topic_sub_common_data, ids=topic_sub_common_case)
def test_reply_sub_reply(self, param):
# print(2)
r = common_request().topic_sub_common(param["id"], param["type"], param["reply_id"])
# print(r)
if r["error"] == 0:
assert r["error"] == param["assert1"]
# 先判断有没有评论,然后判断里面需要的那些字段,如点赞字段,评论总数等,不传值,传空值
if r["data"]:
assert r["data"][0]["at_user_id"] is not None and r["data"][0]["at_user_id"] is not "" # 用户id
assert r["data"][0]["comment_user_gm_url"] is not None and r["data"][0]["comment_user_gm_url"] is not "" # 点击评论跳转链接
assert r["data"][0]["at_user_gm_url"] is not None and r["data"][0]["at_user_gm_url"] is not "" # 用户名跳转链接
assert r["data"][0]["nickname"] is not None and r["data"][0]["nickname"] is not "" # 用户名
assert r["data"][0]["content"] is not None and r["data"][0]["content"] is not "" # 评论内容
assert r["data"][0]["comment_user_id"] is not None and r["data"][0]["comment_user_id"] is not "" # 评论人
assert r["data"][0]["comment_id"] is not None and r["data"][0]["comment_id"] is not "" # 评论id
assert r["data"]["reply_data"][0]["_type"] == param["type"] # 校验评论列表返回类型
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.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.conversation_request import conversation_request
class TestMessageRead:
data = BaseRequest().api_load(path_setting.MESSAGE_READ)
#conversation_case, conversation_data = get_ids(data, "message_read")
messageread_case, messageread_data = get_ids(data, "message_read")
@pytest.mark.parametrize("param",messageread_data,ids=messageread_case)
def test_message_read(self,param):
r = conversation_request().message_read(param["current_city_id"], param["release"], param["message_ids"])
if r["error"] == 0:
assert r["data"]["success"] == param["assert"]
#if r["error"] == 0:
# success = r.get("data").get("success", "")
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.diary_request import diary_request
class TestFavor:
data = BaseRequest().api_load(path_setting.DIARY_FAVOR)
diary_favor_case, diary_favor_data = get_ids(data, "diary_favor")
@pytest.mark.parametrize("param", diary_favor_data, ids=diary_favor_case)
def test_favor(self, param):
r = diary_request().diary_isfavor()
# print(r)
if r["error"] == 0:
assert r["message"] == param["assert"]
if r["error"] == 1:
assert r["message"] ==param["assert2"]
r = diary_request().diary_cancelfavor()
# print(r)
if r["error"] == 0:
assert r["message"] == param["assert3"]
if r["error"] == 1:
assert r["message"] == param["assert2"]
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.diary_request import diary_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_request().diary_operation(param["diary_id"], param["title"], param["operation_timestamp"], param["doctor_name"], param["hospital_name"])
result = diary_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_request import diary_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_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_request import diary_request
class TestTopicData:
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_topic_data(self,param):
# print(2)
r = diary_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_request import diary_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_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 all_backend_api.doctor_request import doctor_request
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
class TestArticle:
data = BaseRequest().api_load(path_setting.DOCTOR_ARTICLE)
article_case, article_data = get_ids(data, "article")
@pytest.mark.parametrize("param", article_data, ids=article_case)
def test_article(self, param):
r = doctor_request().article(param["doctor_id"])
if r["error"] == 0:
assert r["error"] == param["assert_error"]
import pytest
from all_backend_api.doctor_request import doctor_request
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
class TestDetail:
data = BaseRequest().api_load(path_setting.DOCTOR_DETAIL)
detail_case, detail_data = get_ids(data, "detail")
@pytest.mark.parametrize("param", detail_data, ids=detail_case)
def test_detail(self, param):
r = doctor_request().detail()
if r["error"] == 0:
assert r["error"] == param["assert_error"]
import pytest
from all_backend_api.doctor_request import doctor_request
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
class TestDiary:
data = BaseRequest().api_load(path_setting.DOCTOR_DIARY)
diary_case, diary_data = get_ids(data, "diary")
@pytest.mark.parametrize("param", diary_data, ids=diary_case)
def test_diary(self, param):
r = doctor_request().diary(param["doctor_id"])
if r["error"] == 0:
assert r["error"] == param["assert_error"]
import pytest
from all_backend_api.doctor_v2_request import doctor_v2_request
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
class TestServices:
data = BaseRequest().api_load(path_setting.DOCTOR_V2_SERVICE)
services_case, services_data = get_ids(data, "services")
@pytest.mark.parametrize("param", services_data, ids=services_case)
def test_services(self, param):
r = doctor_v2_request().services()
if r["error"] == 0:
assert r["error"] == param["assert_error"]
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.eyelids_request import eyelids_request
class TestDiaryCards:
data = BaseRequest().api_load(path_setting.EYELIDS_DIARY_CARDS_DATA)
eyelidsDiaryCards_case, eyelidsDiaryCards_data = get_ids(data, "diary_cards")
@pytest.mark.skip("跳过目前测试环境没有数据-------------------")
@pytest.mark.parametrize("param",eyelidsDiaryCards_data,ids=eyelidsDiaryCards_case)
def test_diary_cards(self,param):
r = eyelids_request().diary_cards(param["current_city_id"], param["page"], param["page_size"],param["tag_names"])
assert r["error"] == 0
assert len(r["data"]) == 10
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.face_request import face_request
class TestDiaryCards:
data = BaseRequest().api_load(path_setting.FACE_DIARY_CARDS_DATA)
FaceDiaryCards_case, FaceDiaryCards_data = get_ids(data, "diary_cards")
@pytest.mark.parametrize("param",FaceDiaryCards_data,ids=FaceDiaryCards_case)
def test_diary_cards(self,param):
r = face_request().diarys_cards(param["facial_type2tag_names"])
if r["error"] == 0:
feed = r["data"]
assert len(feed) == param["assert_feed_nums"]
for key in feed:
diary_cards = feed[key]
assert diary_cards["__source"] == "diary"
assert diary_cards["title"] is not None
assert diary_cards["desc"] is not None
assert diary_cards["diary"] is not None
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.face_request import face_request
class TestPlasticFeeds:
data = BaseRequest().api_load(path_setting.FACE_PLASTIC_FEEDS_DATA)
plasticfeeds_case, plasticfeeds_data = get_ids(data, "plastic_feeds")
@pytest.mark.skip("跳过,高版本会转化标签,测试环境策略没有数据,线上正常")
@pytest.mark.parametrize("param",plasticfeeds_data,ids=plasticfeeds_case)
def test_plastic_feeds(self,param):
r = face_request().plastic_feeds(param["tag_id"], param["face_id"], param["tag_id_list"], param["page_size"], param["version"])
if r["error"] == 0:
features = r["data"]["features"]
assert len(features) == param["assert_num"]
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.feed_request import feed_request
class TestCommunity:
data = BaseRequest().api_load(path_setting.COMMUNITY)
community_case, community_data = get_ids(data, "community")
@pytest.mark.parametrize("param", community_data, ids=community_case)
def test_community(self, param):
r = feed_request().community(param["version"], param["tabtype"], param["tags_id"], param["tab_id"])
if r["error"] == 0:
assert r["data"]["features"][0] != param["assert"]
# else:
# assert r["data"]["config_list"][0]["type"] == param["assert1"]
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.feed_request import feed_request
class TestConfigList:
data = BaseRequest().api_load(path_setting.CONFIG_LIST)
configlist_case, configlist_data = get_ids(data, "config_list")
@pytest.mark.parametrize("param",configlist_data,ids=configlist_case)
def test_config_list(self,param):
r = feed_request().config_list(param["version"])
if r["error"] == 0:
assert r["data"]["config_list"][0]["type"] != param["assert"]
# else:
# assert r["data"]["config_list"][0]["type"] == param["assert1"]
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.feed_request import feed_request
class TestFreeRecruitBanner:
data = BaseRequest().api_load(path_setting.FREE_RECRUIT_BANNER)
free_recruit_banner_case, free_recruit_banner_data = get_ids(data, "free_recruit_banner")
@pytest.mark.parametrize("param", free_recruit_banner_data, ids=free_recruit_banner_case)
def test_free_recruit_case(self, param):
r = feed_request().free_recruit_banner(param["version"], param["json"])
if r["error"] == 0:
assert r["data"]["banner"] != param["assert"]
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.feed_request import feed_request
class TestFreeRecruitList:
data = BaseRequest().api_load(path_setting.FREE_RECRUIT_LIST)
free_recruit_list_case, free_recruit_list_data = get_ids(data, "free_recruit_list")
@pytest.mark.parametrize("param", free_recruit_list_data, ids=free_recruit_list_case)
def test_free_recruit_list(self, param):
r = feed_request().free_recruit_list(param["version"], param["json"], param["tab_type"], param["page"],param["size"])
if r["error"] == 0:
assert r["data"]["free_recruits"] != param["assert"]
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.feed_request import feed_request
class TestIndexV9:
data = BaseRequest().api_load(path_setting.FEED_INDEXV9_DATA)
indexv9_case, indexv9_data = get_ids(data, "index_v9")
@pytest.mark.parametrize("param",indexv9_data,ids=indexv9_case)
def test_index_v9(self,param):
r = feed_request().index_v9(param["tabtype"], param["version"], param["current_city_id"])
if r["error"] == 0:
features = r.get("data").get("features",[])
assert len(features) > 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 ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.gmai_request import gmai_request
# 模拟双眼皮效果
class TestEyelidsPlastic:
data = BaseRequest().api_load(path_setting.GMAI_EYELIDS_PLASTIC_DATA)
eyelidsplastic_case, eyelidsplastic_data = get_ids(data, "eyelids_plastic")
@pytest.mark.parametrize("param",eyelidsplastic_data,ids=eyelidsplastic_case)
def test_skinnewReport(self,param):
r = gmai_request().eyelids_plastic(param["version"], param["image_url"],param["style_id"])
assert r["error"] == 0
print("模拟双眼皮效果图片: ",r["data"]["plastic_image_url"])
\ 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.gmai_request import gmai_request
# 3D变脸
class TestPlasticnAnalysisV2:
data = BaseRequest().api_load(path_setting.GMAI_PLASTIC_ANALYSIS_V2_DATA)
plasticanalysisv2_case, plasticanalysisv2_data = get_ids(data, "analysis_v2")
@pytest.mark.parametrize("param",plasticanalysisv2_data,ids=plasticanalysisv2_case)
def test_plastic_analysis_v3(self,param):
r = gmai_request().plastic_analystic_v2(param["device_id"], param["image_url"], param["landmark"],param["cheek_style_classify_id"])
if r["error"] == 0:
faces = r["data"]["faces"]
assert len(faces) > 0, f'3D变脸没有返回风格脸,请查看 {len(faces)}'
# 分析信息,取默认第一条
card_info = faces[0]["card_info"]
analyze = card_info.get("analyze")
level = card_info.get("level")
# content = card_info.get("content")
print(analyze,level)
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.gmai_request import gmai_request
# AI测颜值,目前测试环境没有召回日记,先保证请求成功
class TestPlasticnAnalysisV3:
data = BaseRequest().api_load(path_setting.GMAI_PLASTIC_ANALYSIS_V3_DATA)
plasticanalysisv3_case, plasticanalysisv3_data = get_ids(data, "analysis_v3")
@pytest.mark.parametrize("param",plasticanalysisv3_data,ids=plasticanalysisv3_case)
def test_plastic_analysis_v3(self,param):
r = gmai_request().plastic_analysis_v3(param["device_id"], param["image_url"], param["landmark"] ,param["cheek_style_classify_id"])
assert r["error"] == 0
\ 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.gmai_request import gmai_request
# 3D变脸
class TestPlasticChecckStyleClasstify:
data = BaseRequest().api_load(path_setting.GMAI_PLASTIC_CHECCK_STYLE_CLASSTIFY_DATA)
plasticchecckstyleclasstify_case, plasticchecckstyleclasstify_data = get_ids(data, "plastic_cheek_style_classify")
@pytest.mark.parametrize("param",plasticchecckstyleclasstify_data,ids=plasticchecckstyleclasstify_case)
def test_plastic_cheek_style_classify(self,param):
r = gmai_request().plastic_cheek_style_classify(param["version"])
if r["error"] == 0:
classifies = r["data"]["classifies"]
assert len(classifies) > param["assert"]
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.gmai_request import gmai_request
# 模拟发型,眉毛,美瞳
class TestSimulateAnalyze:
data = BaseRequest().api_load(path_setting.GMAI_SIMULATE_ANALYZE_DATA)
simulateanalyze_case, simulateanalyze_data = get_ids(data, "simulate_analyze")
@pytest.mark.parametrize("param",simulateanalyze_data,ids=simulateanalyze_case)
def test_plastic_analysis_v3(self,param):
r = gmai_request().simulate_analyze(param["device_id"], param["image_url"], param["style_id"] ,param["type_id"])
assert r["error"] == 0
print("效果图: ", r["data"]["plastic_image_url"])
\ 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.gmai_request import gmai_request
# 获取模拟整形相关配置数据,双眼皮,美瞳,眉毛和发型
class TestSimulateConf:
data = BaseRequest().api_load(path_setting.GMAI_SIMULATE_CONF_DATA)
simulateconf_case, simulateconf_data = get_ids(data, "simulate_conf")
@pytest.mark.parametrize("param",simulateconf_data,ids=simulateconf_case)
def test_plastic_conf(self,param):
r = gmai_request().simulate_conf(param["type_id"])
assert r["error"] == 0
# 模拟发型数据,发型类型
hairdos = r["data"]["hairdo_configs"]["hairdos"]
assert len(hairdos) > 0
# 美瞳
colorcon = r["data"]["colorcon_configs"]["colorcon"]
# 眉毛
eyebrow = r["data"]["eyebrow_configs"]["eyebrow"]
# 双眼皮
eyelids = r["data"]["eyelid_configs"]["eyelids"]
\ 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.gmai_request import gmai_request
# 测肤结果页
class TestSkinNewReport:
data = BaseRequest().api_load(path_setting.GMAI_SKIN_NEWREPORT_DATA)
skinnewReport_case, skinnewReport_data = get_ids(data, "skin_newReport")
@pytest.mark.parametrize("param",skinnewReport_data,ids=skinnewReport_case)
def test_skinnewReport(self,param):
r = gmai_request().skin_newReport(param["version"], param["image_url"])
if r["error"] == 0:
data = r.get("data")
# 大家都在买
packages = data.get("packages")
assert len(packages) == 6
# 皮肤检测结果
disadvantage_tabs = data.get("disadvantage_tabs")
result_word = disadvantage_tabs[0].get("result_word")
assert result_word == "色素型黑眼圈"
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.gmai_request import gmai_request
# 测肤结果页
class TestSkinUserHadTest:
data = BaseRequest().api_load(path_setting.GMAI_SKIN_USER_HAD_TEST_DATA)
skinhadtest_case, skinhadtest_data = get_ids(data, "skin_user_had_test")
@pytest.mark.parametrize("param", skinhadtest_data, ids=skinhadtest_case)
def test_skin_user_hadused(self, param):
r = gmai_request().skin_user_had_test(param["device_id"])
if r["error"] == 0:
data = r.get("data").get("user_have_scan_skin")
assert data is param["assert"]
import pytest
from all_backend_api.hospital_request import hospital_request
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
class TestDiary:
data = BaseRequest().api_load(path_setting.HOSPITAL_DIARY)
diary_case, diary_data = get_ids(data, "diary")
@pytest.mark.parametrize("param", diary_data, ids=diary_case)
def test_diary(self, param):
r = hospital_request().diary(param["hospital"])
if r["error"] == 0:
assert r["error"] == param["assert_error"]
import pytest
from all_backend_api.hospitals_request import hospitals_request
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
class TestDetail:
data = BaseRequest().api_load(path_setting.HOSPITAL_DETAIL)
detail_case, detail_data = get_ids(data, "detail")
@pytest.mark.parametrize("param", detail_data, ids=detail_case)
def test_detail(self, param):
r = hospitals_request().detail()
assert r["error"] == param["assert_error"]
assert r["data"]["base_info"]["hospital_name"] == param["assert"]
assert r["data"]["base_info"]["good_at"][0] == param["assert1"]
assert r["data"]["base_info"]["hospital_type"] == param["assert2"]
assert r["data"]["buy_related"]["gifts"][0]["gift_id"] == param["assert3"]
assert r["data"]["tab"] == param["assert4"]
assert r["data"]["image_header_area"]["hospital_images"][0] == param["assert5"]
import pytest
from all_backend_api.hospitals_request import hospitals_request
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
class TestDoctor:
data = BaseRequest().api_load(path_setting.HOSPITAL_DOCTOR)
doctor_case, doctor_data = get_ids(data, "doctor")
@pytest.mark.parametrize("param", doctor_data, ids=doctor_case)
def test_doctor(self, param):
r = hospitals_request().doctor()
assert r["error"] == param["assert_error"]
assert r["data"][0]["id"] == param["assert_id"]
assert r["data"][0]["doctor_name"] == param["assert_name"]
assert r["data"][0]["good_at"][0] == param["assert_good_at"]
assert r["data"][0]["cases"][0]["name"] == param["assert_cases"]
assert r["data"][0]["title"] == param["assert_title"]
import pytest
from all_backend_api.hospitals_v2_request import hospitals_v2_request
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
class TestServices:
data = BaseRequest().api_load(path_setting.HOSPITAL_SERVICE)
services_case, services_data = get_ids(data, "services")
@pytest.mark.parametrize("param", services_data, ids=services_case)
def test_detail(self, param):
r = hospitals_v2_request().services()
if r["error"] == 0:
assert r["error"] == param["assert_error"]
# assert r["data"]["services"][0]["service_item_id"] == param["assert_sku"]
# assert r["data"]["services"][0]["service_id"] == param["assert_spu"]
# assert r["data"]["services"][0]["price_info"]["has_discount"] == param["assert_discount"]
# assert r["data"]["services"][0]["sales_info"][0]["type"] == param["assert_sales"]
# assert r["data"]["services"][0]["exposure"]["card_type"] == param["assert_card_type"]
# assert r["data"]["services"][0]["title"] == param["assert_title"]
# assert r["data"]["tag_distribution"][0]["selected"] == param["assert_tagselected"]
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.hybrid_api_topic_request import hybrid_api_topic_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_api_topic_vote(self, param):
# print(111)
# print(diary_vote_case)
r = hybrid_api_topic_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 = hybrid_api_topic_request().diary_vote(param["id"])
assert vote["error"] == 0
# 校验二次点赞无效
vote = hybrid_api_topic_request().diary_vote(param["id"])
assert vote["message"] == param["assert3"]
assert vote["error"] == 1
# 取消点赞,回到取消点赞的状态
canclevote = hybrid_api_topic_request().diary_canclevote(param["id"])
assert canclevote["error"] == 0
else:
# 如果是已经点过赞的状态就直接取消点赞
# print(111)
canclevote = hybrid_api_topic_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 ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.hybrid_diary_request import hybrid_diary_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 = hybrid_diary_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.hybrid_request import hybrid_request
class TestQuestionNewAnswerLiist:
data = BaseRequest().api_load(path_setting.ANSWER_LIST)
test_case, test_data = get_ids(data, "question_new_answer_list")
@pytest.mark.parametrize("param", test_data, ids=test_case)
def test_question_v1(self, param):
r = hybrid_request().question_new_answer_list(param["question_id"])
if r["error"] == 0:
if r["data"]["answers_list"]:
# 看下是否有回答
assert r["data"]["answer_total_nums"] is not None and r["data"]["answer_total_nums"] is not ""
assert r["data"]["answers_list"][0]["is_author"] is not None and r["data"]["answers_list"][0]["is_author"] is not ""
assert r["data"]["answers_list"][0]["content_level"] is not None and r["data"]["answers_list"][0]["content_level"] is not ""
assert r["data"]["answers_list"][0]["first_reply_count"] is not None and r["data"]["answers_list"][0]["first_reply_count"] is not ""
assert r["data"]["answers_list"][0]["content"] is not None and r["data"]["answers_list"][0]["content"] is not ""
assert r["data"]["answers_list"][0]["comment_count"] is not None and r["data"]["answers_list"][0]["comment_count"] is not ""
assert r["data"]["answers_list"][0]["like_num"] is not None and r["data"]["answers_list"][0]["like_num"] is not ""
assert r["data"]["answers_list"][0]["is_voted"] is not None and r["data"]["answers_list"][0]["is_voted"] is not ""
assert r["data"]["answers_list"][0]["id"] is not None and r["data"]["answers_list"][0]["id"] is not ""
assert r["data"]["answers_list"][0]["answer_id"] is not None and r["data"]["answers_list"][0]["answer_id"] is not ""
else:
assert r["message"] == param["message"]
assert r["message"] == param["message"]
# 如果没有点过赞,就先校验点赞之后再取消点赞。【最后保持取消点赞的状态】
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.hybrid_request import hybrid_request
class TestQuestionV1:
data = BaseRequest().api_load(path_setting.QUESTION_DETAIL)
test_case, test_data = get_ids(data, "question_v1")
@pytest.mark.parametrize("param", test_data, ids=test_case)
def test_question_v1(self, param):
r = hybrid_request().question_v1()
assert r["error"] == param["error"]
if r["error"] == 0:
assert r["config"]["has_login"] is not None and r["config"]["has_login"] is not ""
assert r["config"]["url_base"] is not None and r["config"]["url_base"] is not ""
assert r["config"]["host_url"] is not None and r["config"]["host_url"] is not ""
assert r["data"]["is_favored"] is not None and r["data"]["is_favored"] is not ""
assert r["data"]["answer_count"] is not None and r["data"]["answer_count"] is not ""
assert r["data"]["answer_level_lte2_nums"] is not None and r["data"]["answer_level_lte2_nums"] is not ""
assert r["data"]["answer_level_gte3_nums"] is not None and r["data"]["answer_level_gte3_nums"] is not ""
assert r["data"]["is_following"] is not None and r["data"]["is_following"] is not ""
assert r["data"]["id"] is not None and r["data"]["id"] is not ""
assert r["data"]["title"] is not None and r["data"]["title"] is not ""
assert r["data"]["content"] is not None and r["data"]["content"] is not ""
# 如果没有点过赞,就先校验点赞之后再取消点赞。【最后保持取消点赞的状态】
import pytest
from 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.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 all_backend_api.hybrid_gift_list_request import hybrid_gift_list_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.GIFT_LIST_DATA)
gift_list_data_case, gift_list_data_data = get_ids(data, "gift_list_data")
@pytest.mark.parametrize("param", gift_list_data_data, ids=gift_list_data_case)
def test_gift_list_data(self, param):
r = hybrid_gift_list_request().gift_list_data(param["service_id"], param["gift_type"], param["page"])
if r["error"] == 0:
assert r["error"] == param["assert_error"]
import pytest
from all_backend_api.hybrid_promotion_request import hybrid_promotion_request
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
class TestTelatedServiceData:
data = BaseRequest().api_load(path_setting.RELATED_SERVICE_DATA)
related_service_data_case, related_service_data_data = get_ids(data, "related_service_data")
@pytest.mark.parametrize("param", related_service_data_data, ids=related_service_data_case)
def test_related_service_data(self, param):
r = hybrid_promotion_request().related_service_data(param["service_id"], param["page"])
if r["error"] == 0:
assert r["error"] == param["assert_error"]
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.im_request import im_request
class TestAutoMsg:
data = BaseRequest().api_load(path_setting.AUTO_MSG)
automsg_case, automsg_data = get_ids(data, "auto_msg")
@pytest.mark.parametrize("param",automsg_data,ids=automsg_case)
def test_auto_msg(self,param):
r = im_request().auto_msg(param["trace_id"], param["conversation_id"])
if r["error"] == 0:
assert r["data"]["send_result"] == param["assert"]
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.im_request import im_request
class TestConversationDetail:
data = BaseRequest().api_load(path_setting.CONVERSATION_DETAIL)
conversationdetail_case, conversationdetail_data = get_ids(data, "conversation_detail")
@pytest.mark.parametrize("param",conversationdetail_data,ids=conversationdetail_case)
def test_conversation_detail(self,param):
r = im_request().conversation_detail(param["current_city_id"], param["begin_msg_id"], param["conversation_type"], param["end_msg_id"], param["referrer"])
if r["error"] == 0:
msg_list = r.get("data").get("msg_list",[])
assert len(msg_list) > param["assert"]
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.im_request import im_request
class TestSendMsg:
data = BaseRequest().api_load(path_setting.SEND_MSG)
sendmsg_case, sendmsg_data = get_ids(data, "send_msg")
@pytest.mark.parametrize("param", sendmsg_data, ids=sendmsg_case)
def test_send_msg(self, param):
r = im_request().send_msg(param["conversation_id"], param["is_system"], param["referrer"], param["referrer_id"], param["msg_type"], param["content"], param["extra"])
print(r)
if r["error"] == 0:
assert r["data"]["conversation_type"] == param["assert_conversation_type"]
assert r["data"]["message_type"] == param["assert_message_type"]
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.janus_request import janus_request
class TestBeautyCardDetail:
data = BaseRequest().api_load(path_setting.BEAUTY_CARD_DETAIL)
beauty_card_detail_case, beauty_card_detail_data = get_ids(data, "beauty_card_detail")
@pytest.mark.parametrize("param", beauty_card_detail_data, ids=beauty_card_detail_case)
def test_beauty_card_detail(self, param):
r = janus_request().beauty_card_detail(param["spu_id"], param["sku_id"], param["welfareId"], param["version"], param["current_city_id"], param["lat"], param["lng"])
if r["error"] == 0:
assert len(r["data"]["beautycart_list"]) > param["assert"]
import pytest
from all_backend_api.janus_request import janus_request
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
class TestBeautyCardOrderConfirm:
data = BaseRequest().api_load(path_setting.BEAUTY_CARD_ORDER_CONFIRM)
beauty_card_order_confirm_case, beauty_card_order_confirm_data = get_ids(data, "beauty_card_order_confirm")
@pytest.mark.parametrize("param", beauty_card_order_confirm_data, ids=beauty_card_order_confirm_case)
def test_beauty_card_order_confirm(self, param):
r = janus_request().beauty_card_order_confirm(param["sku_id"], param["number"], param["use_bc_coupon"], param["bc_coupon_id"])
if r["error"] == 0:
assert r["error"] == param["assert_error"]
import pytest
from all_backend_api.janus_request import janus_request
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
class TestBeautyCardOrderDetailUsed:
data = BaseRequest().api_load(path_setting.BEAUTY_CARD_ORDER_DETAIL_DATA)
beauty_card_order_detail_used_case, beauty_card_order_detail_used_data = get_ids(data, "beauty_card_order_detail_used")
@pytest.mark.parametrize("param", beauty_card_order_detail_used_data, ids=beauty_card_order_detail_used_case)
def test_beauty_card_order_detail_used(self, param):
r = janus_request().beauty_card_order_detail(param["order_id"])
data = r["data"]
assert data["order_status"] == param["order_status"]
assert data["vertifi_detail"] == {}
used_beautycard_detail = data["used_beautycard_detail"]
title = used_beautycard_detail["title"]
used_time = used_beautycard_detail["used_time"]
hospital_name = used_beautycard_detail["hospital_name"]
assert title is not None
assert hospital_name is not None
import datetime
time = datetime.datetime.strptime(used_time,"%Y-%m-%d %H:%M:%S")
assert time < datetime.datetime.now()
print(time)
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 TestBeautyCardOrderDetailUsing:
data = BaseRequest().api_load(path_setting.BEAUTY_CARD_ORDER_DETAIL_DATA)
beauty_card_order_detail_using_case, beauty_card_order_detail_using_data = get_ids(data, "beauty_card_order_detail_using")
@pytest.mark.parametrize("param", beauty_card_order_detail_using_data, ids=beauty_card_order_detail_using_case)
def test_beauty_card_order_detail_used(self, param):
r = janus_request().beauty_card_order_detail(param["order_id"])
data = r["data"]
assert data["order_status"] == param["order_status"]
assert data["vertifi_detail"]["vertifi_count"] == param["vertifi_count"]
used_beautycard_detail = data["used_beautycard_detail"]
title = used_beautycard_detail["title"]
used_time = used_beautycard_detail["used_time"]
hospital_name = used_beautycard_detail["hospital_name"]
assert title is not None
assert hospital_name is not None
import datetime
time = datetime.datetime.strptime(used_time,"%Y-%m-%d %H:%M:%S")
assert time < datetime.datetime.now()
print(time)
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 TestBeautyCardOrderDetailWaitUse:
data = BaseRequest().api_load(path_setting.BEAUTY_CARD_ORDER_DETAIL_DATA)
beauty_card_order_detail_waituse_case, beauty_card_order_detail_waituse_data = get_ids(data, "beauty_card_order_detail_waituse")
@pytest.mark.parametrize("param", beauty_card_order_detail_waituse_data, ids=beauty_card_order_detail_waituse_case)
def test_beauty_card_order_detail_used(self, param):
r = janus_request().beauty_card_order_detail(param["order_id"])
data = r["data"]
assert data["order_status"] == param["order_status"]
assert data["vertifi_detail"]["vertifi_count"] == param["vertifi_count"]
used_beautycard_detail = data["used_beautycard_detail"]
assert used_beautycard_detail == {}
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 TestBeautyCardOrderSubmit:
data = BaseRequest().api_load(path_setting.BEAUTY_CARD_ORDER_SUBMIT)
beauty_card_order_submit_case, beauty_card_order_submit_data = get_ids(data, "beauty_card_order_submit")
@pytest.mark.parametrize("param", beauty_card_order_submit_data, ids=beauty_card_order_submit_case)
def test_beauty_card_order_submit(self, param):
r = janus_request().beauty_card_order_submit(param["phone"], param["sku_id"], param["number"],
param["is_doctor_see"], param["gain_coupon_id"],
param["deduction_price"])
if r["error"] == 0:
assert r["error"] == param["assert_error"]
import pytest
from all_backend_api.janus_request import janus_request
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
class TestBeautyCardPaymentDelete:
data = BaseRequest().api_load(path_setting.BEAUTY_CARD_PAYMENT_DELETE)
beauty_card_payment_delete_case, beauty_card_payment_delete_data = get_ids(data, "beauty_card_payment_delete")
@pytest.mark.parametrize("param", beauty_card_payment_delete_data, ids=beauty_card_payment_delete_case)
def test_beauty_card_payment_delete(self, param):
payment = janus_request().beauty_card_order_submit("12345678912", "10176", 1, 1, 0, 0)
payment_id = payment["data"]["payment_id"]
r = janus_request().beauty_card_payment_delete(payment_id)
if r["error"] == 0:
assert r["data"]["message"] == param["assert_data_message"]
import pytest
from all_backend_api.janus_request import janus_request
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
class TestBeautyCardPaymentDetail:
data = BaseRequest().api_load(path_setting.BEAUTY_CARD_PAYMENT_DETAIL)
beauty_card_payment_detail_case, beauty_card_payment_detail_data = get_ids(data, "beauty_card_payment_detail")
@pytest.mark.parametrize("param", beauty_card_payment_detail_data, ids=beauty_card_payment_detail_case)
def test_beauty_card_payment_detail(self, param):
payment = janus_request().beauty_card_order_submit("12345678912", "10176", 1, 1, 0, 0)
payment_id = payment["data"]["payment_id"]
r = janus_request().beauty_card_payment_detail(payment_id)
if r["error"] == 0:
assert r["error"] == param["assert_error"]
import pytest
from all_backend_api.janus_request import janus_request
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
class TestBeautyCardPaymentMethod:
data = BaseRequest().api_load(path_setting.BEAUTY_CARD_PAYMENT_METHOD)
beauty_card_payment_method_case, beauty_card_payment_method_data = get_ids(data, "beauty_card_payment_method")
@pytest.mark.parametrize("param", beauty_card_payment_method_data, ids=beauty_card_payment_method_case)
def test_beauty_card_payment_method(self, param):
payment = janus_request().beauty_card_order_submit("12345678912", "10176", 1, 1, 0, 0)
payment_id = payment["data"]["payment_id"]
r = janus_request().beauty_card_payment_method(payment_id)
if r["error"] == 0:
assert r["error"] == param["assert_error"]
import pytest
from all_backend_api.janus_request import janus_request
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
class TestBeautyCardPrepayAlipay:
data = BaseRequest().api_load(path_setting.BEAUTY_CARD_PREPAY_ALIPAY)
beauty_card_prepay_alipay_case, beauty_card_prepay_alipay_data = get_ids(data, "beauty_card_prepay_alipay")
@pytest.mark.parametrize("param", beauty_card_prepay_alipay_data, ids=beauty_card_prepay_alipay_case)
def test_beauty_card_prepay_alipay(self, param):
payment = janus_request().beauty_card_order_submit("12345678912", "10176", 1, 1, 0, 0)
payment_id = payment["data"]["payment_id"]
r = janus_request().beauty_card_prepay_alipay(param["is_huabei"], payment_id)
if r["error"] == 0:
assert r["error"] == param["assert_error"]
import pytest
from all_backend_api.janus_request import janus_request
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
class TestBeautyCardPrepayWechat:
data = BaseRequest().api_load(path_setting.BEAUTY_CARD_PREPAY_WECHAT)
beauty_card_prepay_wechat_case, beauty_card_prepay_wechat_data = get_ids(data, "beauty_card_prepay_wechat")
@pytest.mark.parametrize("param", beauty_card_prepay_wechat_data, ids=beauty_card_prepay_wechat_case)
def test_beauty_card_prepay_wechat(self, param):
payment = janus_request().beauty_card_order_submit("12345678912", "10176", 1, 1, 0, 0)
payment_id = payment["data"]["payment_id"]
r = janus_request().beauty_card_prepay_wechat(payment_id)
if r["error"] == 0:
assert r["error"] == param["assert_error"]
import pytest
from all_backend_api.janus_request import janus_request
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
class TestBeautyCardRefundInfo:
data = BaseRequest().api_load(path_setting.BEAUTY_CARD_REFUND_INFO)
beauty_card_refund_info_case, beauty_card_refund_info_data = get_ids(data, "beauty_card_refund_info")
@pytest.mark.parametrize("param", beauty_card_refund_info_data, ids=beauty_card_refund_info_case)
def test_beauty_card_refund_info(self, param):
r = janus_request().beauty_card_refund_info(param["order_id"])
if r["error"] == 0:
assert r["error"] == param["assert_error"]
import pytest
from all_backend_api.janus_request import janus_request
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
class TestBeautyCardRefundSubmit:
data = BaseRequest().api_load(path_setting.BEAUTY_CARD_REFUND_SUBMIT)
beauty_card_refund_submit_case, beauty_card_refund_submit_data = get_ids(data, "beauty_card_refund_submit")
@pytest.mark.parametrize("param", beauty_card_refund_submit_data, ids=beauty_card_refund_submit_case)
def test_beauty_card_refund_submit(self, param):
r = janus_request().beauty_card_refund_submit(param["order_id"], param["reason_id"], param["reason_text"],
param["reason_type"])
if r["error"] == 1:
assert r["message"] == param["assert_message"]
import pytest
from all_backend_api.janus_request import janus_request
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
class TestBeautyCardUpdatePhone:
data = BaseRequest().api_load(path_setting.BEAUTY_CARD_UPDATE_PHONE)
beauty_card_update_phone_case, beauty_card_update_phone_data = get_ids(data, "beauty_card_update_phone")
@pytest.mark.parametrize("param", beauty_card_update_phone_data, ids=beauty_card_update_phone_case)
def test_beauty_card_update_phone(self, param):
r = janus_request().beauty_card_update_phone(param["authorize_phone"], param["authorize_phone_type"], param["vfc_code"])
if r["error"] == 1:
assert r["message"] == param["assert_message"]
import pytest
import path_setting
from all_backend_api.janus_request import janus_request
from ids_list import get_ids
from in_common.base_request import BaseRequest
#搜索结果页-综合/百科tab
class TestContentV7:
data = BaseRequest().api_load(path_setting.CONTENTV7)
contentv7_case, contentv7_data = get_ids(data, "content_v7")
@pytest.mark.parametrize("param", contentv7_data, ids=contentv7_case)
def test_content_v7(self, param):
print(param['query'])
r = janus_request().content_v7(param["query"], param["device_id"], param["current_city_id"], param["version"], param["is_first"], param["tab_type"], param["offset"])
if r["error"] == 0:
assert r["data"]["cards"][0]["type"] == param["assert"]
if r["error"] == 1:
assert r["message"] == param["assert"]
\ No newline at end of file
import pytest
import path_setting
from all_backend_api.janus_request import janus_request
from ids_list import get_ids
from in_common.base_request import BaseRequest
#医院主页搜索
class TestHospitalSearch:
data = BaseRequest().api_load(path_setting.HOSPITALSEARCH)
hospitalsearch_case, hospitalsearch_data = get_ids(data, "hospital_search")
@pytest.mark.parametrize("param", hospitalsearch_data, ids=hospitalsearch_case)
def test_hospital_search(self, param):
print(param['query'])
r = janus_request().hospital_search(param["query"], param["device_id"], param["hospital_id"], param["current_city_id"], param["version"], param["offset"], param["size"])
if r["error"] == 0:
assert len(r["data"]["search_skus"]) != param["assert1"]
assert len(r["data"]["remai_skus"]) == param["assert2"]
if r["error"] == 1:
assert r["message"] == param["assert"]
import pytest
import path_setting
from all_backend_api.janus_request import janus_request
from ids_list import get_ids
from in_common.base_request import BaseRequest
#医生医院sug列表
class TestKeywordTip:
data = BaseRequest().api_load(path_setting.KEYWORDTIP)
keywordtip_case, keywordtip_data = get_ids(data, "keyword_tip")
@pytest.mark.parametrize("param", keywordtip_data, ids=keywordtip_case)
def test_keyword_tip(self, param):
print(param['query'])
r = janus_request().keyword_tip(param["query"], param["lat"], param["lng"], param["version"])
if not r["data"]["aggregation_card"]:
print('医生医院卡片信息')
assert r["data"]["tip_keys"][0]["type_flag"] == param["assert1"]
assert r["data"]["tip_keys"][11]["type_flag"] == param["assert2"]
if r["data"]["aggregation_card"] :
print('百科卡片信息')
assert r["data"]["aggregation_card"]["child"][0]["type_flag"] == param["assert1"]
assert r["data"]["tip_keys"][0]["type_flag"] == param["assert2"]
\ 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 TestMineGuessYouLike:
data = BaseRequest().api_load(path_setting.JANUS_MINE_GUESS_YOU_LIKE)
mine_guess_you_like_case, mine_guess_you_like_data = get_ids(data, "mine_guess_you_like")
@pytest.mark.parametrize("param", mine_guess_you_like_data, ids=mine_guess_you_like_case)
def test_mine_guess_you_like(self, param):
r = janus_request().mine_guess_you_like()
if r["error"] == 0:
assert r["error"] == param["assert_error"]
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.janus_request import janus_request
class TestPageRules:
data = BaseRequest().api_load(path_setting.PAGE_RULES)
page_rules_case, page_rules_data = get_ids(data, "page_rules")
@pytest.mark.parametrize("param", page_rules_data, ids=page_rules_case)
def test_page_rules(self, param):
r = janus_request().page_rules(param["version"], param["current_city_id"], param["page_name"])
if r["error"] == 0:
assert r["error_code"] == param["assert"]
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.janus_request import janus_request
class TestPolymer:
data = BaseRequest().api_load(path_setting.POLYMER)
polymer_case, polymer_data = get_ids(data, "polymer")
@pytest.mark.parametrize("param", polymer_data, ids=polymer_case)
def test_polymer(self, param):
r = janus_request().polymer(param["version"], param["category_polymer_id"], param["device_id"])
print('feng=', r)
if r["error"] == 0:
assert r["data"]["id"] == param["assert"]
import pytest
from all_backend_api.janus_request import janus_request
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
class TestProductCouponMyList:
data = BaseRequest().api_load(path_setting.PRODUCT_COUPON_MY_LIST)
product_coupon_my_list_case, product_coupon_my_list_data = get_ids(data, "product_coupon_my_list")
@pytest.mark.parametrize("param", product_coupon_my_list_data, ids=product_coupon_my_list_case)
def test_product_coupon_my_list(self, param):
r = janus_request().product_coupon_my_list(param["start_num"], param["tab_id"])
if r["error"] == 0:
assert r["error"] == param["assert_error"]
import pytest
from all_backend_api.janus_request import janus_request
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
class TestProductDetail:
data = BaseRequest().api_load(path_setting.JANUS_PRODUCT_DETAIL)
product_detail_case, product_detail_data = get_ids(data, "product_detail")
@pytest.mark.parametrize("param", product_detail_data, ids=product_detail_case)
def test_product_detail(self, param):
r = janus_request().product_detail(param["service_id"], param["service_item_id"], param["version"])
if r["error"] == 0:
assert r["error"] == param["assert_error"]
if r["error"] == 1:
assert r["message"] == param["assert_spu_message"]
# if r["error"] == -1:
# assert r["message"] == param["assert_version_message"]
import pytest
from all_backend_api.janus_request import janus_request
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
class 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.janus_request import janus_request
class TestServiceHospital:
data = BaseRequest().api_load(path_setting.SERVICE_HOSPITAL)
service_hospital_case, service_hospital_data = get_ids(data, "service_hospital")
@pytest.mark.parametrize("param", service_hospital_data, ids=service_hospital_case)
def test_service_hospital(self, param):
r = janus_request().service_hospital(param["offset"], param["sku_id"], param["size"], param["version"], param["current_city_id"], param["lat"], param["lng"])
if r["error"] == 0:
assert len(r["data"]["service_hospital_list"]) > param["assert"]
import pytest
from all_backend_api.janus_request import janus_request
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
class TestSkuInfo:
data = BaseRequest().api_load(path_setting.JANUS_SKU_INFO)
sku_info_case, sku_info_data = get_ids(data, "sku_info")
@pytest.mark.parametrize("param", sku_info_data, ids=sku_info_case)
def test_sku_info(self, param):
r = janus_request().sku_info(param["service_id"], param["service_item_id"])
if r["error"] == 0:
assert r["error"] == param["assert_error"]
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.janus_request import janus_request
class TestTagService:
data = BaseRequest().api_load(path_setting.TAG_SERVICE)
tagservice_case, tagservice_data = get_ids(data, "tag_service")
@pytest.mark.parametrize("param", tagservice_data, ids=tagservice_case)
def test_tag_service(self, param):
r = janus_request().tag_service(param["size"], param["tag_ids"], param["offset"], param["tag_id"], param["version"], param["device_id"])
#print('feng=', r)
if r["error"] == 0:
assert r["error"] == param["assert"]
assert r["data"]["offset"] == param["offset"]
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.live_request import living_request
class TestDanmuV2:
data = BaseRequest().api_load(path_setting.DANMU_V2)
danmuv2_case, danmuv2_data = get_ids(data, "danmu_v2")
@pytest.mark.parametrize("param",danmuv2_data,ids=danmuv2_case)
def test_danmu_v2(self,param):
print(param)
r = living_request().danmu_v2(param["channel_id"],param["msg_id"],param["user_id"])
if r["error"] == 0:
assert r["error"] == param["assert"]
else:
assert r["message"] == param["assert_message"]
\ 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.live_request import living_request
class TestPushLiveInfo:
data = BaseRequest().api_load(path_setting.PUSH_LIVE_INFO)
pushliveinfo_case, pushliveinfo_data = get_ids(data,"push_live_info")
@pytest.mark.parametrize("param", pushliveinfo_data, ids=pushliveinfo_case)
def test_pushlive_info(self, param):
r = living_request().pushlive_info(param["title"],param["cover_url"],param["notice"],param["tag_id"],param["clarity"],param["device_type"])
print('--------',r)
if r["error"] == 0:
assert r["error"] == param["assert"]
else:
assert r["message"] == param['assert_message0']
\ 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.my_conversation_request import my_conversation_request
class TestMyConversation:
data = BaseRequest().api_load(path_setting.MY_CONVERSATION)
my_conversation_case, my_conversation_data = get_ids(data, "my_conversation")
@pytest.mark.parametrize("param",my_conversation_data,ids=my_conversation_case)
def test_my_conversation(self,param):
'''私信列表'''
r = my_conversation_request().my_conversation(param["current_city_id"], param["start_num"], param["count"])
if r["error"] == 0:
conversation_list = r.get("data").get("conversation_list", [])
assert len(conversation_list) <= param["assert"]
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.notification_request import notification_request
class TestReadall:
data = BaseRequest().api_load(path_setting.READALL)
readall_case, readall_data = get_ids(data, "readall")
@pytest.mark.parametrize("param",readall_data,ids=readall_case)
def test_readall(self,param):
r = notification_request().readall(param["uqid"], param["trace_id"],param["ua"])
print(r)
assert r["error"] == 0
\ 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.notification_request import notification_request
class TestUnread:
data = BaseRequest().api_load(path_setting.UNREAD)
unread_case, unread_data = get_ids(data, "unread")
@pytest.mark.parametrize("param",unread_data,ids=unread_case)
def test_unread(self,param):
r = notification_request().unread(param["uqid"], param["trace_id"])
#print("返回结果是:%s" % r)
total_count = r["data"]["unread_count"]["total_count"]
print("总数量是:%s" % total_count)
total_unread = r.get("data").get("unread_count").get("follow_count").get("total_unread")#关注总未读数
#print("总数量1是:%s" % total_unread)
message_count = r["data"]["unread_count"]["message_count"]#私信列表总未读数
#print("私信列表总未读数是:%s" % message_count)
vote_favor = r["data"]["unread_count"]["vote_favor_count"]["vote_favor"]#赞/收藏总未读数
#print("赞/收藏总未读数是:%s" % vote_favor)
reply_count = r["data"]["unread_count"]["reply_count"] #回复总未读数
#print("回复总未读数是:%s" % reply_count)
count = total_unread + message_count + vote_favor + reply_count
#print("相加总数是是:%s" % count)
if r["error"] == 0:
assert r["data"]["unread_count"]["total_count"] >= param["assert"]
assert r["data"]["unread_count"]["total_count"] == count
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.oneimage_request import oneimage_request
# 测颜值根据五官推荐美购
class TestRecomendServices:
data = BaseRequest().api_load(path_setting.ONEIMAGE_RECOMEND_SERVICES_DATA)
recomendservice_case, recomendservice_data = get_ids(data, "recomend_services")
# @pytest.mark.skip("跳过测颜值根据五官推荐美购,目前数据是参数是线上的-------------------")
@pytest.mark.parametrize("param",recomendservice_data,ids=recomendservice_case)
def test_recomend_services(self,param):
r = oneimage_request().recomend_services(param["version"], param["business_tags_names"])
if r["error"] == 0:
data = r.get("data")
assert len(data) == param["assert"]
gm_url = data[0].get("gm_url")
assert gm_url.startswith("gengmei://search_result?searchTabType=0") == True, f'返回并非搜索协议,实际是{gm_url}'
assert len(data[0].get("service")) > 0, f'根据五官返回美购个数有误,实际是{len(data[0].get("service"))}'
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.oneimage_request import oneimage_request
class TestShareV4:
"""
测颜值结果页,分享结果
"""
data = BaseRequest().api_load(path_setting.ONEIMAGE_SHARE_V4_DATA)
sharev4_case, sharev4_data = get_ids(data, "share_v4")
# @pytest.mark.skip("跳过,测颜值结果v4,目前数据是线上的-------------------")
@pytest.mark.parametrize("param",sharev4_data,ids=sharev4_case)
def test_share_v4(self,param):
r = oneimage_request().share_v4(param["version"], param["face_id"])
assert r["error"] == 0
import pytest
from all_backend_api.orders_request import orders_request
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
class TestMyStatus:
data = BaseRequest().api_load(path_setting.ORDER_MY_STATUS)
my_status_case, my_status_data = get_ids(data, "my_status")
@pytest.mark.parametrize("param", my_status_data, ids=my_status_case)
def test_my_status(self, param):
r = orders_request().my_status()
if r["error"] == 0:
assert r["error"] == param["assert_error"]
import 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
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.private_conversation_request import private_conversation_request
class TestPrivateConversation:
data = BaseRequest().api_load(path_setting.PRIVATE_CONVERSATION)
privateconversation_case, privateconversation_data = get_ids(data, "private_conversation")
@pytest.mark.parametrize("param", privateconversation_data, ids=privateconversation_case)
def test_private_conversation(self, param):
r = private_conversation_request().private_conversation(param["content"], param["target_uid"],
param["referrer"], param["referrer_id"],
param["is_system"], param["quick_consultation_id"],
param["diary_id"], param["from_live"])
print(r)
if r["error"] == 0:
assert r["message"] == param["assert_message"]
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.qa_request import qa_request
class TestFavor:
data = BaseRequest().api_load(path_setting.QA_FAVOR)
test_case, test_data = get_ids(data, "favor")
@pytest.mark.parametrize("param", test_data, ids=test_case)
def test_favor(self, param):
r = qa_request().favor(param["answer_id"])
assert r["error"] == param["error"]
r = qa_request().cancelfavor(param["answer_id"])
assert r["error"] == param["error"]
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.question_request import question_request
class TestReplyAnswer:
data = BaseRequest().api_load(path_setting.REPLY_ANSWER)
replyanswer_case, replyanswer_data = get_ids(data, "reply_answer")
@pytest.mark.parametrize("param", replyanswer_data, ids=replyanswer_case)
def test_reply_answer(self, param):
r = question_request().reply_answer(param["current_city_id"],param["answer_id"],param["content"],param["user_id"])
if r["message"] == "操作成功":
assert r["message"] == param["assert"]
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.scan_request import scan_request
# 测颜值底部feed流
class TestScanDiaryCards:
data = BaseRequest().api_load(path_setting.SCAN_DIARY_CARDS_DATA)
scandiarycards_case, scandiarycards_data = get_ids(data, "diary_cards")
@pytest.mark.parametrize("param",scandiarycards_data,ids=scandiarycards_case)
def test_diary_cards(self,param):
r = scan_request().scan_diary_cards(param["current_city_id"], param["page"], param["count"], param["feature_results"],param["feed_type"])
assert r["error"] == 0
assert len(r["data"]) == param["assert_nums"]
\ No newline at end of file
#搜索结果页-医生/医院tab
import pytest
import path_setting
from all_backend_api.search_request import search_request
from ids_list import get_ids
from in_common.base_request import BaseRequest
class TestContentV6:
data = BaseRequest().api_load(path_setting.CONTENTV6)
contentv6_case, contentv6_data = get_ids(data, "content_v6")
@pytest.mark.parametrize("param", contentv6_data, ids=contentv6_case)
def test_content_v6(self, param):
print(param['query'])
r = search_request().content_v6(param["query"], param["device_id"], param["current_city_id"], param["version"], param["is_first"], param["tab_type"], param["offset"], param["size"])
if r["error"] == 0:
if param["tab_type"] == 3:
assert r["data"]["hospitals"][0]["name"] == param["assert"]
if param["tab_type"] == 4:
assert r["data"]["doctors"][0]["name"] == param["assert"]
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.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"]
import pytest
import path_setting
from all_backend_api.search_request import search_request
from ids_list import get_ids
from in_common.base_request import BaseRequest
#搜索首页-更美热门榜
class TestHot:
data = BaseRequest().api_load(path_setting.HOT)
hot_case, hot_data = get_ids(data, "hot")
@pytest.mark.parametrize("param", hot_data, ids=hot_case)
def test_hot(self, param):
r = search_request().hot(param["version"])
if r["error"] == 0:
print("接口调用成功了~")
assert len(["data"]) != param["assert"]
\ No newline at end of file
import pytest
import path_setting
from all_backend_api.search_request import search_request
from ids_list import get_ids
from in_common.base_request import BaseRequest
#搜索首页-热门搜索
class TestKeywords:
data = BaseRequest().api_load(path_setting.KEYWORDS)
keywords_case, keywords_data = get_ids(data, "keywords")
@pytest.mark.parametrize("param", keywords_data, ids=keywords_case)
def test_keywords(self, param):
r = search_request().keywords(param["current_city_id"], param["search_tab"])
if r["error"] == 0:
assert r["error"] == param["assert"]
print("接口调用成功了~")
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.service_request import service_request
class TestHomeV5:
data = BaseRequest().api_load(path_setting.HOME_V5)
homev5_case, homev5_data = get_ids(data, "home_v5")
@pytest.mark.parametrize("param",homev5_data,ids=homev5_case)
def test_home_v5(self,param):
r = service_request().home_v5()
print(r)
print("home_v6")
#if r["error"] == 0:
assert r["error"] == param["assert"]
import pytest
from all_backend_api.service_request import service_request
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
class TestServiceFavor:
data = BaseRequest().api_load(path_setting.SERVICE_FAVOR)
service_favor_case, service_favor_data = get_ids(data, "service_favor")
@pytest.mark.parametrize("param", service_favor_data, ids=service_favor_case)
def test_service_favor(self, param):
r = service_request().service_favor()
if r["error"] == 0:
assert r["message"] == param["assert_message"]
print(service_request().service_favor())
import pytest
from all_backend_api.services_request import services_request
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
class TestShareData:
data = BaseRequest().api_load(path_setting.SERVICES_SHARE_DATA)
share_data_case, share_data_data = get_ids(data, "share_data")
@pytest.mark.parametrize("param", share_data_data, ids=share_data_case)
def test_share_data(self, param):
r = services_request().share_data(param["p_id"], param["u_id"])
if r["error"] == 0:
assert r["error"] == param["assert_error"]
# print(services_request().share_data())
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"]:
if item["type"] == 1:
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 all_backend_api.shopcart_request import shopcart_request
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
class TestAdd:
data = BaseRequest().api_load(path_setting.SHOPCART_ADD)
add_case, add_data = get_ids(data, "add")
@pytest.mark.parametrize("param", add_data, ids=add_case)
def test_add(self, param):
r = shopcart_request().add(param["from_live"], param["number"], param["service_item_id"])
if r["error"] == 0:
assert r["message"] == param["assert_message"]
import pytest
from all_backend_api.shopcart_request import shopcart_request
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
class TestList:
data = BaseRequest().api_load(path_setting.SHOPCART_LIST)
list_case, list_data = get_ids(data, "list")
@pytest.mark.parametrize("param", list_data, ids=list_case)
def test_list(self, param):
r = shopcart_request().list()
if r["error"] == 0:
assert r["error"] == param["assert_error"]
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.skin_request import skin_request
# 测肤底部feed流
class TestSkinRecommendServices:
data = BaseRequest().api_load(path_setting.SKIN_RECOMMEND_SERVICE_DATA)
skin_recommend_service_case, skin_recommend_service_data = get_ids(data, "recommend_service")
@pytest.mark.parametrize("param",skin_recommend_service_data,ids=skin_recommend_service_case)
def test_recommend_services(self,param):
r = skin_request().skin_recommend_service(param["device_id"], param["current_city_id"], param["appeal_tag_ids"],
param["offset"], param["size"])
if r["error"] == 0:
services = r["data"]["services"]
assert len(services) == param["assert_nums"]
import time
import yaml
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.topic_reply_create_request import topic_reply_create_request
class TestTopicReplyCreate:
data = BaseRequest().api_load(path_setting.TOPIC_REPLY_CREATE)
topic_reply_create_case, topic_reply_create_data = get_ids(data, "reply_create")
@pytest.mark.parametrize("param", topic_reply_create_data, ids=topic_reply_create_case)
def test_topic_reply_create(self, param):
r = topic_reply_create_request().topic_reply_create( param["content"], param["channel"] )
# 一级评论三种情况校验,回复成功,回复频繁,回复重复
if r["error"] == 0:
assert r["message"] == param["message1"]
elif r["error"] == 4:
assert r["message"] == param["message"]
elif r["error"] == 1:
assert r["message"] == param["message2"]
sub_r = topic_reply_create_request().topic_sub_reply_create( param["content"], param["channel"], param["replied_id"] )
# 二级评论三种情况校验,回复成功,回复频繁,回复重复
if sub_r["error"] == 0:
assert sub_r["message"] == param["message1"]
elif sub_r["error"] == 4:
assert sub_r["message"] == param["message"]
elif sub_r["error"] == 1:
assert sub_r["message"] == param["message2"]
# 运行完用例后修改topic_reply_create.yaml文件里的content内容避免下一次重复,工作路径是backend_auto,用的是相对路径
a_path = "test_backend_data/topic_data/topic_reply_create.yaml"
with open(a_path, "r", encoding="utf-8") as f:
res = yaml.load(f, Loader=yaml.FullLoader)
a_content = res["reply_create"][0]["content"]
a_new_content = "ces测试+" + str(time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())))
# 更换content内容,写入yaml文件
for k in res["reply_create"][0]:
if k == "content":
res["reply_create"][0][k] = a_new_content
with open(a_path, "w", encoding="utf-8") as f:
yaml.dump(res, f, encoding='utf-8', allow_unicode=True)
#
#
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.topicreply_vote_request import topicreply_vote_request
class TestTopicReplyVote:
data = BaseRequest().api_load(path_setting.TOPIC_REPLY_VOTE)
topic_reply_vote_case, topic_reply_vote_data = get_ids(data, "topic_reply_vote")
@pytest.mark.parametrize("param", topic_reply_vote_data, ids=topic_reply_vote_case)
def test_topic_reply_vote(self, param):
r = topicreply_vote_request().topic_reply_vote(param["id"])
# 先点赞一次。看是否报重复点赞的错误,如果是就先取消点赞。最后回到取消点赞的状态
if r["error"] == 1:
assert r["message"] == param["assert3"]
# 回到取消点赞状态
canclevote = topicreply_vote_request().topic_reply_cancelvote(param["id"])
assert canclevote["error"] == 0
# 校验点赞
vote = topicreply_vote_request().topic_reply_vote(param["id"])
assert vote["error"] == 0
# 校验二次点赞无效
vote = topicreply_vote_request().topic_reply_vote(param["id"])
assert vote["message"] == param["assert3"]
assert vote["error"] == 1
# 最后取消点赞,回到取消点赞的状态
cancelvote = topicreply_vote_request().topic_reply_cancelvote(param["id"])
assert cancelvote["error"] == 0
elif r["error"] == 0:
# 说明已经点赞成功只需要校验重复点赞和取消点赞即可-二次点赞无效
vote = topicreply_vote_request().topic_reply_vote(param["id"])
assert vote["message"] == param["assert3"]
assert vote["error"] == 1
# 最后取消点赞,回到取消点赞的状态
cancelvote = topicreply_vote_request().topic_reply_cancelvote(param["id"])
assert cancelvote["error"] == 0
#
# if r["error"] == 1:
# assert r["message"] ==param["assert2"]
# 收藏之后取消收藏
# r1 = diary_isfavor_request().diary_cancelfavor()
# if r["error"] == 0:
# assert r["error"] == param["assert"]
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.topic_request import topic_request
class TestTopicDetail:
data = BaseRequest().api_load(path_setting.TOPIC_DETAIL)
topic_detail_case, topic_detail_data = get_ids(data, "topic_detail")
@pytest.mark.parametrize("param", topic_detail_data, ids=topic_detail_case)
def test_v1(self, param):
r = topic_request().topic_detail(param["topic_id"])
assert r["error"] == param["assert1"]
if r["error"] == 0:
assert r["error"] == param["assert1"]
# 先判断点赞字段,日记总数等,不传值,传空值
if r["data"]["data"]:
assert r["data"]["data"]["is_following"] is not None and r["data"]["data"]["is_following"] is not "" # 是否关注
assert r["data"]["data"]["topic_num"] is not None and r["data"]["data"]["topic_num"] is not "" # 日记贴总数
assert r["data"]["data"]["reply_num"] is not None and r["data"]["data"]["reply_num"] is not "" # 评论数
assert r["data"]["data"]["is_liked"] is not None and r["data"]["data"]["is_liked"] is not "" #是否点赞
assert r["data"]["data"]["vote_num"] is not None and r["data"]["data"]["vote_num"] is not "" #点赞总数
assert r["data"]["data"]["view_num"] is not None and r["data"]["data"]["view_num"] is not ""#浏览总数
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.topic_request import topic_request
class TestVote:
data = BaseRequest().api_load(path_setting.TOPIC_VOTE)
topic_vote_case, topic_vote_data = get_ids(data, "topic_vote")
@pytest.mark.parametrize("param", topic_vote_data, ids=topic_vote_case)
def test_vote(self, param):
r = topic_request().topic_detail(param["topic_id"])
if r["error"] == 0:
assert r["error"] == param["assert1"]
# 如果没有点过赞,就先校验点赞之后再取消点赞。【最后保持取消点赞的状态】
if not r["data"]["data"]["is_liked"]:
vote = topic_request().topic_vote(param["topic_id"])
assert vote["error"] == 0
assert vote["message"] == param["message1"]
# 取消点赞,回到取消点赞的状态
cancelvote = topic_request().topic_cancelvote(param["topic_id"])
assert cancelvote["error"] == 0
else:
# 如果是已经点过赞的状态就直接取消点赞
cancelvote = topic_request().topic_cancelvote(param["topic_id"])
assert cancelvote["error"] == 0
assert cancelvote["message"] == param["message2"]
# if r["error"] == 1:
# assert r["message"] ==param["assert2"]
# 收藏之后取消收藏
# r1 = diary_isfavor_request().diary_cancelfavor()
# if r["error"] == 0:
# assert r["error"] == param["assert"]
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.tractate_request import tractate_request
class 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_detail(self, param):
r = tractate_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
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.tractate_request import tractate_request
class TestFavor:
data = BaseRequest().api_load(path_setting.TRACTATE_FAVOR)
test_case, test_data = get_ids(data, "favor")
@pytest.mark.parametrize("param", test_data, ids=test_case)
def test_favor(self, param):
r = tractate_request().favor(param["tractate_id"], param["data_type"])
# print(r)
if r["error"] == 0:
assert r["message"] == param["message1"]
if r["error"] == 1:
assert r["message"] ==param["message2"]
r = tractate_request().cancelfavor(param["tractate_id"], param["data_type"])
# print(r)
if r["error"] == 0:
assert r["message"] == param["message3"]
if r["error"] == 1:
assert r["message"] == param["message2"]
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.tractate_request import tractate_request
class TestPublishReply:
data = BaseRequest().api_load(path_setting.TRACTATE_PUBLISH_REPLY)
test_case, test_data = get_ids(data, "publish_reply")
@pytest.mark.parametrize("param", test_data, ids=test_case)
def test_publish_reply(self, param):
r = tractate_request().publish_reply(param["tractate_id"], param["data_type"], param["reply_id"], param["content"])
# print(r)
assert r["error"] == param["error"]
if r["error"] == 0:
assert r["data"]["reply_data"]["content"] is not None and r["data"]["reply_data"]["content"] is not ""
assert r["data"]["reply_data"]["user_type"] is not None and r["data"]["reply_data"]["user_type"] is not ""
assert r["data"]["reply_data"]["user_gm_url"] is not None and r["data"]["reply_data"]["user_gm_url"] is not ""
assert r["data"]["reply_data"]["is_vote"] is not None and r["data"]["reply_data"]["is_vote"] is not ""
assert r["data"]["reply_data"]["id"] is not None and r["data"]["reply_data"]["id"] is not ""
assert r["data"]["reply_data"]["user_portrait"] is not None and r["data"]["reply_data"]["user_portrait"] is not ""
assert r["data"]["reply_data"]["vote_num"] is not None and r["data"]["reply_data"]["vote_num"] is not ""
assert r["data"]["reply_data"]["content"] is not None and r["data"]["reply_data"]["content"] is not ""
assert r["data"]["reply_data"]["reply_count"] is not None and r["data"]["reply_data"]["reply_count"] is not ""
assert r["data"]["reply_data"]["user_name"] is not None and r["data"]["reply_data"]["user_name"] is not ""
assert r["data"]["reply_data"]["content"] == param["content"]
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.tractate_request import tractate_request
class TestRelatedService:
data = BaseRequest().api_load(path_setting.TRACTATE_RELATED_SERVICE)
related_service_case, related_service_data = get_ids(data, "related_service")
@pytest.mark.parametrize("param", related_service_data, ids=related_service_case)
def test_related_service(self, param):
r = tractate_request().tractate_related_service( param["current_city_id"], param["tractate_id"], param["data_type"] )
# print(r)
assert r["error"] == param["assert_error"]
if r["error"] == 0:
# 先判断有没有美购,然后判断里面需要的那些字段,如点赞字段,日记总数等,不传值,传空值
if r["data"]["consult_info"]:
assert r["data"]["consult_info"]["service_id"] is not None and r["data"]["consult_info"]["service_id"] is not "" # 美购id
assert r["data"]["consult_info"]["doctor_user_id"] is not None and r["data"]["consult_info"]["doctor_user_id"] is not "" # 医生id
assert r["data"]["display_service_gray"] is not None and r["data"]["display_service_gray"] is not "" # 是否展示吸顶美购灰度
assert r["data"]["consult_info"]["service_id"] == r["data"]["related_services"][0]["id"] # 校验关联美购id是否正确
assert r["data"]["new_recommend_service"] is not None and r["data"]["new_recommend_service"] is not "" # 校验推荐美购是否存在
#
# assert r["data"]["text"] == param["assert_text"]
# if r["error"] == 21001:
# assert r["message"] == param["assert_message1"]
\ No newline at end of file
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.tractate_request import tractate_request
class TestReply:
data = BaseRequest().api_load(path_setting.TRACTATE_REPLY)
test_case, test_data = get_ids(data, "reply")
@pytest.mark.parametrize("param", test_data, ids=test_case)
def test_reply(self, param):
r = tractate_request().reply( param["current_city_id"], param["id"], param["data_type"] )
# print(r)
assert r["error"] == param["assert_error"]
if r["error"] == 0:
# 先判断有没有值,然后判断里面需要的那些字段,如点赞字段,总数等,不传值,传空值
if r["data"]["reply"]:
assert r["data"]["reply"][0]["content"] is not None and r["data"]["reply"][0]["content"] is not ""
assert r["data"]["reply"][0]["user_id"] is not None and r["data"]["reply"][0]["user_id"] is not ""
assert r["data"]["reply"][0]["user_gm_url"] is not None and r["data"]["reply"][0]["user_gm_url"] is not ""
assert r["data"]["reply"][0]["user_portrait"] is not None and r["data"]["reply"][0]["user_portrait"] is not ""
assert r["data"]["reply"][0]["vote_num"] is not None and r["data"]["reply"][0]["vote_num"] is not ""
assert r["data"]["reply"][0]["user_type"] is not None and r["data"]["reply"][0]["user_type"] is not ""
assert r["data"]["reply"][0]["user_name"] is not None and r["data"]["reply"][0]["user_name"] is not ""
assert r["data"]["reply"][0]["tractate_id"] is not None and r["data"]["reply"][0]["tractate_id"] is not ""
assert r["data"]["reply"][0]["reply_count"] is not None and r["data"]["reply"][0]["reply_count"] is not ""
assert r["data"]["reply"][0]["is_vote"] is not None and r["data"]["reply"][0]["is_vote"] is not ""
assert r["data"]["reply"][0]["id"] is not None and r["data"]["reply"][0]["id"] is not ""
else:
# print(r["data"]["reply"])
# 如果得到结果是无评论看是不是写死的无评论的账号还是别的原因导致
assert r["data"]["tractate_id"] == str(param["id"])
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.tractate_request import tractate_request
class TestVote:
data = BaseRequest().api_load(path_setting.TRACTATE_VOTE)
test_case, test_data = get_ids(data, "tractate_vote")
@pytest.mark.parametrize("param", test_data, ids=test_case)
def test_vote(self, param):
r = tractate_request().tractate_detail(param["current_city_id"], param["tractate_id"], param["data_type"])
if r["error"] == 0:
assert r["error"] == param["assert1"]
# 如果没有点过赞,就先校验点赞之后再取消点赞。【最后保持取消点赞的状态】
if not r["data"]["tractate_list"]["is_voted"]:
vote = tractate_request().tractate_vote(param["tractate_id"], param["data_type"], param["reply_id"])
assert vote["error"] == 0
assert vote["message"] == param["message1"]
# 取消点赞,回到取消点赞的状态
canclevote = tractate_request().tractate_cancelvote(param["tractate_id"], param["data_type"], param["reply_id"])
assert canclevote["error"] == 0
else:
# 如果是已经点过赞的状态就直接取消点赞
canclevote = tractate_request().tractate_cancelvote(param["tractate_id"], param["data_type"], param["reply_id"])
assert canclevote["message"] == param["message2"]
import pytest
from all_backend_api.user_request import user_request
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
class TestAnswer:
data = BaseRequest().api_load(path_setting.USER_ANSWER)
answer_case, answer_data = get_ids(data, "answer")
@pytest.mark.parametrize("param", answer_data, ids=answer_case)
def test_answer(self, param):
r = user_request().answer(param["user"])
if r["error"] == 0:
assert r["error"] == param["assert_error"]
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.user_request import user_request
class TestPersonalCenter:
data = BaseRequest().api_load(path_setting.PERSONAL_CENTER)
personalcenter_case, personalcenter_data = get_ids(data, "personal_center")
@pytest.mark.parametrize("param", personalcenter_data, ids=personalcenter_case)
def test_personal_center(self, param):
r = user_request().personal_center()
print('feng=', r)
if r["error"] == 0:
assert r["error"] == param["assert"]
assert r["data"]["user"]["portrait"] != param["portrait"]
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.user_request import user_request
class TestTopicFavor:
data = BaseRequest().api_load(path_setting.TOPIC_FAVOR)
topic_favor_case, topic_favor_data = get_ids(data, "favor")
@pytest.mark.parametrize("param", topic_favor_data, ids=topic_favor_case)
def test_topic_favor(self, param):
# 收藏校验
r = user_request().topic_favor()
assert r["error"] == param["assert"]
# 取消收藏校验
r = user_request().topic_canclefavor()
assert r["error"] == param["assert"]
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
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.xcx_request import xcx_request
# 获取测颜值结果页小程序二维码
class TestGengmeiGetWxacodeUnlimited:
data = BaseRequest().api_load(path_setting.XCX_GENGMEI_GET_WXACODE_UNLIMITED_DATA)
genbgmeiGetWxacodeUmlimited_case, gengmeiGetWxacodeUmlimited_data = get_ids(data, "gengmei_get_wxacode_unlimited")
@pytest.mark.skip("测颜值返回二维码,目前测试环境报错,只能跑线上的-------------------")
@pytest.mark.parametrize("param",gengmeiGetWxacodeUmlimited_data,ids=genbgmeiGetWxacodeUmlimited_case)
def test_get_wxacode_umlinited(self,param):
r = xcx_request().gengmei_get_wxacode_unlimited(param["page"], param["scene"])
if r["error"] == 0:
image_url = r["data"]["url"]
print(image_url)
import requests
resp = requests.get(url=image_url, verify=False)
print(resp.text)
# 判断返回是否有报错信息,否则是一张图片
assert "errcode"not in resp.text, f'测颜值返回二维码图片不可用'
login_thirdphone:
-
case: "无版本号手机号一键登录case"
phone_data: '{
"token" : "A4-lVEf_Fk2ekkxSFgSZ59yD6bPaIxHWzJfsGgaEBDrbZzFyxMueOODIoBeXXQuHU8REjG42jvyjQa2a3rkDm8ufKlI8DL3ny2FfxnUrnuQOycWRaHKN3664onbOetr54dvb4wkVaV7X33yBlw7u_ZCNqIOwTnRQ9kPgHDBpvyN4NTdYYf2tJWhF4VeiVOqc7OiRz-Nzt08AUvbtWpw6sPQjA==",
"appId" : "xK5yFMfJ"
}'
phone_from_type: 1
version:
assert: "获取手机号失败"
-
case: "大于7.32手机号一键登录case"
phone_data: '{
"token" : "A4-lVEf_Fk2ekkxSFgSZ59yD6bPaIxHWzJfsGgaEBDrbZzFyxMueOODIoBeXXQuHU8REjG42jvyjQa2a3rkDm8ufKlI8DL3ny2FfxnUrnuQOycWRaHKN3664onbOetr54dvb4wkVaV7X33yBlw7u_ZCNqIOwTnRQ9kPgHDBpvyN4NTdYYf2tJWhF4VeiVOqc7OiRz-Nzt08AUvbtWpw6sPQjA==",
"appId" : "xK5yFMfJ"
}'
phone_from_type: 1
version: "7.43.0"
assert: "获取手机号失败"
-
case: "小于7.32手机号一键登录case"
phone_data: '{
"token" : "A4-lVEf_Fk2ekkxSFgSZ59yD6bPaIxHWzJfsGgaEBDrbZzFyxMueOODIoBeXXQuHU8REjG42jvyjQa2a3rkDm8ufKlI8DL3ny2FfxnUrnuQOycWRaHKN3664onbOetr54dvb4wkVaV7X33yBlw7u_ZCNqIOwTnRQ9kPgHDBpvyN4NTdYYf2tJWhF4VeiVOqc7OiRz-Nzt08AUvbtWpw6sPQjA==",
"appId" : "xK5yFMfJ"
}'
phone_from_type: 1
version: "7.32.0"
assert: "获取手机号失败"
\ No newline at end of file
login_vfc:
#成功登录case
-
case: "成功登录case--验证码正常登录case"
current_city_id: "beijing"
phone_num: "+8612345678912"
vfc_code: 1234
assert: "12345678912"
#登录失败case
-
case: "登录失败case--手机号错误"
current_city_id: "beijing"
phone_num: "+8612345678913"
vfc_code: 1234
assert: "验证码错误"
-
case: "登录失败case--验证码错误"
current_city_id: "beijing"
phone_num: "+8612345678912"
vfc_code: 12345
assert: "验证码错误"
-
case: "登录失败case--手机号格式非数字"
current_city_id: "beijing"
phone_num: "+86123456789qq"
vfc_code: 12345
assert: "手机号无效, 请检查输入"
-
case: "登录失败case--手机号为空"
current_city_id: "beijing"
phone_num: ""
vfc_code: 12345
assert: "参数错误"
-
case: "登录失败case--验证码为空"
current_city_id: "beijing"
phone_num: "+8612345678912"
vfc_code:
assert: "验证码错误"
-
case: "登录失败case--都为空"
current_city_id: "beijing"
phone_num:
vfc_code:
assert: "手机号无效, 请检查输入"
\ No newline at end of file
password:
#成功登录case
-
case: "成功登录case--密码正常登录case"
current_city_id: "beijing"
phone: "17796839512"
password: 123456
assert: "17796839512"
#登录失败case
-
case: "登录失败case--手机号错误"
current_city_id: "beijing"
phone: "17796839510"
password: 123456
assert: "手机号或密码不正确"
-
case: "登录失败case--密码错误"
current_city_id: "beijing"
phone: "17796839512"
password: 1234567
assert: "手机号或密码不正确"
-
case: "登录失败case--手机号格式非数字"
current_city_id: "beijing"
phone: "177968395qq"
password: 123456
assert: "该手机号未注册过更美,请先注册!"
-
case: "登录失败case--手机号为空"
current_city_id: "beijing"
phone: ""
password: 123456
assert: "该手机号未注册过更美,请先注册!"
-
case: "登录失败case--密码为空"
current_city_id: "beijing"
phone: "17796839512"
password:
assert: "手机号或密码不正确"
-
case: "登录失败case--都为空"
current_city_id: "beijing"
phone:
password:
assert: "该手机号未注册过更美,请先注册!"
\ No newline at end of file
#!/usr/bin/env python
# -*- coding:utf-8 -*-
cancel_vote:
- case: "接口正常case"
current_city_id: "beijing"
answer_id: "868312"
assert: ""
detail:
#字段正常case
-
case: "接口正常case"
current_city_id: "beijing"
answer_id: "868312"
assert: ""
vote:
- case: "接口正常case"
answer_id: "868312"
assert: ""
common_reply:
#日记本列表评论列表--校验
-
case: "日记本列表评论列表--校验"
id: 21250007
type: 2
assert1: 0
type: "TOPIC"
-
case: "帖子列表评论列表--校验"
id: 82208
type: 4
assert1: 0
type: "TRACTATE"
topic_sub_common:
#二级评论列表展示-多数为字段判空校验-因为评论本身并不确定
-
case: "日记贴二级评论列表--展示--用户信息校验"
id: 21249632
type: 2
reply_id: 35526987
assert1: 0
assert2: "请登录后再试"
assert3: "已经赞过啦"
type: "TOPIC"
-
case: "贴子二级评论列表--展示--用户信息校验"
id: 2087079
type: 4
reply_id: 2087079
assert1: 0
assert2: "请登录后再试"
assert3: "已经赞过啦"
type: "TRACTATE"
detail_messageid:
#验证成功case
-
case: "私信详情页最新一页的消息内容"
os_version: 10
last_msg_id: 0
offset_msg_id: 0
assert: 20
message_read:
#验证成功case
-
case: "请求成功case"
current_city_id: "beijing"
release: 1
#uqid: "1B519701-A4F5-453E-9D99-140B5AF697A0"
message_ids: [10622,10626,10646,10651]
assert: "true"
\ No newline at end of file
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_favor:
#收藏case--无须字段
-
case: "收藏成功case"
assert: "收藏成功"
assert2: "请登录后再试"
assert3: "已取消收藏"
#diary_cancelfavor:
#-
# case: "取消收藏case"
# assert: "已取消收藏"
diary_data:
#字段正常case
-
case: "接口正常case"
current_city_id: "beijing"
diary_referrer: "my_diary"
sort: 0
count: 8
start_num: 2
assert: 0
-
case: "接口传参数失败,但不报错case"
current_city_id: "beijing"
diary_referrer: "my_diary"
sort: 0
count: 8
start_num: 2
assert: 0
article:
-
case: "校验接口返回成功case"
doctor_id: "9918ad7eb8f511e58f8200163e000a4a"
assert_error: 0
\ No newline at end of file
detail:
-
case: "校验接口返回成功case"
assert_error: 0
\ No newline at end of file
diary:
-
case: "校验接口返回成功case"
doctor_id: 5bd9f05cad51403d853ba8c881989e23
assert_error: 0
\ No newline at end of file
services:
-
case: "校验接口返回成功case"
assert_error: 0
\ No newline at end of file
diary_cards:
-
case: "模拟双眼皮"
current_city_id: "beijing"
page: "1"
page_size: "10"
tag_names: '["埋线双眼皮","定点双眼皮","切开双眼皮"]'
-
case: "模拟发型"
current_city_id: "beijing"
page: "1"
page_size: "10"
tag_names: '["植发际线","美人尖植发","疤痕植发","pst微针植发","植发","注射瘦脸","眼综合","热玛吉","水光针","菲洛嘉","小棕瓶","微针祛痘"]'
diary_cards:
-
case: "测颜值根据标签推荐日记"
facial_type2tag_names: '{"2":["玻尿酸垫下巴","自体脂肪垫下巴"],"3":["半永久纹眉","植眉"]}'
assert_feed_nums: 2
\ No newline at end of file
plastic_feeds:
-
case: "3D变脸下feed流(高版本)"
tag_id: '2371,2372,2247,3032,2274,2277,2242,2348,2597,2318,2551,2341,2389'
face_id: 9
tag_id_list: '[[845, 498, 497, 494], [880, 484, 3254], [276], [1070, 373, 372, 350], [494, 315], [1293, 1050], [284, 282], [254, 251], [1000, 494, 312], [295, 272, 253], [1376, 1365, 1088, 892, 395, 385], [427, 327], [3214, 1377, 1306, 1051, 327, 229]]'
page_size: 10
version: "7.44.0"
assert_num: 10
-
case: "3D变脸下feed流(低版本)"
tag_id: '2371,2372,2247,3032,2274,2277,2242,2348,2597,2318,2551,2341,2389'
face_id: 9
tag_id_list: '[[845, 498, 497, 494], [880, 484, 3254], [276], [1070, 373, 372, 350], [494, 315], [1293, 1050], [284, 282], [254, 251], [1000, 494, 312], [295, 272, 253], [1376, 1365, 1088, 892, 395, 385], [427, 327], [3214, 1377, 1306, 1051, 327, 229]]'
page_size: 10
version: "7.33.0"
assert_num: 10
\ No newline at end of file
community:
#社区tab页feed流
-
case: "社区tab页 feed流"
version: "7.43.0"
assert: null
tabtype: choice
tags_id: []
tab_id: 0
\ No newline at end of file
config_list:
#社区tab获取签到和招募case
-
case: "社区tab签到和招募,有数据返回"
version: "7.43.0"
assert: null
assert1: 1
\ No newline at end of file
free_recruit_banner:
#社区免费招募活动列表背景图片
-
case: "免费招募活动列表背景图片"
version: "7.44.0"
assert: null
json: ""
free_recruit_list:
#社区招募活动列表
-
case: "免费招募活动列表"
version: "7.44.0"
assert: null
json: ""
tab_type: 1
page: 1
size: 10
index_v9:
#成功登录case
-
case: "请求成功,有数据返回"
current_city_id: "beijing"
tabtype: "choice"
version: "7.42.2"
assert: 0
\ No newline at end of file
#城市筛选器
service_home_city_v2:
-
case: "城市筛选器接口"
current_city_id: ""
lat: "40.002"
lng: "116.487252"
assert: 0
eyelids_plastic:
#模拟双眼皮效果
-
case: "平行双眼皮效果"
version: "7.43.0"
image_url: "2021/05/12/1457/cdbe8652117d"
style_id: "1"
-
case: "开扇双眼皮效果"
version: "7.43.0"
image_url: "2021/05/12/1457/cdbe8652117d"
style_id: "3"
\ No newline at end of file
analysis_v2:
#AI测颜值
-
case: "3D结果页"
device_id: "869412032478155"
image_url: "2021/06/03/1648/247517c71122"
landmark: '[{"x":168.96603,"y":496.76886},{"x":168.35735,"y":527.7101},{"x":169.548,"y":558.3961},{"x":171.72018,"y":588.8369},{"x":174.93307,"y":619.26794},{"x":179.31195,"y":649.03467},{"x":184.17123,"y":678.6978},{"x":191.05627,"y":707.8003},{"x":200.86497,"y":735.76196},{"x":214.62796,"y":761.79736},{"x":231.40042,"y":785.7622},{"x":250.59685,"y":807.22406},{"x":272.07196,"y":826.8049},{"x":295.4251,"y":843.86194},{"x":321.47278,"y":856.83124},{"x":349.9967,"y":864.5885},{"x":379.85767,"y":866.998},{"x":409.25287,"y":865.863},{"x":437.7829,"y":859.18054},{"x":463.35132,"y":846.88574},{"x":486.354,"y":830.38916},{"x":507.7304,"y":811.95135},{"x":527.778,"y":791.59247},{"x":545.7143,"y":769.32104},{"x":561.4353,"y":745.4949},{"x":573.70917,"y":719.9794},{"x":583.3716,"y":690.47156},{"x":591.3898,"y":660.6565},{"x":598.52515,"y":631.38513},{"x":604.5137,"y":601.75684},{"x":609.14844,"y":572.0621},{"x":612.0713,"y":541.85956},{"x":613.5779,"y":511.5329},{"x":203.42625,"y":444.83066},{"x":229.21182,"y":410.30188},{"x":270.9198,"y":399.64984},{"x":313.56497,"y":407.32513},{"x":354.0185,"y":422.54175},{"x":441.31384,"y":427.71216},{"x":482.0569,"y":416.21152},{"x":524.1508,"y":412.38593},{"x":563.6658,"y":426.22824},{"x":585.87964,"y":462.41913},{"x":394.46844,"y":504.41254},{"x":393.96762,"y":546.5007},{"x":393.30322,"y":588.8532},{"x":392.592,"y":631.0979},{"x":342.77267,"y":664.1739},{"x":364.95947,"y":668.7595},{"x":390.1893,"y":673.2006},{"x":415.25336,"y":670.5106},{"x":436.7552,"y":666.998},{"x":242.81853,"y":506.60803},{"x":262.98138,"y":497.55713},{"x":305.08954,"y":499.77777},{"x":321.22906,"y":513.3391},{"x":301.56146,"y":521.4862},{"x":260.00668,"y":519.3686},{"x":462.97388,"y":517.84485},{"x":480.18396,"y":505.8437},{"x":522.09973,"y":506.45386},{"x":540.26013,"y":517.4052},{"x":523.0011,"y":528.3126},{"x":482.06146,"y":527.1489},{"x":239.75659,"y":436.6534},{"x":277.67075,"y":433.85788},{"x":315.04602,"y":438.8376},{"x":351.56638,"y":447.66888},{"x":441.58453,"y":452.58017},{"x":477.96664,"y":447.28973},{"x":515.05225,"y":445.83618},{"x":551.5746,"y":451.62656},{"x":284.38373,"y":496.0074},{"x":280.49805,"y":523.8891},{"x":284.44955,"y":508.43988},{"x":501.19617,"y":503.6411},{"x":502.51047,"y":530.9885},{"x":501.47836,"y":515.5879},{"x":357.51913,"y":508.84628},{"x":428.91504,"y":511.1767},{"x":341.02893,"y":607.7458},{"x":442.021,"y":610.8187},{"x":324.796,"y":641.13324},{"x":456.35925,"y":645.5844},{"x":304.6747,"y":728.90186},{"x":334.5838,"y":715.599},{"x":369.0162,"y":710.4512},{"x":390.31683,"y":714.9321},{"x":411.64032,"y":711.3696},{"x":445.83594,"y":718.7887},{"x":474.80075,"y":735.1745},{"x":451.05292,"y":753.0734},{"x":421.3767,"y":761.7219},{"x":390.41638,"y":763.2075},{"x":358.4326,"y":759.44385},{"x":328.53287,"y":748.5295},{"x":311.38818,"y":729.83777},{"x":350.23193,"y":734.1919},{"x":390.38123,"y":737.72284},{"x":429.7071,"y":736.18054},{"x":468.49692,"y":735.4535},{"x":430.71494,"y":739.61053},{"x":391.11005,"y":741.01697},{"x":349.98578,"y":737.08875},{"x":284.5382,"y":508.54742},{"x":501.50644,"y":515.53107}]'
cheek_style_classify_id: "1"
-
case: "3D-上次报告页"
device_id: "869412032478155"
image_url: ""
landmark: ""
cheek_style_classify_id: "1"
\ No newline at end of file
analysis_v3:
#AI测颜值
-
case: "AI测颜值结果页"
device_id: "869412032478155"
image_url: "2021/06/01/1524/8a28dd0a3b8e"
landmark: '[{"x":248.60858,"y":454.0434},{"x":247.92863,"y":476.7021},{"x":248.8779,"y":499.36874},{"x":251.12755,"y":521.8638},{"x":254.58401,"y":544.24164},{"x":259.10333,"y":566.1669},{"x":264.02515,"y":588.0588},{"x":270.59506,"y":609.44214},{"x":279.6361,"y":629.6998},{"x":291.60773,"y":648.29407},{"x":305.6806,"y":665.26465},{"x":321.33615,"y":680.4736},{"x":338.2943,"y":694.64526},{"x":356.13144,"y":707.5386},{"x":375.71283,"y":717.8617},{"x":397.27545,"y":724.19965},{"x":419.9613,"y":726.1914},{"x":441.62817,"y":725.2733},{"x":462.6242,"y":719.917},{"x":481.41635,"y":710.3818},{"x":498.45187,"y":697.98035},{"x":514.59436,"y":684.40234},{"x":529.7782,"y":669.4685},{"x":543.08704,"y":653.1195},{"x":554.60706,"y":635.73456},{"x":563.3266,"y":617.3142},{"x":570.0075,"y":596.0911},{"x":575.7123,"y":574.78046},{"x":581.05774,"y":554.0385},{"x":585.48157,"y":533.1105},{"x":588.66907,"y":512.06683},{"x":590.4706,"y":490.68823},{"x":591.2653,"y":469.50403},{"x":279.37485,"y":410.2143},{"x":299.98352,"y":383.6742},{"x":331.64465,"y":375.0197},{"x":364.35858,"y":381.4741},{"x":395.4406,"y":394.20447},{"x":466.45248,"y":397.95},{"x":496.4015,"y":389.2094},{"x":527.33295,"y":386.7473},{"x":555.7313,"y":398.20285},{"x":571.48254,"y":425.62354},{"x":427.4568,"y":456.95285},{"x":426.77496,"y":483.84033},{"x":426.04883,"y":510.83325},{"x":425.32236,"y":537.75256},{"x":385.83856,"y":572.9858},{"x":403.71045,"y":573.0551},{"x":423.23145,"y":574.53534},{"x":442.28857,"y":574.4508},{"x":459.13876,"y":574.9396},{"x":307.80756,"y":458.6329},{"x":323.8154,"y":450.41855},{"x":359.07312,"y":453.8022},{"x":371.75238,"y":466.2728},{"x":355.36838,"y":470.9956},{"x":321.71375,"y":468.2021},{"x":479.14362,"y":470.68353},{"x":492.57837,"y":459.77023},{"x":526.78955,"y":459.34094},{"x":540.76917,"y":469.22626},{"x":526.91675,"y":477.2774},{"x":494.3828,"y":476.6469},{"x":307.39963,"y":402.42038},{"x":336.54358,"y":400.2494},{"x":365.31128,"y":405.05597},{"x":393.4093,"y":412.95276},{"x":466.55408,"y":416.23398},{"x":493.2259,"y":412.04782},{"x":520.28235,"y":410.81372},{"x":546.7446,"y":415.7663},{"x":341.78073,"y":449.21838},{"x":338.20166,"y":471.98853},{"x":342.39044,"y":460.15692},{"x":509.66327,"y":456.7909},{"x":510.57373,"y":479.22314},{"x":508.77704,"y":467.26038},{"x":399.44565,"y":461.61548},{"x":453.4572,"y":463.86423},{"x":384.4139,"y":527.5456},{"x":463.68613,"y":530.3157},{"x":369.6485,"y":554.5674},{"x":475.98178,"y":558.04224},{"x":358.72372,"y":632.25916},{"x":379.92645,"y":612.99927},{"x":406.5278,"y":600.8932},{"x":422.78525,"y":604.4064},{"x":439.0467,"y":601.5054},{"x":463.0918,"y":613.59924},{"x":480.34888,"y":633.28406},{"x":463.28207,"y":645.23676},{"x":442.62195,"y":651.3627},{"x":420.9704,"y":652.71295},{"x":398.036,"y":651.2082},{"x":376.4565,"y":644.82745},{"x":363.59555,"y":631.5963},{"x":392.39032,"y":626.09314},{"x":422.20786,"y":626.16754},{"x":449.31833,"y":626.3133},{"x":475.72333,"y":632.3503},{"x":448.87988,"y":625.9888},{"x":421.7511,"y":626.1827},{"x":392.28534,"y":625.9193},{"x":342.4176,"y":460.03064},{"x":508.8405,"y":467.07236}]'
cheek_style_classify_id: "1"
-
case: "AI测颜值-上次报告页"
device_id: "869412032478155"
image_url: ""
landmark: ""
cheek_style_classify_id: "1"
\ No newline at end of file
plastic_cheek_style_classify:
#获取3D变脸配置
-
case: "获取3D变脸配置"
version: "7.44.0"
assert: 0
simulate_analyze:
#AI模拟发型
-
case: "青春丸子头效果"
device_id: "869412032478155"
image_url: "2021/06/02/1456/68c702f50309"
style_id: 3
type_id: 7
-
case: "盐系少年头效果"
device_id: "869412032478155"
image_url: "2021/06/02/1456/68c702f50309"
style_id: 6
type_id: 7
#模拟眉毛
-
case: "新月眉效果"
device_id: "869412032478155"
image_url: "2021/06/07/1447/56b2766d3ef3"
style_id: 1
type_id: 9
-
case: "野生眉效果"
device_id: "869412032478155"
image_url: "2021/06/07/1447/56b2766d3ef3"
style_id: 2
type_id: 9
#模拟美瞳
-
case: "天空蓝美瞳效果"
device_id: "869412032478155"
image_url: "2021/06/07/1451/86b01d9a9d66"
style_id: 1
type_id: 8
-
case: "清新绿"
device_id: "869412032478155"
image_url: "2021/06/07/1451/86b01d9a9d66"
style_id: 2
type_id: 8
\ No newline at end of file
simulate_conf:
#获取模拟整形配置文件
-
case: "获取模拟配置文件(发型,美瞳,眉毛,双眼皮)"
type_id: "-1"
skin_newReport:
#测颜值根据五官推荐美购
-
case: "请求成功"
version: "7.43.0"
image_url: "https://pic.igengmei.com/2021/05/11/1440/25e4bf45673f-s"
assert: 1
\ No newline at end of file
skin_user_had_test:
-
case: "验证用户是否使用过测肤功能"
device_id: "androidid_7255c3398845cdd5"
assert: True
\ No newline at end of file
diary:
-
case: "校验接口返回成功case"
hospital: "bjxyjcpfbyy"
assert_error: 0
\ No newline at end of file
detail:
#校验成功case
-
case: "校验接口调用成功case"
assert_error: 0
assert: "北京嘉禾医疗美容"
assert1: "私密修复"
assert2: "民营"
assert3: 56895
assert4: {index: true, service: true, doctor: true, publish: false, doctor_say: false, diary: true, answer: false}
assert5: "https://heras.igengmei.com/doctor/2020/07/29/ef19b5fa94-w"
-
case: "校验医院名称case"
assert_error: 0
assert: "北京嘉禾医疗美容"
assert1: "私密修复"
assert2: "民营"
assert3: 56895
assert4: {index: true, service: true, doctor: true, publish: false, doctor_say: false, diary: true, answer: false}
assert5: "https://heras.igengmei.com/doctor/2020/07/29/ef19b5fa94-w"
-
case: "校验明星项目case"
assert_error: 0
assert: "北京嘉禾医疗美容"
assert1: "私密修复"
assert2: "民营"
assert3: 56895
assert4: {index: true, service: true, doctor: true, publish: false, doctor_say: false, diary: true, answer: false}
assert5: "https://heras.igengmei.com/doctor/2020/07/29/ef19b5fa94-w"
-
case: "校验医院类型case"
assert_error: 0
assert: "北京嘉禾医疗美容"
assert1: "私密修复"
assert2: "民营"
assert3: 56895
assert4: {index: true, service: true, doctor: true, publish: false, doctor_say: false, diary: true, answer: false}
assert5: "https://heras.igengmei.com/doctor/2020/07/29/ef19b5fa94-w"
-
case: "校验优惠券返回case"
assert_error: 0
assert: "北京嘉禾医疗美容"
assert1: "私密修复"
assert2: "民营"
assert3: 56895
assert4: {index: true, service: true, doctor: true, publish: false, doctor_say: false, diary: true, answer: false}
assert5: "https://heras.igengmei.com/doctor/2020/07/29/ef19b5fa94-w"
-
case: "校验tab返回case"
assert_error: 0
assert: "北京嘉禾医疗美容"
assert1: "私密修复"
assert2: "民营"
assert3: 56895
assert4: {index: true, service: true, doctor: true, publish: false, doctor_say: false, diary: true, answer: false}
assert5: "https://heras.igengmei.com/doctor/2020/07/29/ef19b5fa94-w"
-
case: "校验医院图片case"
assert_error: 0
assert: "北京嘉禾医疗美容"
assert1: "私密修复"
assert2: "民营"
assert3: 56895
assert4: {index: true, service: true, doctor: true, publish: false, doctor_say: false, diary: true, answer: false}
assert5: "https://heras.igengmei.com/doctor/2020/07/29/ef19b5fa94-w"
doctor:
-
case: "校验接口返回成功case"
assert_error: 0
assert_id: "ad99d0b0b6eb4a2c97ffadad48b7cdfd"
assert_name: "赵希军"
assert_good_at: "吸脂瘦身"
assert_cases: "自体脂肪填充面部 80例"
assert_title: "副主任"
-
case: "校验医生id case"
assert_error: 0
assert_id: "ad99d0b0b6eb4a2c97ffadad48b7cdfd"
assert_name: "赵希军"
assert_good_at: "吸脂瘦身"
assert_cases: "自体脂肪填充面部 80例"
assert_title: "副主任"
-
case: "校验医生名称case"
assert_error: 0
assert_id: "ad99d0b0b6eb4a2c97ffadad48b7cdfd"
assert_name: "赵希军"
assert_good_at: "吸脂瘦身"
assert_cases: "自体脂肪填充面部 80例"
assert_title: "副主任"
-
case: "校验医生明星项目case"
assert_error: 0
assert_id: "ad99d0b0b6eb4a2c97ffadad48b7cdfd"
assert_name: "赵希军"
assert_good_at: "吸脂瘦身"
assert_cases: "自体脂肪填充面部 80例"
assert_title: "副主任"
-
case: "校验医生案例case"
assert_error: 0
assert_id: "ad99d0b0b6eb4a2c97ffadad48b7cdfd"
assert_name: "赵希军"
assert_good_at: "吸脂瘦身"
assert_cases: "自体脂肪填充面部 80例"
assert_title: "副主任"
-
case: "校验医生title case"
assert_error: 0
assert_id: "ad99d0b0b6eb4a2c97ffadad48b7cdfd"
assert_name: "赵希军"
assert_good_at: "吸脂瘦身"
assert_cases: "自体脂肪填充面部 80例"
assert_title: "副主任"
\ No newline at end of file
services:
-
case: "校验接口调用成功case"
assert_error: 0
# assert_sku: 608136
# assert_spu: 5844882
# assert_discount: True
# assert_sales: 3
# assert_card_type: "card"
# assert_title: "【阴道紧缩】菲蜜丽激光外阴收紧,【激光阴道紧缩】进口菲蜜丽 外阴收紧 小阴唇整形+私密清洁 阴道紧致 紧致润滑 产后修复 改善松弛"
# assert_tagselected: true
# -
# case: "校验商品数据case"
# assert_error: 0
# assert_sku: 608136
# assert_spu: 5844882
# assert_discount: True
# assert_sales: 3
# assert_card_type: "card"
# assert_title: "【阴道紧缩】菲蜜丽激光外阴收紧,【激光阴道紧缩】进口菲蜜丽 外阴收紧 小阴唇整形+私密清洁 阴道紧致 紧致润滑 产后修复 改善松弛"
# assert_tagselected: true
# -
# case: "校验商品标签数据case"
# assert_error: 0
# assert_sku: 608136
# assert_spu: 5844882
# assert_discount: True
# assert_sales: 3
# assert_card_type: "card"
# assert_title: "【阴道紧缩】菲蜜丽激光外阴收紧,【激光阴道紧缩】进口菲蜜丽 外阴收紧 小阴唇整形+私密清洁 阴道紧致 紧致润滑 产后修复 改善松弛"
# assert_tagselected: true
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
diary_album:
#进入日记本相册case--无须字段
-
case: "进入日记本相册case"
assert: false
assert2: true
#
#diary_cancelfavor:
#-
# case: "取消收藏case"
# assert: "已取消收藏"
question_new_answer_list:
#问题详情页--回答列表
-
case: "问题详情页--回答列表--有回答"
error: 0
error1: 1
message: "没有更多了"
question_id: 210502
assert: false
assert2: true
-
case: "问题详情页--回答列表--无回答"
error: 0
question_id: 358247
assert: false
assert2: true
error1: 1
message: "没有更多了"
question_v1:
#问题详情
-
case: "问题详情"
error: 0
assert: false
assert2: true
sub_wiki:
-
#百科详情页-项目聚合百科,玻尿酸
case: "百科详情页-项目聚合百科,玻尿酸"
current_city_id: "beijing"
version: "744.0"
assert: 玻尿酸
\ No newline at end of file
get_gift_data:
-
case: "校验接口返回成功case"
gift_id: "111"
assert_message: "来晚咯,美券已领完!"
\ No newline at end of file
gift_list_data:
-
case: "校验接口返回成功case"
service_id: 5857263
gift_type: 1
page: 1
assert_error: 0
\ No newline at end of file
related_service_data:
-
case: "商祥页-推荐商品列表-接口调用成功case"
service_id: "5815040"
page: 1
assert_error: 0
\ No newline at end of file
auto_msg:
#验证成功case
-
case: "请求成功,有数据返回"
trace_id: "2021/04/22/1722/70a1791606d5"
conversation_id: 368
assert: True
\ No newline at end of file
conversation_detail:
#验证成功case
-
case: "请求成功,有数据返回"
current_city_id: "beijing"
begin_msg_id: 0
conversation_type: 4
end_msg_id: 0
referrer: message_home
assert: 0
send_msg:
#验证成功case
-
case: "给咨询师发送消息成功"
#current_city_id: beijing
conversation_id: 368
is_system: 0
referrer: "message_home"
referrer_id: ""
msg_type: 0
content: "您好,我想咨询一下---"
extra: ""
assert_conversation_type: 4
assert_message_type: 0
#验证失败case
-
case: "给咨询师发送消息失败"
#current_city_id: beijing
conversation_id: 463465
is_system: 0
referrer: "message_home"
referrer_id: ""
msg_type: 0
content: "您好,我想咨询一下---"
extra: {}
assert_message: "服务器开小差了~"
beauty_card_detail:
#次卡商详页
-
case: "次卡商详页spuid=100018"
assert: 0
spu_id: 100018
sku_id: 10046
welfareId: 100018
version: 7.44.0
current_city_id: beijing
lat: 40.001879
lng: 116.487194
-
case: "次卡商详页spuid=100021"
assert: 0
spu_id: 100021
sku_id: 10159
welfareId: 100021
version: 7.44.0
current_city_id: beijing
lat: 40.001879
lng: 116.487194
beauty_card_order_confirm:
-
case: "次卡-确认订单-接口调用成功case"
sku_id: "10176"
number: 1
use_bc_coupon: 1
bc_coupon_id: 0
assert_error: 0
beauty_card_order_detail_used:
-
case: "已使用次卡订单详情页"
order_id: 102247770691611
order_status: "5"
beauty_card_order_detail_using:
-
case: "部分使用次卡订单详情页"
order_id: 102794850373958
order_status: "4"
vertifi_count: "1"
beauty_card_order_detail_waituse:
-
case: "未使用次卡订单详情页"
order_id: 102625993440278
order_status: "4"
vertifi_count: "2"
\ No newline at end of file
beauty_card_order_submit:
-
case: "次卡-提交订单-校验接口返回成功case"
phone: "12345678912"
sku_id: "10176"
number: 1
is_doctor_see: 1
gain_coupon_id: 0
deduction_price: 0
assert_error: 0
\ No newline at end of file
beauty_card_payment_delete:
-
case: "次卡取消订单-接口调用成功case"
assert_data_message: "取消成功"
\ No newline at end of file
beauty_card_payment_detail:
-
case: "次卡订单详情-接口调用成功case"
assert_error: 0
\ No newline at end of file
beauty_card_payment_method:
-
case: "次卡-支付平台接口-校验接口调用成功case"
assert_error: 0
\ No newline at end of file
beauty_card_prepay_alipay:
-
case: "次卡支付宝支付-接口调用成功case"
is_huabei: 0
assert_error: 0
\ No newline at end of file
beauty_card_prepay_wechat:
-
case: "次卡微信支付-接口调用成功case"
assert_error: 0
\ No newline at end of file
beauty_card_refund_info:
-
case: "次卡-取消订单-接口调用成功case"
order_id: "102217820485006"
assert_error: 0
\ No newline at end of file
beauty_card_refund_submit:
-
case: "次卡-提交退款申请-接口调用成功case"
order_id: "102813852173916"
reason_id: 3
reason_text: "个人身体原因"
reason_type: 0
assert_message: "订单已经退款"
\ No newline at end of file
beauty_card_update_phone:
-
case: "次卡-确认订单页面-修改手机号-校验接口返回成功case"
authorize_phone: "+8612345678912"
authorize_phone_type: 1
vfc_code: "1234"
assert_message: "验证码校验不通过"
\ No newline at end of file
content_v7:
-
#搜索结果页-综合tab---搜索成功
case: "搜索结果页--综合tab---搜索成功"
query: "脱毛"
device_id: "1321222222222222135"
current_city_id: "beijing"
version: "742.2"
is_first: "1"
tab_type: "0"
offset: "0"
assert: 2
-
#搜索结果页-百科tab---搜索成功
case: "搜索结果页-百科tab---搜索成功"
query: "双眼皮"
device_id: "1321222222222222135"
current_city_id: "beijing"
version: "742.2"
is_first: "0"
tab_type: "12"
offset: "0"
assert: 12
-
#搜索结果页-综合tab---下拉加载成功(请求第二波数据)
case: "搜索结果页--综合tab---下拉加载成功(请求第二波数据)"
query: "双眼皮"
device_id: "1321222222222222135"
current_city_id: "beijing"
version: "742.2"
is_first: "0"
tab_type: "0"
offset: "10"
assert: 2
-
#搜索结果页-百科tab---下拉加载成功(请求第二波数据)
case: "搜索结果页-百科tab---下拉加载成功(请求第二波数据)"
query: "双眼皮"
device_id: "1321222222222222135"
current_city_id: "beijing"
version: "742.2"
is_first: "0"
tab_type: "12"
offset: "10"
assert: 12
# -测试环境无法验证该用例
# #搜索结果页-综合tab---召回百科穿插
# case: "搜索结果页--综合tab---没有召回百科穿插"
# query: "双眼皮"
# device_id: "1321222222222222135"
# current_city_id: "beijing"
# version: "742.2"
# is_first: "1"
# tab_type: "0"
# offset: "0"
# assert: 12
-
#搜索结果页-综合tab---搜索词为医院全称或简称,搜索结果页医院穿插置顶展示
case: "搜索结果页-综合tab---搜索词为医院全称或简称,搜索结果页医院穿插置顶展示"
query: "北京凯润婷"
device_id: "1321222222222222135"
current_city_id: "beijing"
version: "742.2"
is_first: "1"
tab_type: "0"
offset: "0"
assert: 3
-
#搜索结果页-综合tab---搜索词为医生全称,搜索结果页医生穿插置顶展示
case: "搜索结果页-综合tab---搜索词为医生全称,搜索结果页医生穿插置顶展示"
query: "崔鑫"
device_id: "1321222222222222135"
current_city_id: "beijing"
version: "742.2"
is_first: "1"
tab_type: "0"
offset: "0"
assert: 6
\ No newline at end of file
hospital_search:
-
#医院主页搜索---搜索成功,有数据召回
case: "医院主页搜索---搜索成功,当前搜索词召回的对应商品不少于5个,不展示热卖推荐商品"
query: "玻尿酸"
device_id: "1321222222222222135"
hospital_id: "96ea37eef81d11e692f800163e000a4a"
current_city_id: "beijing"
version: "742.2"
offset: "0"
size: "10"
assert1: 0
assert2: 0
-
#医院主页搜索---搜索成功,无数据召回
case: "医院主页搜索---搜索成功,当前搜索词下无对应商品,召回热卖推荐商品"
query: "美白针"
device_id: "1321222222222222135"
hospital_id: "96ea37eef81d11e692f800163e000a4a"
current_city_id: "beijing"
version: "742.2"
offset: "0"
size: "10"
assert1: 10
assert2: 10
-
#医院主页搜索---搜索成功,无数据召回
case: "医院主页搜索---搜索成功,当前搜索词召回的对应商品少于5个,展示热卖推荐商品"
query: "瘦脸针"
device_id: "1321222222222222135"
hospital_id: "96ea37eef81d11e692f800163e000a4a"
current_city_id: "beijing"
version: "742.2"
offset: "0"
size: "10"
assert1: 10
assert2: 10
\ No newline at end of file
keyword_tip:
-
#输入北京,接口有数据召回且SUG列表召回北京开头的医院信息
case: "输入北京,接口有数据召回且SUG列表召回北京开头的医院信息"
query: "北京"
lat: "39.9"
lng: "116.4"
version: "742.0"
assert1: unknown
assert2: hospital
# -
# #测试环境无法验证该用例
# #输入杨,接口有数据召回且SUG列表召回杨开头的医生信息
# case: "输入杨,接口有数据召回且SUG列表召回杨开头的医生信息"
# query: "杨"
# lat: "39.9"
# lng: "116.4"
# version: "742.0"
# assert1: unknown
# assert2: doctor
-
#输入双眼皮,接口有数据召回且SUG列表召回双眼皮下的项目百科信息
case: "输入双眼皮,接口有数据召回且SUG列表召回双眼皮下的项目百科信息"
query: "双眼皮"
lat: "39.9"
lng: "116.4"
version: "742.0"
assert1: project
assert2: unknown
\ No newline at end of file
mine_guess_you_like:
-
case: "校验接口返回成功case"
assert_error: 0
\ No newline at end of file
page_rules:
-
#直播-点击【设置封面】,成功调接口
case: "直播-点击【设置封面】,成功调接口"
version: "744.2"
current_city_id: "beijing"
page_name: "post_add_pic"
assert:
\ No newline at end of file
polymer:
#品类聚合页标签和专场banner
-
case: "品类聚合页面标签和专场banner"
assert: 82
version: 7.43.0
category_polymer_id: 82
device_id: 869378034450718
product_coupon_my_list:
-
case: "我的美券列表(新)-校验接口返回成功case"
start_num: 0
tab_id: 0
assert_error: 0
\ No newline at end of file
product_detail:
-
case: "校验接口调用成功case"
service_id: "5857263"
service_item_id: "618788"
version: "7.43.0"
assert_error: 0
-
case: "校验spu_id错误case"
service_id: "585726"
service_item_id: "618788"
version: "7.43.0"
assert_spu_message: "美购不存在"
# -
# case: "校验sku_id错误case"
# service_id: "5857263"
# service_item_id: "61878"
# version: "7.43.0"
# assert_sku_message: ""
# -
# case: "校验不传版本号case"
# service_id: "5857263"
# service_item_id: "618788"
# assert_version_message: "服务器开小差儿了"
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
service_hospital:
#次卡商详页-适用机构列表
-
case: "次卡适用机构列表spuid=100018"
assert: 0
offset: 0
sku_id: 10046
size: 1
version: 7.44.0
current_city_id: beijing
lat: 40.001879
lng: 116.487194
sku_info:
-
case: "校验接口返回成功case"
service_id: "5857263"
service_item_id: "618788"
assert_error: 0
\ No newline at end of file
tag_service:
#品类聚合页面商品
-
case: "品类聚合页面商品列表"
assert: 0
size: 10
tag_ids: []
offset: 0
tag_id:
version: 7.43.0
device_id: 869378034450718
danmu_v2:
#成功获取弹幕case
-
case: "成功获取弹幕"
channel_id: "739"
msg_id: 1
user_id: ""
assert: 0
assert_message: "获取弹幕失败"
#获取弹幕失败case
# -
# case: "获取弹幕失败-获取房间信息失败"
# channel_id: ""
# msg_id: 1
# user_id: ""
# assert: 0
\ No newline at end of file
push_live_info:
#主播成功开播case
-
case: "主播开播成功-未填写标签"
title: "小冤家"
cover_url: "2021/04/22/1003/cef471cff5e6"
notice: ""
tag_id: "1"
clarity: "1"
device_type: "1"
assert: 0
# assert_message1 : "请登录后再试"
assert_message0 : "请登录后再试"
-
case: "主播开播成功-填写标签"
title: "小冤家"
cover_url: "2021/04/22/1003/cef471cff5e6"
notice: "公告"
tag_id: "1"
clarity: "1"
device_type: "1"
assert: 0
# assert_message1 : "请登录后再试"
assert_message0 : "请登录后再试"
-
case: "主播开播成功-清晰度:高清开播"
title: "小冤家"
cover_url: "2021/04/22/1003/cef471cff5e6"
notice: "公告"
tag_id: "1"
clarity: "2"
device_type: "1"
assert: 0
# assert_message1 : "请登录后再试"
assert_message0 : "请登录后再试"
-
case: "主播开播成功-清晰度:超高清开播"
title: "小冤家"
cover_url: "2021/04/22/1003/cef471cff5e6"
notice: "公告"
tag_id: "1"
clarity: "2"
device_type: "1"
assert: 0
# assert_message1 : "请登录后再试"
assert_message0 : "请登录后再试"
my_conversation:
#验证成功case
-
case: "请求成功,有数据返回的第一页数据"
current_city_id: "beijing"
start_num: 0
count: 10
assert: 10
readall:
#验证成功case
-
case: "标记为已读成功"
uqid: "1B519701-A4F5-453E-9D99-140B5AF697A0"
trace_id: "2021/05/19/1526/19fcd4c4be47"
ua: "Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148"
assert: 0
\ No newline at end of file
unread:
#验证成功case
-
case: "请求成功,消息页各icon未读消息数等于总数"
uqid: "1B519701-A4F5-453E-9D99-140B5AF697A0"
trace_id: "2021/04/22/1722/46cf97b999b0"
#total_count:
assert: 0
recomend_services:
#测颜值根据五官推荐美购
-
case: "请求成功,返回个数正确"
version: "7.42.2"
business_tags_names: '[["玻尿酸垫下巴","自体脂肪垫下巴","硅胶垫下巴","膨体垫下巴"],["半永久纹眉","植眉"]]'
assert: 2
\ No newline at end of file
share_v4:
#测颜值结果
-
case: "请求成功,有数据返回"
version: "7.42.2"
face_id: "15844721"
assert: 0
\ No newline at end of file
my_status:
-
case: "我的订单-各状态订单数量-接口调用成功case"
assert_error: 0
\ 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
jump:
-
case: "普通美购下单流程--跳转第三方"
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
\ No newline at end of file
wechart_pay:
-
case: "普通美购订单支付流程--微信支付"
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
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
private_conversation:
#验证成功case
-
case: "发送消息成功"
content: "你好"
target_uid: 35874935
referrer: "message_home"
referrer_id: ""
is_system: 0
quick_consultation_id: ""
diary_id: ""
from_live: ""
assert_message: "消息发送成功"
assert_text: "你好"
#验证成功case
-
case: "发送消息成功"
content: "你好"
target_uid: 358749351
referrer: "message_home"
referrer_id: ""
is_system: 0
quick_consultation_id: ""
diary_id: ""
from_live: ""
assert_message1: "请登录"
favor:
#问题详情页--收藏&取消收藏校验
-
case: "问题详情页--收藏&取消收藏校验-"
current_city_id: "beijiing"
answer_id: 357124
error: 0
error1: 1
message1: "收藏成功"
message2: "请登录后再试"
message3: "取消收藏成功"
#!/usr/bin/env python
# -*- coding:utf-8 -*-
reply_answer:
- case: "接口正常case"
current_city_id: "beijing"
answer_id: "868312"
content: "长知识了"
user_id: "33910245"
assert: "操作成功"
extra: {}
diary_cards:
-
case: "测颜值底部feed流"
current_city_id: "beijing"
page: 1
count: 10
feature_results: '["细凤眼","眼距过宽","双眼皮","一字眉","流畅","厚唇","宽鼻翼","重度眼袋","尖下巴","无法令纹","娃娃脸",""]'
feed_type: 1
assert_nums: 10
\ No newline at end of file
content_v6:
-
#医院tab-捜索医院全称,捜索结果只召回该医院
case : "医院tab-捜索医院全称,捜索结果只召回该医院"
query: "北京画美医院"
device_id: "97B6764B-2135-4761-9911-701C38CBC272"
current_city_id: "beijing"
version: "742.2"
is_first: "0"
tab_type: "3"
offset: "0"
size: "10"
assert: 北京画美医院
-
#医院tab-捜索医院简称,捜索结果只召回该医院
case : "医院tab-捜索医院简称,捜索结果只召回该医院"
query: "北京画美"
device_id: "97B6764B-2135-4761-9911-701C38CBC272"
current_city_id: "beijing"
version: "742.2"
is_first: "0"
tab_type: "3"
offset: "0"
size: "10"
assert: 北京画美医院
-
#医生tab-捜索医生姓名,捜索结果只召回该医生
case : "医生tab-捜索医生姓名,捜索结果只召回该医生"
query: "崔鑫"
device_id: "97B6764B-2135-4761-9911-701C38CBC272"
current_city_id: "beijing"
version: "742.2"
is_first: "0"
tab_type: "4"
offset: "0"
size: "10"
assert: 崔鑫
\ No newline at end of file
hospital:
#品类聚合页医生tab
-
case: "品类聚合页面医生tab"
assert: null
cp_id: 82
tag_id: []
q: "眼部整形"
count: 10
device_id: 869378034450718
hot:
-
#进入搜索首页-成功调用搜索首页接口
case: "进入搜索首页-成功调用搜索首页接口"
version: "743.0"
assert: 0
keywords:
-
#进入搜索首页
case : "进入搜索首页-成功调用搜索首页接口"
current_city_id : "beijing"
search_tab : "0"
assert : 0
home_v5:
#获取商城首页
-
case: "获取商城首页index--case首页"
assert: 0
service_favor:
-
case: "校验收藏成功case"
assert_message: "收藏成功"
\ No newline at end of file
share_data:
-
case: "校验接口返回成功case"
p_id: "5857263"
u_id: "618788"
assert_error: 0
\ No newline at end of file
create_v1:
-
case: "普通美购下单--获取支付类型接口"
service_item_id: 599428
number: 1
platform_coupon_id: ""
use_point: 0
is_doctor_see: 1
doctor_coupon_id: ""
insurance_info: "[]"
is_create_groupbuy: 0
assert: 0
pay:
-
case: "普通美购下单流程--生成支付金额等信息"
service_item_id: 599428
number: 1
platform_coupon_id: ""
use_point: 0
is_doctor_see: 1
doctor_coupon_id: ""
insurance_info: "[]"
is_create_groupbuy: 0
assert: 0
\ No newline at end of file
pay_v1:
-
case: "普通美购下单流程--获取支付类型接口"
actual_pay: 656
payment_final_price: 2624
is_contains_groupbuy_order: "false"
mul_orders_number: "false"
assert: 0
preview_v1:
-
case: "普通美购下单流程--确认订单页面sucess"
current_city_id: "beijing"
service_item_id: 599428
number: 1
use_platform_coupon: 1
use_doctor_coupon: 1
use_coupon_grey: "true"
is_create_groupbuy: 0
assert: 0
\ No newline at end of file
settlement_delete:
-
case: "普通美购订单流程--取消订单成功"
start_num: 0
status: 0
version: 7.44.0
cancel_reason_value: 2
assert: "取消成功"
\ No newline at end of file
settlement_detail:
-
case: "普通美购订单流程--查看订单详情页订单存在"
id: 522139664651
assert: 0
-
case: "普通美购订单流程--查看订单详情页订单不存在"
id: 522139664650
assert: 1
\ No newline at end of file
add:
-
case: "校验添加成功case"
from_live: ""
number: 1
service_item_id: "618788"
assert_message: "添加成功"
\ No newline at end of file
list:
-
case: "校验接口返回成功case"
assert_error: 0
\ No newline at end of file
recommend_service:
-
case: "测肤底部feed流"
current_city_id: "beijing"
offset: 0
size: 10
appeal_tag_ids: '[2306,2303,2551,2355,2322,2337]'
device_id: "androidid_7255c3398845cdd5"
assert_nums: 10
\ No newline at end of file
topic_reply_vote:
#点赞case--日记贴评论点赞
-
case: "日记本列表点赞--点赞&取消点赞成功case--校验"
id: 35526988
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: "请登录后再试"
reply_create:
- assert1: null
case: 日记贴一级评论创建--正常校验&创建二级评论--正常校验
channel: benzhan
content: ces测试+2021-06-18 19:16:10
message: 请勿回复重复内容
message1: 回复成功
message2: 你的回复有点频繁,稍后再来
replied_id: 35526987
- assert2: 4
case: 日记贴一级&二级评论创建--同一个用户重复内容校验
channel: benzhan
content: ces测试
message: 请勿回复重复内容
message1: 回复成功
message2: 你的回复有点频繁,稍后再来
replied_id: 35526987
topic_detail:
#日记贴详情页
-
case: "日记贴详情页--展示--用户信息校验"
topic_id: 21249632
assert1: 0
topic_vote:
#日记贴详情页点赞
-
case: "日记贴详情页--点赞--用接口校验"
topic_id: 21249632
id: 21249632
assert1: 0
message1: " +1"
message2: "取消成功"
favor:
#用户贴详情页--收藏&取消收藏校验
-
case: "用户贴详情页--收藏&取消收藏校验-"
current_city_id: "beijiing"
tractate_id: 189080
data_type: "user_post"
message1: "收藏成功"
message2: "请登录后再试"
message3: "取消收藏成功"
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
publish_reply:
#帖子发布一级评论&二级评论
-
case: "贴子详情页--帖子发布一级评论--用接口校验可以发重复内容"
tractate_id: 175152
content: "太丰富发个刚刚"
data_type: "user_post"
current_city_id: "beijing"
reply_id: ""
assert1: 0
error: 0
message1: "点赞成功"
message2: "取消点赞成功"
- case: "贴子详情页--帖子发布二级评论--用接口校验可以发重复内容"
tractate_id: 175152
content: "太丰富发个刚刚"
data_type: "user_post"
current_city_id: "beijing"
reply_id: "2167124"
assert1: 0
error: 0
message1: "点赞成功"
message2: "取消点赞成功"
related_service:
#用户贴详情页--相关美购接口校验--只能校验字段是否为空,
-
case: "用户贴详情页--相关美购接口校验--无关联美购无推荐美购"
current_city_id: "beijiing"
tractate_id: 170479
data_type: "user_post"
assert_error: 0
assert_count: 10
-
case: "用户贴详情页--相关美购接口校验--有关联美购有推荐美购"
current_city_id: "beijiing"
tractate_id: 82208
data_type: "user_post"
assert_error: 0
assert_count: 10
reply:
#用户贴详情页--外显评论-校验字段是否为空,
-
case: "用户贴详情页--外显评论--校验字段是否为空-有多条评论"
current_city_id: "beijiing"
id: 82208
data_type: "user_post"
assert_error: 0
assert_count: 10
-
case: "用户贴详情页--外显评论--校验字段是否为空--无评论"
current_city_id: "beijiing"
id: 189080
data_type: "user_post"
assert_error: 0
assert_count: 10
tractate_vote:
#贴子详情页点赞
-
case: "贴子详情页--点赞&取消点赞--用接口校验"
tractate_id: 175152
reply_id: ""
data_type: "user_post"
current_city_id: "beijing"
assert1: 0
message1: "点赞成功"
message2: "取消点赞成功"
-
case: "贴子详情页--一级评论点赞&取消点赞--用接口校验"
tractate_id: 175152
reply_id: "2167124"
data_type: "user_post"
current_city_id: "beijing"
assert1: 0
message1: "点赞成功"
message2: "取消点赞成功"
answer:
-
case: "校验接口返回成功case"
user: "21476198"
assert_error: 0
\ No newline at end of file
personal_center:
#个人中心
-
case: "获取个人中心--case首页"
assert: 0
portrait: null
favor:
#个人中心
-
case: "日记贴收藏&取消收藏--case"
assert: 0
beautycard_filters:
-
#更美次卡商品列表组件筛选器-按SPU导入,筛选器接口正常
case: "更美次卡商品列表组件筛选器-按SPU导入,筛选器接口正常"
unit_id: "20109"
current_city_id: "beijing"
version: "743.0"
assert: 0
-
#更美次卡商品列表组件筛选器-按SKU导入,筛选器接口正常
case: "更美次卡商品列表组件筛选器-按SKU导入,筛选器接口正常"
unit_id: "20113"
current_city_id: "beijing"
version: "743.0"
assert: 0
\ No newline at end of file
beautycard_skus:
-
#更美次卡商品列表组件商品-按SPU导入,商品默认排序
case: "更美次卡商品列表组件商品-按SPU导入,商品默认排序"
unit_id: "20109"
tag_id: "-1"
area: "worldwide"
sort_type: "0"
page: "0"
page_size: "20"
assert: 0
-
#更美次卡商品列表组件商品-按SKU导入,商品默认排序
case: "更美次卡商品列表组件商品-按SKU导入,商品默认排序"
unit_id: "20113"
tag_id: "-1"
area: "worldwide"
sort_type: "0"
page: "0"
page_size: "20"
assert: 0
-
#更美次卡商品列表组件商品-按SPU导入,商品价格最低
case: "更美次卡商品列表组件商品-按SPU导入,商品价格最低"
unit_id: "20110"
tag_id: "-1"
area: "worldwide"
sort_type: "2"
page: "0"
page_size: "20"
assert: 0
-
#更美次卡商品列表组件商品-按SKU导入,商品价格最低
case: "更美次卡商品列表组件商品-按SKU导入,商品价格最低"
unit_id: "20114"
tag_id: "-1"
area: "worldwide"
sort_type: "2"
page: "0"
page_size: "20"
assert: 0
-
#更美次卡商品列表组件商品-按SPU导入,商品销量最高
case: "更美次卡商品列表组件商品-按SPU导入,商品销量最高"
unit_id: "20111"
tag_id: "-1"
area: "worldwide"
sort_type: "1"
page: "0"
page_size: "20"
assert: 0
-
#更美次卡商品列表组件商品-按SKU导入,商品销量最高
case: "更美次卡商品列表组件商品-按SKU导入,商品销量最高"
unit_id: "20115"
tag_id: "-1"
area: "worldwide"
sort_type: "1"
page: "0"
page_size: "20"
assert: 0
-
#更美次卡商品列表组件商品-按SPU导入,商品最新上架
case: "更美次卡商品列表组件商品-按SPU导入,商品最新上架"
unit_id: "20112"
tag_id: "-1"
area: "worldwide"
sort_type: "3"
page: "0"
page_size: "20"
assert: 0
-
#更美次卡商品列表组件商品-按SKU导入,商品最新上架
case: "更美次卡商品列表组件商品-按SKU导入,商品最新上架"
unit_id: "20116"
tag_id: "-1"
area: "worldwide"
sort_type: "3"
page: "0"
page_size: "20"
assert: 0
-
#更美次卡商品列表组件商品-按SPU导入,修改城市筛选器为北京,商品正常召回
case: "更美次卡商品列表组件商品-按SPU导入,修改城市筛选器为北京,商品正常召回"
unit_id: "20110"
tag_id: "-1"
area: "beijing"
sort_type: "2"
page: "0"
page_size: "20"
assert: 0
-
#更美次卡商品列表组件商品-按SKU导入,修改城市筛选器为北京,商品正常召回
case: "更美次卡商品列表组件商品-按SKU导入,修改城市筛选器为北京,商品正常召回"
unit_id: "20115"
tag_id: "-1"
area: "beijing"
sort_type: "1"
page: "0"
page_size: "20"
assert: 0
visual_beauty_card_services:
-
#更美次卡橱窗-按SPU导入,定位北京,商品正常召回
case: "更美次卡橱窗-按SPU导入,定位北京,商品正常召回"
unit_id: "20105"
current_city_id: "beijing"
page: "0"
page_size: "50"
version: "743.0"
assert: 0
-
#更美次卡橱窗-按SKU导入,定位北京,商品正常召回
case: "更美次卡橱窗-按SKU导入,定位北京,商品正常召回"
unit_id: "20106"
current_city_id: "beijing"
page: "0"
page_size: "50"
version: "743.0"
assert: 0
\ No newline at end of file
gengmei_get_wxacode_unlimited:
-
case: "测颜值结果页获取小程序分享二维码"
page: "pages/scanFace/report/main"
scene: "scan_code=gm_code&fid=27923989"
\ No newline at end of file
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
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_doctor_api.web2_request import web2_request
class TestArtemisAdAddShoppingCartInfo:
data = BaseRequest().api_load(path_setting.ADADDSHOPPINGCARTINFO)
adaddshoppingcartinfo_case, adaddshoppingcartinfo_data = get_ids(data, "artemis_ad_add_shopping_cart_info")
@pytest.mark.parametrize("param",adaddshoppingcartinfo_data,ids=adaddshoppingcartinfo_case)
def test_artemis_ad_add_shopping_cart_info(self, param):
'''我的购物车列表'''
r = web2_request().artemis_ad_add_shopping_cart_info()
if r["error"] == 0:
data = r.get("data").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.web2_request import web2_request
class TestArtemisAddValueOrderIdDetail:
data = BaseRequest().api_load(path_setting.VALUEORDERIDDETAIL)
addvalueorderiddetail_case, addvalueorderiddetail_data = get_ids(data, "artemis_add_value_order_id_detail")
@pytest.mark.parametrize("param",addvalueorderiddetail_data,ids=addvalueorderiddetail_case)
def test_artemis_add_value_order_id_detail(self, param):
'''我的服务订单-已购买'''
r = web2_request().artemis_add_value_order_id_detail()
if r["error"] == 0:
assert r["data"]["status"] == param["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
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 TestServiceDeletelist:
service_deletelist = BaseRequest().api_load(path_setting.DELETELIST_DATA)
ServiceDeletelist_case, ServiceDeletelist_data = get_ids(service_deletelist, "service_deletelist")
@pytest.mark.parametrize("params" ,ServiceDeletelist_data ,ids=ServiceDeletelist_case)
def test_ServiceDeletelist(self ,params):
r = web2_request().service_deletelist(params['page'])
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 TestServiceList:
service_list = BaseRequest().api_load(path_setting.SERVICE_DATA)
ServiceList_case, ServiceList_data = get_ids(service_list, "service_list")
@pytest.mark.parametrize("params",ServiceList_data,ids=ServiceList_case)
def test_ServiceList(self,params):
r = web2_request().service_list(params['page'],params['pagesize'],params['is_online'],params['extra_filter_choice'])
print("======",r)
if r["error"] == 0:
assert r["data"]["page"] == params["assert"]
elif r["error"] == 1:
assert r["message"] == params["assert"]
# else:
# assert r['error'] == 0
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 TestServiceReviewList:
service_review_list = BaseRequest().api_load(path_setting.SERVICE_REVIEW_DATA)
ServiceReviewList_case, ServiceReviewList_data = get_ids(service_review_list, "service_review_list")
@pytest.mark.parametrize("params", ServiceReviewList_data, ids=ServiceReviewList_case)
def test_ServiceReviewList(self, params):
r = web2_request().service_review_list(params['page'], params['pagesize'], params['type'])
print("--------",r)
if r["error"] == 0:
assert r["data"]["page"] == params["assert"]
# elif r["error"] == 1:
# assert r["message"] == params["assert"]
\ No newline at end of file
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 TestServicereviewOption:
servicereview_option = BaseRequest().api_load(path_setting.SERVICEREVIEW_OPTION_DATA)
ServicereviewOption_case, ServicereviewOption_data = get_ids(servicereview_option, "servicereview_option")
@pytest.mark.parametrize("params", ServicereviewOption_data, ids=ServicereviewOption_case)
def test_ServicereviewOption(self, params):
r = web2_request().servicereview_option(params['id'], params['type'], params['csrfmiddlewaretoken'])
print("--------",r)
if r["error"] == 0:
assert r["error"] == params["assert"]
print("....")
# elif r["error"] == 1:
# assert r["data"] == params["assert"]
\ No newline at end of file
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 TestTagAll:
tag_all = BaseRequest().api_load(path_setting.TAG_DATA)
TagAll_case, TagAll_data = get_ids(tag_all, "tag_all")
@pytest.mark.parametrize("param", TagAll_data, ids=TagAll_case)
def test_TagAll(self, param):
r = web2_request().tag_all()
print("--------",r)
if r["error"] == 0:
assert r["error"] == param["assert"]
# elif r["error"] == 1:
# assert r["data"] == params["assert"]
\ No newline at end of file
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 TestAccountUnreadbadgecount:
account_unreadbadgecount = BaseRequest().api_load(path_setting.ACCOUNT_DATA)
AccountUnreadbadgecount_case, AccountUnreadbadgecount_data = get_ids(account_unreadbadgecount, "account_unreadbadgecount")
@pytest.mark.parametrize("param",AccountUnreadbadgecount_data,ids=AccountUnreadbadgecount_case)
def test_AccountUnreadbadgecount(self,param):
r = web_request().account_unreadbadgecount()
print("=====",r)
if r["error"] == 0:
assert r["error"] == param["assert"]
# elif r["error"] == 1:
# assert r["message"] == params["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_doctor_api.web_request import web_request
class TestArtemisAdTypeList:
data = BaseRequest().api_load(path_setting.ADTYPELIST)
adtypelist_case, adtypelist_data = get_ids(data, "artemis_ad_type_list")
@pytest.mark.parametrize("param",adtypelist_data,ids=adtypelist_case)
def test_artemis_ad_type_list(self, param):
'''服务资源列表'''
r = web_request().artemis_ad_type_list()
if r["error"] == 0:
adtypes = r.get("data").get("adtypes", [])
assert len(adtypes) >= 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 TestArtemisOrderIdDetail:
data = BaseRequest().api_load(path_setting.ORDERIDDETAIL)
orderiddetail_case, orderiddetail_data = get_ids(data, "artemis_order_id_detail")
@pytest.mark.parametrize("param",orderiddetail_data,ids=orderiddetail_case)
def test_artemis_order_id_detail(self, param):
'''我的服务订单'''
r = web_request().artemis_order_id_detail()
if r["error"] == 0:
assert r["data"]["detail_type"] == param["assert_detail_type"]
assert r["data"]["status"] == param["assert_status"]
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 TestArtemisOrderList:
data = BaseRequest().api_load(path_setting.ORDERLIST)
orderlist_case, orderlist_data = get_ids(data, "artemis_order_list")
@pytest.mark.parametrize("param",orderlist_data,ids=orderlist_case)
def test_artemis_order_list(self, param):
'''我的服务订单'''
r = web_request().artemis_order_list(param["status"], param["page"])
if r["error"] == 0:
orders = r.get("data").get("orders", [])
assert len(orders) >= param["assert"]
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 TestArticleVideotoken:
article_videotoken = BaseRequest().api_load(path_setting.ARTICLE_DATA)
ArticleVideotoken_case, ArticleVideotoken_data = get_ids(article_videotoken, "article_videotoken")
@pytest.mark.parametrize("param",ArticleVideotoken_data,ids=ArticleVideotoken_case)
def test_ArticleVideotokent(self,param):
r = web_request().article_videotoken()
print("=======",r)
if r["error"] == 0:
assert r["error"] == param["assert"]
# elif r["error"] == 1:
# assert r["message"] == params["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_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 TestConversationUserID:
data = BaseRequest().api_load(path_setting.CONVERSATIONUSERID)
userid_case, userid_data = get_ids(data, "conversation_user_id")
@pytest.mark.parametrize("param",userid_data,ids=userid_case)
def test_conversation_user_id(self, param):
'''发送私信'''
r = web_request().conversation_user_id(param["type"], param["content"], param["doctor_user_id"], param["t"], param["csrfmiddlewaretoken"])
print(r)
if r["error"] == 0:
assert r["data"]["name"] == param["assert_name"]
assert r["message"] == param["assert_message"]
if r["error"] == 300009:
assert r["message"] == param["assert_message1"]
# if r["error"] == 300005:
# assert r["message"] == param["assert_message2"]#assert_message2: "该方法未经授权,无法访问"
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_doctor_api.web_request import web_request
class TestCpcHomepage:
data = BaseRequest().api_load(path_setting.CPCHOMEPAGE)
cpchomepage_case, cpchomepage_data = get_ids(data, "cpc_homepage")
@pytest.mark.parametrize("param",cpchomepage_data,ids=cpchomepage_case)
def test_cpc_homepage(self, param):
'''点点通-概览'''
r = web_request().cpc_homepage()
if r["error"] == 0:
if r["data"]["account"] <= "0":
assert r["data"]["is_cpc"] == param["assert"]
else:
assert r["data"]["is_cpc"] == param["assert1"]
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 TestDoctorSubmechanisms:
doctor_submechanisms = BaseRequest().api_load(path_setting.DOCTOR_DATA)
DoctorSubmechanisms_case, DoctorSubmechanisms_data = get_ids(doctor_submechanisms, "doctor_submechanisms")
@pytest.mark.parametrize("param",DoctorSubmechanisms_data,ids=DoctorSubmechanisms_case)
def test_DoctorSubmechanisms_data(self,param):
r = web_request().doctor_submechanisms()
print("=======",r)
if r["error"] == 0:
assert r["error"] == param["assert"]
# elif r["error"] == 1:
# assert r["message"] == params["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_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 TestServiceAll:
service_all = BaseRequest().api_load(path_setting.SERVICEALL_DATA)
ServiceAll_case, ServiceAll_data = get_ids(service_all, "service_all")
@pytest.mark.parametrize("param",ServiceAll_data,ids=ServiceAll_case)
def test_ServiceAll(self,param):
r = web_request().service_all()
print("=====",r)
if r["error"] == 0:
assert r["error"] == param["assert"]
\ No newline at end of file
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
artemis_ad_add_shopping_cart_info:
#我的购物车case
-
case: "我的购物车"
assert: 0
artemis_add_value_order_id_detail:
#已购买case
-
case: "已购买"
assert: "已购买"
service_delete:
#我的商品-删除下线商品
-
case: "我的商品-删除下线商品"
is_delete: "1"
service_register_id: "209863"
csrfmiddlewaretoken: "PC8uTySuxipukIMuqNV1OPB376C2ZZ3g"
assert: 0
service_deletelist:
#我的商品-商品回收站
-
case: "我的商品-商品回收站"
page: "1"
assert: 0
\ No newline at end of file
service_list:
#我的商品菜单下有数据返回1
-
case: "我的商品-全部tab"
page: "1"
pagesize: "10"
is_online: "-1"
extra_filter_choice: "-1"
assert: 1
-
case: "我的商品-上线tab"
page: "1"
pagesize: "10"
is_online: "-1"
extra_filter_choice: "-1"
assert: 1
-
case: "我的商品-下线tab"
page: "1"
pagesize: "10"
is_online: "0"
extra_filter_choice: "-1"
assert: 1
-
case: "我的商品-待升级(全部tab)"
page: "1"
pagesize: "10"
is_online: "-1"
extra_filter_choice: "0"
assert: 1
-
case: "我的商品-待修改类目(全部tab)有数据返回"
page: "1"
pagesize: "10"
is_online: "-1"
extra_filter_choice: "1"
assert: 1
service_review_list:
#有数据返回
-
case: "商品审核-新商品审核 "
page: "1"
pagesize: "10"
type: "0"
assert: 1
-
case: "商品审核-商品修改审核"
page: "1"
pagesize: "10"
type: "1"
assert: 1
-
case: "商品审核-新商品审核"
page: "1"
pagesize: "10"
type: "2"
assert: 1
servicereview_option:
#有数据返回
-
case: "新商品审核-撤回审核"
id: "209989"
type: "1"
csrfmiddlewaretoken: "PC8uTySuxipukIMuqNV1OPB376C2ZZ3g"
assert: 0
-
case: "新商品审核-取消申请"
id: "209744"
type: "0"
csrfmiddlewaretoken: "PC8uTySuxipukIMuqNV1OPB376C2ZZ3g"
assert: 0
-
case: "商品修改审核-撤回审核 "
id: "209866"
type: "1"
csrfmiddlewaretoken: "PC8uTySuxipukIMuqNV1OPB376C2ZZ3g"
assert: 0
-
case: "新商品审核-取消申请"
id: "209996"
type: "0"
csrfmiddlewaretoken: "PC8uTySuxipukIMuqNV1OPB376C2ZZ3g"
assert: 0
tag_all:
-
case: "发布商品-选择类目跳转发布商品页面tag接口 "
assert: 0
\ No newline at end of file
account_unreadbadgecount:
-
case: "发布商品-选择类目跳转发布商品页面account接口 "
assert: 0
\ No newline at end of file
artemis_ad_type_list:
#服务资源case
-
case: "服务资源"
assert: 0
assert_account: 0
assert1: True
artemis_order_id_detail:
#已上线订单服务订单详情页case
-
case: "已上线订单服务订单详情页case"
assert_status: 3
assert_detail_type: 6
artemis_order_list:
#我的服务订单case
-
case: "我的服务订单请求失败case"
status: ""
page: 1
assert: 0
-
case: "我的服务订单-待支付广告包case"
status: 0
page: 1
assert: 0
-
case: "我的服务订单-已购买case"
status: 1
page: 1
assert: 0
-
case: "我的服务订单-待审核case"
status: 2
page: 1
assert: 0
-
case: "我的服务订单-待上线case"
status: 3
page: 1
assert: 0
-
case: "我的服务订单-上线中case"
status: 4
page: 1
assert: 0
-
case: "我的服务订单-已下线case"
status: 5
page: 1
assert: 0
-
case: "我的服务订单-已支付广告包case"
status: 6
page: 1
assert: 0
-
case: "我的服务订单-已关闭广告包case"
status: 7
page: 1
assert: 0
article_videotoken:
-
case: "发布商品-选择类目跳转发布商品页面article接口 "
assert: 0
\ No newline at end of file
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
conversation_user_id:
#发送私信case
-
case: "发送成功"
type: 0
content: 您好
doctor_user_id: 602329
t: 271caac2ae1687ca0a56ee18115b8183
csrfmiddlewaretoken: NLeTxEx1BOQo1zjv2us9BQ00ViMAHGpJ
assert_message: "消息发送成功"
assert_name: "露露2"
- case: "发送失败"
type: 0
content: 您好
doctor_user_id: 6023291
t: 271caac2ae1687ca0a56ee18115b8183
csrfmiddlewaretoken: NLeTxEx1BOQo1zjv2us9BQ00ViMAHGpJ
assert_message1: "没有权限!"
assert_name1: "露露2"
cpc_homepage:
#点点通商品-概览case
-
case: "点点通商品概览"
#doctor_user_id: "602329"
assert: False
assert_account: 0
assert1: True
doctor_submechanisms:
-
case: "发布商品-选择类目跳转发布商品页面doctor接口 "
assert: 0
\ No newline at end of file
service:
#私信点击发送商品case
-
case: "点击私信发送商品按钮"
#page: 1
assert_size: 10
assert: 10
service_all:
-
case: "编辑商品、上线商品"
assert: 0
\ No newline at end of file
service_offline:
-
case: "我的商品-下线商品"
id: 209992
csrfmiddlewaretoken: PC8uTySuxipukIMuqNV1OPB376C2ZZ3g
assert: 0
import pytest
import path_setting
from all_om_api.beautycard_request import beautycard_request
from ids_list import get_ids
from in_common.base_request import BaseRequest
#更美次卡-按次卡sku_id导入,导入校验
class TestCheckSkuIds:
data = BaseRequest().api_load(path_setting.CHECK_SKU_IDS)
check_sku_ids_case, check_sku_ids_data = get_ids(data, "check_sku_ids")
@pytest.mark.parametrize("param",check_sku_ids_data,ids=check_sku_ids_case)
def test_check_sku_ids(self,param):
r = beautycard_request().check_sku_ids(param["sku_ids"])
if r["code"] == 0:
if r["data"][0]["status"] == 1:
print("成功导入次卡")
assert r["data"][0]["reason"] == param["assert"]
else:
print("次卡不能成功导入")
assert r["data"][0]["reason"] == param["assert"]
if r["code"] == 1:
print("接口有误")
\ No newline at end of file
import pytest
import path_setting
from all_om_api.beautycard_request import beautycard_request
from ids_list import get_ids
from in_common.base_request import BaseRequest
#更美次卡-按次卡spu_id导入,导入校验
class TestCheckSpuIds:
data = BaseRequest().api_load(path_setting.CHECK_SPU_IDS)
check_spu_ids_case, check_spu_ids_data = get_ids(data, "check_spu_ids")
@pytest.mark.parametrize("param",check_spu_ids_data,ids=check_spu_ids_case)
def test_check_spu_ids(self,param):
r = beautycard_request().check_spu_ids(param["spu_ids"])
if r["code"] == 0:
if r["data"][0]["status"] == 1:
print("成功导入次卡")
assert r["data"][0]["reason"] == param["assert"]
else:
print("次卡不能成功导入")
assert r["data"][0]["reason"] == param["assert"]
if r["code"] == 1:
print("接口有误")
\ No newline at end of file
import pytest
import path_setting
from all_om_api.beautycard_request import beautycard_request
from ids_list import get_ids
from in_common.base_request import BaseRequest
#更美次卡-删除/批量删除已添加页面次卡
class TestDeleteRelatedBc:
data = BaseRequest().api_load(path_setting.DELETE_RELATED_BC)
delete_related_bc_case, delete_related_bc_data = get_ids(data, "delete_related_bc")
@pytest.mark.parametrize("param",delete_related_bc_data,ids=delete_related_bc_case)
def test_delete_related_bc(self,param):
r = beautycard_request().delete_related_bc(param["unit_id"], param["bc_sku_ids"], param["bc_spu_ids"], param["related_type"])
if r["code"] == 0:
print("成功删除已添加页面次卡")
assert r["data"] == param["assert"]
if r["code"] == 1:
print("未删除已添加页面次卡")
\ No newline at end of file
import pytest
import path_setting
from all_om_api.beautycard_request import beautycard_request
from ids_list import get_ids
from in_common.base_request import BaseRequest
#更美次卡-获取已添加页面次卡spu/sku列表
class TestExportRelatedBc:
data = BaseRequest().api_load(path_setting.EXPORT_RELATED_BC)
export_related_bc_case, export_related_bc_data = get_ids(data, "export_related_bc")
@pytest.mark.parametrize("param",export_related_bc_data,ids=export_related_bc_case)
def test_export_related_bc(self,param):
r = beautycard_request().export_related_bc(param["unit_id"], param["bc_sku_id"], param["bc_spu_id"])
if r["data"]:
print("成功导出已添加页面次卡信息")
assert len(r["data"]["beauty_cards"]) != param["assert"]
if not r["data"]:
print("未导出已添加页面次卡信息")
\ No newline at end of file
import pytest
import path_setting
from all_om_api.beautycard_request import beautycard_request
from ids_list import get_ids
from in_common.base_request import BaseRequest
#更美次卡-获取已添加页面次卡spu/sku列表
class TestGetRelatedBc:
data = BaseRequest().api_load(path_setting.GET_RELATED_BC)
get_related_bc_case, get_related_bc_data = get_ids(data, "get_related_bc")
@pytest.mark.parametrize("param",get_related_bc_data,ids=get_related_bc_case)
def test_get_related_bc(self,param):
r = beautycard_request().get_related_bc(param["unit_id"], param["bc_sku_id"], param["bc_spu_id"], param["page"], param["page_size"])
if r["data"]:
print("成功获取已添加页面次卡spu/sku列表")
assert len(r["data"]["beauty_cards"]) != param["assert"]
if not r["data"]:
print("未获取到已添加页面次卡spu/sku列表")
\ No newline at end of file
import pytest
import path_setting
from all_om_api.beautycard_request import beautycard_request
from ids_list import get_ids
from in_common.base_request import BaseRequest
#更美次卡-更改次卡排序
class TestUpdateBcRank:
data = BaseRequest().api_load(path_setting.UPDATE_BC_RANK)
update_bc_rank_case, update_bc_rank_data = get_ids(data, "update_bc_rank")
@pytest.mark.parametrize("param",update_bc_rank_data,ids=update_bc_rank_case)
def test_update_bc_rank(self,param):
r = beautycard_request().update_bc_rank(param["unit_id"], param["related_id"], param["related_type"], param["rank"])
if r["code"] == 0:
print("成功修改已添加页面该次卡排序")
assert r["data"] == param["assert"]
if r["code"] == 1:
print("未能修改已添加页面该次卡排序")
\ No newline at end of file
import pytest
import path_setting
from all_om_api.login_request import login_request
from ids_list import get_ids
from in_common.base_request import BaseRequest
#om后台-登录
class TestOmLogin:
data = BaseRequest().api_load(path_setting.OMLOGIN)
om_login_case, om_login_data = get_ids(data, "om_login")
@pytest.mark.parametrize("param",om_login_data,ids=om_login_case)
def test_om_login(self,param):
r = login_request().om_login(param["username"], param["password"])
if r["code"] == 0:
print("om后台成功登陆")
assert r["msg"] == param["assert"]
if r["code"] != 0:
print("om后台登陆出错")
assert r["msg"] == param["assert"]
\ No newline at end of file
#更美次卡-按次卡sku_id导入,导入校验
check_sku_ids:
#按SKU导入-导入单条数据,导入成功
-
case : "按SKU导入-导入单条数据,导入成功"
sku_ids : '[{"import_id":"10066","rank":0,"row":1}]'
assert : ''
#按SKU导入-导入单条数据,ID不存在
- case: "按SKU导入-导入单条数据,ID不存在"
sku_ids: '[{"import_id":"100666","rank":0,"row":1}]'
assert: ID不存在
#按SKU导入-导入单条数据,暂无适用机构
- case: "按SKU导入-导入单条数据,暂无适用机构"
sku_ids: '[{"import_id":"10023","rank":0,"row":1}]'
assert: 暂无适用机构
#按SKU导入-导入单条数据,已下线
- case: "按SKU导入-导入单条数据,已下线"
sku_ids: '[{"import_id":"10022","rank":0,"row":1}]'
assert: 已下线
#按SKU导入-导入单条数据,ID格式错误
- case: "按SKU导入-导入单条数据,ID格式错误"
sku_ids: '[{"import_id":"我","rank":0,"row":1}]'
assert: ID格式错误
#按SKU导入-导入多条数据,导入成功
-
case : "按SKU导入-导入多条数据,导入成功"
sku_ids : '[{"import_id":"10242","rank":0,"row":1},{"import_id":"10243","rank":0,"row":1},{"import_id":"10244","rank":0,"row":1}]'
assert : ''
\ No newline at end of file
#更美次卡-按次卡spu_id导入,导入校验
check_spu_ids:
#按SPU导入-导入单条数据,导入成功
-
case : "按SPU导入-导入单条数据,导入成功"
spu_ids : '[{"import_id":"100052","rank":0,"row":1}]'
assert : ''
#按SPU导入-导入单条数据,ID不存在
- case: "按SPU导入-导入单条数据,ID不存在"
spu_ids: '[{"import_id":"1000522","rank":0,"row":1}]'
assert: ID不存在
#按SPU导入-导入单条数据,暂无适用机构
- case: "按SPU导入-导入单条数据,暂无适用机构"
spu_ids: '[{"import_id":"100022","rank":0,"row":1}]'
assert: 暂无适用机构
#按SPU导入-导入单条数据,已下线
- case: "按SPU导入-导入单条数据,已下线"
spu_ids: '[{"import_id":"100035","rank":0,"row":1}]'
assert: 已下线
#按SPU导入-导入单条数据,ID格式错误
- case: "按SPU导入-导入单条数据,ID格式错误"
spu_ids: '[{"import_id":"我","rank":0,"row":1}]'
assert: ID格式错误
#按SPU导入-导入多条数据,导入成功
-
case : "按SPU导入-导入多条数据,导入成功"
spu_ids : '[{"import_id":"100055","rank":1,"row":1},{"import_id":"100056","rank":2,"row":1},{"import_id":"100057","rank":3,"row":1}]'
assert : ''
\ No newline at end of file
#更美次卡-删除/批量删除已添加页面次卡
delete_related_bc:
#按SPU导入-已添加页面删除单条数据
-
case : "按SPU导入-已添加页面删除单条数据"
unit_id : "19896"
bc_sku_ids : "[]"
bc_spu_ids : "[28]"
related_type : "7"
assert: 1
#按SPU导入-已添加页面删除多条数据
-
case : "按SPU导入-已添加页面删除多条数据"
unit_id : "19896"
bc_sku_ids : "[]"
bc_spu_ids : "[30,31,33]"
related_type : "7"
assert: 3
#按SKU导入-已添加页面删除单条数据
-
case : "按SKU导入-已添加页面删除单条数据"
unit_id : "19933"
bc_sku_ids : "[10144]"
bc_spu_ids : "[]"
related_type : "8"
assert: 1
#按SKU导入-已添加页面删除多条数据
-
case : "按SKU导入-已添加页面删除多条数据"
unit_id : "19933"
bc_sku_ids : "[10141,10142]"
bc_spu_ids : "[]"
related_type : "8"
assert: 2
\ No newline at end of file
#更美次卡-已添加页面全部导出
export_related_bc:
#按SPU导入-已添加页面全部导出功能
-
case : "按SPU导入-已添加页面全部导出功能"
unit_id : "19896"
bc_sku_id : ""
bc_spu_id : ""
assert: 0
#按SKU导入-已添加页面全部导出功能
-
case : "按SKU导入-已添加页面全部导出功能"
unit_id : "19933"
bc_sku_id : ""
bc_spu_id : ""
assert: 0
\ No newline at end of file
#更美次卡-获取已添加页面次卡spu/sku列表
get_related_bc:
#按SPU导入-根据专题id获取已添加页面次卡spu列表
-
case : "按SPU导入-根据专题id获取已添加页面次卡spu列表"
unit_id : "20105"
bc_sku_id : ""
bc_spu_id : ""
page : "0"
page_size : "10"
assert: 0
#按SPU导入-根据专题和次卡spu_id获取已添加页面次卡spu列表
-
case : "按SPU导入-根据专题和次卡spu_id获取已添加页面次卡spu列表"
unit_id : "20105"
bc_sku_id : ""
bc_spu_id : "100023"
page : "0"
page_size : "10"
assert: 0
#按SKU导入-根据专题id获取已添加页面次卡spu列表
-
case : "按SKU导入-根据专题id获取已添加页面次卡spu列表"
unit_id : "20106"
bc_sku_id : ""
bc_spu_id : ""
page : "0"
page_size : "10"
assert: 0
#按SKU导入-根据专题和次卡spu_id获取已添加页面次卡spu列表
-
case : "按SKU导入-根据专题和次卡spu_id获取已添加页面次卡spu列表"
unit_id : "20106"
bc_sku_id : ""
bc_spu_id : "100023"
page : "0"
page_size : "10"
assert: 0
#按SKU导入-根据专题和次卡sku_id获取已添加页面次卡spu和sku列表
-
case : "按SKU导入-根据专题和次卡sku_id获取已添加页面次卡spu和sku列表"
unit_id : "20106"
bc_sku_id : "10066"
bc_spu_id : ""
page : "0"
page_size : "10"
assert: 0
#按SKU导入-根据专题和次卡spu_id、sku_id获取已添加页面次卡spu和sku列表
-
case : "按SKU导入-根据专题和次卡spu_id、sku_id获取已添加页面次卡spu和sku列表"
unit_id : "20106"
bc_sku_id : "10066"
bc_spu_id : "100023"
page : "0"
page_size : "10"
assert: 0
#按SPU导入-录入错误的spu_id,点击查询
-
case : "录入错误的spu_id,点击查询"
unit_id : "20105"
bc_sku_id : ""
bc_spu_id : "1111111111111"
page : "0"
page_size : "10"
assert: 0
#按SKU导入-录入错误的sku_id,点击查询
-
case : "录入错误的sku_id,点击查询"
unit_id : "20106"
bc_sku_id : "111111111111"
bc_spu_id : ""
page : "0"
page_size : "10"
assert: 0
\ No newline at end of file
#更美次卡-更改次卡排序
update_bc_rank:
#按SPU导入-更改次卡排序
-
case : "按SPU导入-更改次卡排序"
unit_id : "20105"
related_id : "100023"
related_type : "7"
rank : "77"
assert: 1
#按SKU导入-更改次卡排序
-
case: "按SKU导入-更改次卡排序"
unit_id: "20106"
related_id: "10065"
related_type: "8"
rank: "11"
assert: 1
\ No newline at end of file
om_login:
#om后台-登录-输入正确的用户名和正确的密码
-
case : "om后台-登录-输入正确的用户名和密码"
username : "admin"
password : "123123"
assert: success!
#om后台-登录-输入正确的用户名和错误的密码
-
case : "om后台-登录-输入正确的用户名和错误的密码"
username : "admin"
password : "1231234"
assert: Login failed!
#om后台-登录-输入正确的用户名和不输入密码
-
case : "om后台-登录-输入正确的用户名和不输入密码"
username : "admin"
password : ""
assert: Login failed!
#om后台-登录-输入正确的用户名和无效密码
-
case : "om后台-登录-输入正确的用户名和无效密码"
username : "admin"
password : "哈哈"
assert: Login failed!
#om后台-登录-输入错误的用户名和正确的密码
-
case : "om后台-登录-输入错误的用户名和正确的密码"
username : "admin1"
password : "123123"
assert: Login failed!
#om后台-登录-不输入用户名和输入正确的密码
-
case : "om后台-登录-不输入用户名和输入正确的密码"
username : ""
password : "123123"
assert: Login failed!
#om后台-登录-输入无效用户名和正确的密码
-
case : "om后台-登录-输入无效用户名和正确的密码"
username : "哈哈"
password : "123123"
assert: Login failed!
#om后台-登录-输入错误的用户名和输入错误的密码
-
case : "om后台-登录-输入错误的用户名和输入错误的密码"
username : "admin1"
password : "1231234"
assert: Login failed!
#om后台-登录-不输入用户名和密码
-
case : "om后台-登录-不输入用户名和密码"
username : ""
password : ""
assert: Login failed!
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