Commit 029c7d83 authored by 张淑琴's avatar 张淑琴

Merge branch 'common_dev' into zzsq_dev

parents 3fdea3d4 b642001b
No preview for this file type
......@@ -105,4 +105,5 @@ venv.bak/
.mypy_cache/
host.yaml
.DS_Store
*/.DS_Store
\ No newline at end of file
......@@ -12,9 +12,20 @@ class face_request(BaseRequest):
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))
# 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
......@@ -2,4 +2,15 @@ face_diarys:
method: get
url: /api/face/diary/cards
params:
facial_type2tag_names: ${facial_type2tag_names}
\ No newline at end of file
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
......@@ -57,9 +57,15 @@ class gmai_request(BaseRequest):
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().plastic_cheek_style_classify("7.44.0"))
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"))
......
......@@ -63,4 +63,12 @@ plastic_cheek_style_classify:
method: get
url: /gm_ai/plastic/cheek_style_classify
params:
version: ${version}
\ No newline at end of file
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
......@@ -41,6 +41,18 @@ class hybrid_request(BaseRequest):
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)
......
......@@ -37,4 +37,27 @@ brand:
version: ${version}
data: {}
json: {}
\ No newline at end of file
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 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 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 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
......@@ -12,9 +12,9 @@ class topic_request(BaseRequest):
return self.api_send(self.data["vote"])
# 详情页内部-取消点赞
def topic_canclevote(self, topic_id):
def topic_cancelvote(self, topic_id):
self.params["topic_id"] = topic_id
return self.api_send(self.data["canclevote"])
return self.api_send(self.data["cancelvote"])
# 进入日记贴详情页-用来判断这篇日记贴点赞过没
def topic_detail(self, topic_id):
......
......@@ -9,7 +9,7 @@ vote:
isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
#取消点赞
canclevote:
cancelvote:
method: delete
url: /api/topic/vote/
params:
......
......@@ -8,7 +8,7 @@ topic_reply_vote:
json: {}
isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
topic_reply_canclevote:
topic_reply_cancelvote:
method: post
url: /hybrid/api/topicreply/cancel_vote/_data
params:
......
......@@ -10,9 +10,9 @@ class topicreply_vote_request(BaseRequest):
self.params["id"] = id
return self.api_send(self.data["topic_reply_vote"])
def topic_reply_canclevote(self, id):
def topic_reply_cancelvote(self, id):
self.params["id"] = id
return self.api_send(self.data["topic_reply_canclevote"])
return self.api_send(self.data["topic_reply_cancelvote"])
# 进入日记贴详情页-用来判断这篇日记贴点赞过没
# def diary_detail(self, topic_id):
......
......@@ -27,19 +27,40 @@ class tractate_request(BaseRequest):
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"])
......@@ -38,10 +38,6 @@ reply:
isLogin: 0 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
#帖子收藏
favor:
method: post
......@@ -66,3 +62,42 @@ cancelfavor:
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
......@@ -8,7 +8,7 @@ class user_request(BaseRequest):
self.data = self.api_load(path_setting.PERSONAL_CENTER_CONFIG)
def personal_center(self):
print("fgx")
return self.api_send(self.data["personal_center"])
......@@ -37,7 +37,7 @@ class user_request(BaseRequest):
if __name__ == '__main__':
#个人中心
print(user_request().personal_center())
print("fgx")
#打印医生/医院主页问答列表接口返回
print(user_request().answer("21476198"))
......
......@@ -6,8 +6,14 @@ 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):
......@@ -28,6 +34,37 @@ class beautycard_request(BaseRequest):
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"))
\ No newline at end of file
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
......@@ -23,4 +23,49 @@ delete_related_bc:
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
develop_host:
# backend: http://backend.paas-develop.env
backend: http://backend.paas-develop.env
# om: http://om.paas-develop.env
doctor: http://doctor.paas-develop.env
# doctor: http://doctor.paas-develop.env
# backend: https://backend.igengmei.com
......@@ -17,27 +17,26 @@ DIARY_DATA = os.path.join(BASE_DIR, "backend_auto/test_backend_data/diary_data",
#日记本关联美购
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")
# 日记本列表-日记贴点赞相关()
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")
# 日记本修改日记信息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")
......@@ -55,14 +54,17 @@ TOPIC_SUB_COMMON = os.path.join(BASE_DIR, "backend_auto/test_backend_data/common
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")
# 日记贴-详情页内容
......@@ -83,8 +85,25 @@ TRACTATE_RELATED_SERVICE = os.path.join(BASE_DIR, "backend_auto/test_backend_dat
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")
#搜索首页-热门搜索
......@@ -162,11 +181,23 @@ XCX_GENGMEI_GET_WXACODE_UNLIMITED_DATA = os.path.join(BASE_DIR, "backend_auto/te
# 测颜值根据标签召回日记
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")
# 模拟发型
......@@ -450,6 +481,22 @@ GET_RELATED_BC = os.path.join(BASE_DIR, "backend_auto/test_om_data/beautycard_da
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")
......
......@@ -8,7 +8,7 @@ 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, "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):
......@@ -30,24 +30,6 @@ class TestReply:
assert r["data"]["reply_data"][0]["_type"] == param["type"] # 校验评论列表返回类型
# 帖子的评论列表
# r = common_request().tractate_common_reply(param["id"], param["type"])
# # print(r)
# if r["error"] == 0:
# assert r["error"] == param["assert1"]
# # 先判断有没有评论,然后判断里面需要的那些字段,如点赞字段,评论总数等,不传值,传空值
# if r["data"]["reply_data"]:
# assert r["data"]["reply_data"][0]["user_id"] is not None and r["data"]["reply_data"][0]["user_id"] is not "" # 用户id
# assert r["data"]["reply_data"][0]["user_portrait"] is not None and r["data"]["reply_data"][0]["user_portrait"] is not "" # 用户头像
# assert r["data"]["reply_data"][0]["gm_url"] is not None and r["data"]["reply_data"][0]["gm_url"] is not "" # 头像跳转链接
# assert r["data"]["reply_data"][0]["user_nickname"] is not None and r["data"]["reply_data"][0]["user_nickname"] is not "" # 用户名
# assert r["data"]["reply_data"][0]["content"] is not None and r["data"]["reply_data"][0]["content"] is not "" # 评论内容
# assert r["data"]["reply_data"][0]["reply_count"] is not None and r["data"]["reply_data"][0]["reply_count"] is not "" # 评论总数
# assert r["data"]["reply_data"][0]["reply_id"] is not None and r["data"]["reply_data"][0]["reply_id"] is not "" # 评论id
# assert r["data"]["reply_data"][0]["is_voted"] is not None and r["data"]["reply_data"][0]["is_voted"] is not "" # 是否点赞
# assert r["data"]["reply_data"][0]["_type"] == param["type4"] # 校验评论列表返回类型
......
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.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.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 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 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"]
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
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"]
......@@ -17,7 +17,7 @@ class TestTopicReplyVote:
if r["error"] == 1:
assert r["message"] == param["assert3"]
# 回到取消点赞状态
canclevote = topicreply_vote_request().topic_reply_canclevote(param["id"])
canclevote = topicreply_vote_request().topic_reply_cancelvote(param["id"])
assert canclevote["error"] == 0
# 校验点赞
vote = topicreply_vote_request().topic_reply_vote(param["id"])
......@@ -27,16 +27,16 @@ class TestTopicReplyVote:
assert vote["message"] == param["assert3"]
assert vote["error"] == 1
# 最后取消点赞,回到取消点赞的状态
canclevote = topicreply_vote_request().topic_reply_canclevote(param["id"])
assert canclevote["error"] == 0
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
# 最后取消点赞,回到取消点赞的状态
canclevote = topicreply_vote_request().topic_reply_canclevote(param["id"])
assert canclevote["error"] == 0
cancelvote = topicreply_vote_request().topic_reply_cancelvote(param["id"])
assert cancelvote["error"] == 0
#
......
......@@ -22,13 +22,13 @@ class TestVote:
assert vote["error"] == 0
assert vote["message"] == param["message1"]
# 取消点赞,回到取消点赞的状态
canclevote = topic_request().topic_canclevote(param["topic_id"])
assert canclevote["error"] == 0
cancelvote = topic_request().topic_cancelvote(param["topic_id"])
assert cancelvote["error"] == 0
else:
# 如果是已经点过赞的状态就直接取消点赞
canclevote = topic_request().topic_canclevote(param["topic_id"])
assert canclevote["error"] == 0
assert canclevote["message"] == param["message2"]
cancelvote = topic_request().topic_cancelvote(param["topic_id"])
assert cancelvote["error"] == 0
assert cancelvote["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 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"]
diary_common_reply:
common_reply:
#日记本列表评论列表--校验
-
case: "日记本列表评论列表--校验"
......
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
skin_user_had_test:
-
case: "验证用户是否使用过测肤功能"
device_id: "androidid_7255c3398845cdd5"
assert: True
\ No newline at end of file
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
personal_recommends:
#日记本详情页推荐接口校验
#详情页推荐接口校验
-
case: "校验详情页推荐数据--日记本"
current_city_id: "beijiing"
......
favor:
#问题详情页--收藏&取消收藏校验
-
case: "问题详情页--收藏&取消收藏校验-"
current_city_id: "beijiing"
answer_id: 357124
error: 0
error1: 1
message1: "收藏成功"
message2: "请登录后再试"
message3: "取消收藏成功"
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
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
......@@ -2,7 +2,7 @@ reply_create:
- assert1: null
case: 日记贴一级评论创建--正常校验&创建二级评论--正常校验
channel: benzhan
content: ces测试+2021-06-16 16:08:57
content: ces测试+2021-06-18 16:41:48
message: 请勿回复重复内容
message1: 回复成功
message2: 你的回复有点频繁,稍后再来
......
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: "取消点赞成功"
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: "取消点赞成功"
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
#更美次卡-获取已添加页面次卡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
#更美次卡-更改次卡排序
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
#更美次卡-按次卡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
#更美次卡-已添加页面全部导出
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
#更美次卡-更改次卡排序
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
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