Commit 0600a375 authored by 林颖's avatar 林颖

Merge branch 'common_dev' of http://git.wanmeizhensuo.com/dengyingying/backend_auto into common_dev

# Conflicts:
#	all_backend_api/tag_request.py
#	all_backend_api/tag_request.yaml
parents 2c32802b 370b4129
...@@ -10,6 +10,8 @@ class live_request(BaseRequest): ...@@ -10,6 +10,8 @@ class live_request(BaseRequest):
self.data = self.api_load(path_setting.ADDLIVESERVICE_CONFIG) self.data = self.api_load(path_setting.ADDLIVESERVICE_CONFIG)
self.data = self.api_load(path_setting.DELETELIVESERVICE_CONFIG) self.data = self.api_load(path_setting.DELETELIVESERVICE_CONFIG)
self.data = self.api_load(path_setting.DELETEGIFT_CONFIG) self.data = self.api_load(path_setting.DELETEGIFT_CONFIG)
self.data = self.api_load(path_setting.M_GET_CHANNEL_STATUS_CONFIG)
self.data = self.api_load(path_setting.MARK_LIVE_SERVICE_CONFIG)
#主播-推荐袋美购列表展示 #主播-推荐袋美购列表展示
def live_services(self, channel_id, stream_id, offset, size): def live_services(self, channel_id, stream_id, offset, size):
...@@ -73,8 +75,25 @@ class live_request(BaseRequest): ...@@ -73,8 +75,25 @@ class live_request(BaseRequest):
self.params["version"] = version self.params["version"] = version
return self.api_send(self.data["delete_live_gift"]) return self.api_send(self.data["delete_live_gift"])
#获取直播间状态
def m_get_channel_status(self, channel_id, version, device_id='97B6764B-2135-4761-9911-701C38CBC272'):
self.params["channel_id"] = channel_id
self.params["version"] = version
return self.api_send(self.data["m_get_channel_status"])
#主播标记讲解商品+取消标记
def mark_live_service(self, stream_id, channel_id, live_service_id, mark_status, version, device_id='97B6764B-2135-4761-9911-701C38CBC272'):
self.params["stream_id"] = stream_id
self.params["channel_id"] = channel_id
self.params["live_service_id"] = live_service_id
self.params["mark_status"] = mark_status
self.params["version"] = version
return self.api_send(self.data["mark_live_service"])
if __name__ == '__main__': if __name__ == '__main__':
print(live_request().live_services("745", "4177", "0", "10")) # print(live_request().live_services("745", "4177", "0", "10"))
print(live_request().search_service("beijing", "745", "", "0", "20", "7.45.0")) # print(live_request().search_service("beijing", "745", "", "0", "20", "7.45.0"))
print(live_request().add_live_service("745", "560641", "7.45.0")) # print(live_request().add_live_service("745", "560641", "7.45.0"))
print(live_request().delete_live_service("745", "7242", "7.45.0")) # print(live_request().delete_live_service("745", "7242", "7.45.0"))
\ No newline at end of file #print(live_request().m_get_channel_status("745", "7.46.0"))
print(live_request().mark_live_service("4233", "745", "7269", "1", "746.0"))
\ No newline at end of file
...@@ -78,4 +78,29 @@ delete_live_gift: ...@@ -78,4 +78,29 @@ delete_live_gift:
json: {} json: {}
isLogin: 1 isLogin: 1
#获取直播间状态
m_get_channel_status:
method: GET
url: /api/janus/live/m/get_channel_status
params:
channel_id: ${channel_id}
version: ${version}
data: {}
json: {}
isLogin: 1
#主播标记讲解商品+取消标记
mark_live_service:
method: POST
url: /api/janus/live/mark_live_service
params:
version: ${version}
data:
stream_id: ${stream_id}
channel_id: ${channel_id}
live_service_id: ${live_service_id}
mark_status: ${mark_status}
json: {}
isLogin: 1
...@@ -25,6 +25,12 @@ class janus_request(BaseRequest): ...@@ -25,6 +25,12 @@ class janus_request(BaseRequest):
#直播polling循环 #直播polling循环
self.data = self.api_load(path_setting.POLLING_CONFIG) self.data = self.api_load(path_setting.POLLING_CONFIG)
#直播获取美颜
#self.data = self.api_load(path_setting.BEAUTY_CONFIG)
#搜索结果页-综合/百科tab #搜索结果页-综合/百科tab
def content_v7(self, query, device_id, current_city_id, version, is_first, tab_type, offset): def content_v7(self, query, device_id, current_city_id, version, is_first, tab_type, offset):
#搜索词 #搜索词
...@@ -186,20 +192,15 @@ class janus_request(BaseRequest): ...@@ -186,20 +192,15 @@ class janus_request(BaseRequest):
return self.api_send(self.data['coupon_my_list']) return self.api_send(self.data['coupon_my_list'])
# 次卡订单详情页(未使用 和 部分使用 和 已使用) # 次卡订单详情页(未使用 和 部分使用 和 已使用)
def beauty_card_order_detail(self,order_id): def beauty_card_order_detail(self, order_id):
self.params['order_id'] = order_id self.params['order_id'] = order_id
return self.api_send(self.data['beauty_card_order_detail']) 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 ): def beauty_card_detail(self, spu_id, sku_id, version):
self.params['spu_id'] = spu_id self.params['spu_id'] = spu_id
self.params['sku_id'] = sku_id self.params['sku_id'] = sku_id
self.params['welfareId'] = welfareId
self.params['version'] = version 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"]) return self.api_send(self.data["beauty_card_detail"])
...@@ -240,11 +241,24 @@ class janus_request(BaseRequest): ...@@ -240,11 +241,24 @@ class janus_request(BaseRequest):
return self.api_send(self.data["polling"]) return self.api_send(self.data["polling"])
#直播-主播获取美颜效果
def beauty(self,channel_id):
self.params["channel_id"] = channel_id
return self.api_send(self.data["beauty"])
#直播-主播修改美颜效果
def beauty_post(self,channel_id,is_open,smooth,white,rosy):
self.params["channel_id"] = channel_id
self.params["is_open"] = is_open
self.params["smooth"] = smooth
self.params["white"] = white
self.params["rosy"] = rosy
return self.api_send(self.data["beauty_post"])
if __name__ == '__main__': if __name__ == '__main__':
#打印购物车-猜你喜欢列表接口返回 #打印购物车-猜你喜欢列表接口返回
print(janus_request().mine_guess_you_like()) # print(janus_request().mine_guess_you_like())
#打印商祥页-详情接口返回 #打印商祥页-详情接口返回
print(janus_request().product_detail("5857263", "618788", "7.43.0")) print(janus_request().product_detail("5857263", "618788", "7.43.0"))
#打印商祥页-sku信息接口返回 #打印商祥页-sku信息接口返回
...@@ -253,11 +267,11 @@ if __name__ == '__main__': ...@@ -253,11 +267,11 @@ if __name__ == '__main__':
print(janus_request().product_coupon_my_list(0, 0)) print(janus_request().product_coupon_my_list(0, 0))
#品类聚合页面商品列表接口返回 #品类聚合页面商品列表接口返回
print(janus_request().tag_service()) # print(janus_request().tag_service())
print("fgx") print("fgx")
#品类聚合页面标签和专场 #品类聚合页面标签和专场
print(janus_request().polymer()) # print(janus_request().polymer())
print("fgx") print("fgx")
#打印次卡-确认订单接口返回 #打印次卡-确认订单接口返回
...@@ -317,4 +331,10 @@ if __name__ == '__main__': ...@@ -317,4 +331,10 @@ if __name__ == '__main__':
#直播-点击【设置封面】 #直播-点击【设置封面】
print("直播-点击【设置封面】") print("直播-点击【设置封面】")
print(janus_request().page_rules("744.2", "beijing", "post_add_pic")) print(janus_request().page_rules("744.2", "beijing", "post_add_pic"))
#直播-主播获取美颜
print("meiyan")
print(janus_request().beauty("739"))
#直播-主播修改美颜
print("change meiyan")
print(janus_request().beauty_post("739","true","0.60","0.40","0.70"))
...@@ -139,11 +139,7 @@ beauty_card_detail: ...@@ -139,11 +139,7 @@ beauty_card_detail:
params: params:
spu_id: ${spu_id} spu_id: ${spu_id}
sku_id: ${sku_id} sku_id: ${sku_id}
welfareId: ${welfareId}
version: ${version} version: ${version}
current_city_id: ${current_city_id}
lat: ${lat}
lng: ${lng}
data: { } data: { }
json: { } json: { }
...@@ -324,3 +320,27 @@ polling: ...@@ -324,3 +320,27 @@ polling:
data: {} data: {}
json: {} json: {}
#直播-主播获取美颜
beauty:
method: get
url: /api/janus/live/beauty
params:
channel_id: ${channel_id}
data: {}
json: {}
isLogin: 1
#直播-主播修改美颜
beauty_post:
method: post
url: /api/janus/live/beauty
params: {}
data:
channel_id: ${channel_id}
is_open: ${is_open}
smooth: ${smooth}
white: ${white}
rosy: ${rosy}
json: {}
isLogin: 1
\ No newline at end of file
...@@ -11,7 +11,7 @@ class living_request(BaseRequest): ...@@ -11,7 +11,7 @@ class living_request(BaseRequest):
self.params["msg_id"] = msg_id self.params["msg_id"] = msg_id
self.params["user_id"] = user_id self.params["user_id"] = user_id
return self.api_send(self.data["danmu_v2"]) return self.api_send(self.data["danmu_v2"])
#主播开播 #主播开播git
def pushlive_info(self,title,cover_url,notice,tag_id,clarity,device_type): def pushlive_info(self,title,cover_url,notice,tag_id,clarity,device_type):
self.params["title"] = title self.params["title"] = title
self.params["cover_url"] = cover_url self.params["cover_url"] = cover_url
...@@ -20,9 +20,44 @@ class living_request(BaseRequest): ...@@ -20,9 +20,44 @@ class living_request(BaseRequest):
self.params["clarity"] = clarity self.params["clarity"] = clarity
self.params["device_type"] = device_type self.params["device_type"] = device_type
return self.api_send(self.data["pushlive_info"]) return self.api_send(self.data["pushlive_info"])
#用户-发送弹幕
def sendmsg(self,channel_id,msg):
self.params["channel_id"] = channel_id
self.params["msg"] = msg
return self.api_send(self.data['sendmsg'])
#观众进入直播间
def enter(self,channel_id, from_source, version, device_id="97B6764B-2135-4761-9911-701C38CBC272"):
self.params["channel_id"] = channel_id
self.params["from_source"] = from_source
self.params["version"] = version
return self.api_send(self.data["enter"])
#观众离开直播间
def leave(self,channel_id, version, device_id="97B6764B-2135-4761-9911-701C38CBC272"):
self.params["channel_id"] = channel_id
self.params["version"] = version
return self.api_send(self.data["leave"])
#直播结束-主播下播
def finish(self,channel_id, version, device_id="97B6764B-2135-4761-9911-701C38CBC272"):
self.params["channel_id"] = channel_id
self.params["version"] = version
return self.api_send(self.data["finish"])
#主播-分享按钮的点击
def get_live_info_audience(self,channel_id, version, device_id="97B6764B-2135-4761-9911-701C38CBC272"):
self.params["channel_id"] = channel_id
self.params["version"] = version
return self.api_send(self.data["get_live_info_audience"])
if __name__ == '__main__': if __name__ == '__main__':
(living_request().danmu_v2("739", "1")) (living_request().danmu_v2("739", "1"))
(living_request().pushlive_info("小冤家", "2021/04/22/1003/cef471cff5e6", "", "1", "1", "1")) (living_request().pushlive_info("小冤家", "2021/04/22/1003/cef471cff5e6", "", "1", "1", "1"))
print (living_request().sendmsg("739","你好"))
print(living_request().finish("745", "746.0"))
print(living_request().get_live_info_audience("745", "7.46.0"))
\ No newline at end of file
...@@ -24,32 +24,58 @@ pushlive_info: ...@@ -24,32 +24,58 @@ pushlive_info:
json: {} json: {}
isLogin: 1 isLogin: 1
#主播-推荐袋美购列表展示 #观众进入直播间
live_services: enter:
method: GET method: GET
url: /api/janus/live/live_services url: /api/live/enter
params: params:
channel_id: ${channel_id} channel_id: ${channel_id}
stream_id: ${stream_id} from_source: ${from_source}
offset: ${offset} version: ${version}
size: ${size}
data: {} data: {}
json: {} json: {}
isLogin: 1 isLogin: 1
#主播-推荐袋商品捜索功能 #观众离开直播间
search_services: leave:
method: GET method: GET
url: /api/janus/live/search_services url: /api/live/leave
params: params:
current_city_id: ${current_city_id}
channel_id: ${channel_id} channel_id: ${channel_id}
query: ${query} version: ${version}
offset: ${offset}
size: ${size}
trace_id: ${trace_id}
data: {} data: {}
json: {} json: {}
isLogin: 1 isLogin: 1
#用户-发送弹幕
sendmsg:
method: POST
url: /api/live/sendmsg
params: {}
data:
channel_id: ${channel_id}
msg: ${msg}
json: {}
isLogin: 1
#直播结束-主播下播
finish:
method: POST
url: /api/live/finish
params:
version: ${version}
data:
channel_id: ${channel_id}
json: {}
isLogin: 1
#主播-分享按钮的点击
get_live_info_audience:
method: GET
url: /api/live/get_live_info/audience
params:
channel_id: ${channel_id}
version: ${version}
data: {}
json: {}
isLogin: 1
...@@ -10,5 +10,12 @@ class tag_request(BaseRequest): ...@@ -10,5 +10,12 @@ class tag_request(BaseRequest):
def list(self, level=3, tag_from=1): def list(self, level=3, tag_from=1):
self.params["level"] = level self.params["level"] = level
self.params["tag_from"] = tag_from self.params["tag_from"] = tag_from
return self.api_send(self.data["list"]) return self.api_send(self.data["list"])
# 直播开播新加标签
def tag_add(self,name):
self.params["name"] = name
return self.api_send(self.data["tag_add"])
if __name__ == '__main__':
print(tag_request().tag_add("你好"))
...@@ -9,3 +9,12 @@ list: ...@@ -9,3 +9,12 @@ list:
json: {} json: {}
isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段 isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
#新增标签
tag_add:
method: post
url: /api/tag/add
params: {}
data:
name: ${name}
json: {}
isLogin: 1
...@@ -52,9 +52,10 @@ class user_request(BaseRequest): ...@@ -52,9 +52,10 @@ class user_request(BaseRequest):
self.params["count"] = count self.params["count"] = count
return self.api_send(self.data["my_diary_v2"]) return self.api_send(self.data["my_diary_v2"])
# 我的-日记 # 我的-帖子-我发布的
def user_tractate(self, page, count): def user_tractate(self, page, count):
self.params["page"] = page self.params["page"] = page
...@@ -63,6 +64,38 @@ class user_request(BaseRequest): ...@@ -63,6 +64,38 @@ class user_request(BaseRequest):
return self.api_send(self.data["user_tractate"]) return self.api_send(self.data["user_tractate"])
# 我的-帖子-我回复的
def reply_tractate(self, page, count, version):
self.params["page"] = page
self.params["count"] = count
self.params["version"] = version
return self.api_send(self.data["reply_tractate"])
# 我的-问题
def my_question(self, start_num, count):
self.params["start_num"] = start_num
self.params["count"] = count
return self.api_send(self.data["my_question"])
# 我的-收藏
def favors_services(self, start_num, count, current_city_id, device_id, version):
self.params["start_num"] = start_num
self.params["count"] = count
self.params["current_city_id"] = current_city_id
self.params["device_id"] = device_id
self.params["version"] = version
return self.api_send(self.data["favors_services"])
if __name__ == '__main__': if __name__ == '__main__':
#个人中心 #个人中心
print(user_request().personal_center()) print(user_request().personal_center())
...@@ -79,6 +112,15 @@ if __name__ == '__main__': ...@@ -79,6 +112,15 @@ if __name__ == '__main__':
#我的-日记 #我的-日记
print(user_request().my_diary_v2(0, 10)) print(user_request().my_diary_v2(0, 10))
#我的-帖子 #我的-帖子-我发布的
print(user_request().user_tractate(1, 10)) print(user_request().user_tractate(1, 10))
#我的-问题
print(user_request().my_question(0, 10))
#我的-问题
print(user_request().favors_services(0, 10, "beijing", "androidid_16a95f3fa31a4c0b", "7.46.0"))
#我的-帖子-我回复的
print(user_request().reply_tractate(1, 10, "7.46.0"))
...@@ -72,7 +72,7 @@ my_diary_v2: ...@@ -72,7 +72,7 @@ my_diary_v2:
isLogin: 1 isLogin: 1
# 我的-帖子 # 我的-帖子-我发布的
user_tractate: user_tractate:
method: GET method: GET
url: /api/user/tractate url: /api/user/tractate
...@@ -83,3 +83,41 @@ user_tractate: ...@@ -83,3 +83,41 @@ user_tractate:
json: {} json: {}
isLogin: 1 isLogin: 1
# 我的-问题
my_question:
method: GET
url: /api/user/my_question
params:
start_num: ${start_num}
count: ${count}
data: {}
json: {}
isLogin: 1
# 我的-收藏
favors_services:
method: GET
url: /api/user/favors/services
params:
start_num: ${start_num}
count: ${count}
current_city_id: ${current_city_id}
device_id: ${device_id}
version: ${version}
data: {}
json: {}
isLogin: 1
# 我的-帖子-我回复的
reply_tractate:
method: GET
url: /api/user/reply/tractate
params:
page: ${page}
count: ${count}
version: ${version}
data: {}
json: {}
isLogin: 1
...@@ -324,7 +324,8 @@ LIVEYAML_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "live_r ...@@ -324,7 +324,8 @@ LIVEYAML_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "live_r
DANMU_V2 = os.path.join(BASE_DIR, "backend_auto/test_backend_data/live_data", "danmu_v2.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") PUSH_LIVE_INFO = os.path.join(BASE_DIR, "backend_auto/test_backend_data/live_data", "pushlive_info.yaml")
#直播-发送弹幕
SENDMSG = os.path.join(BASE_DIR, "backend_auto/test_backend_data/live_data", "sendmsg.yaml")
#商祥页-详情 #商祥页-详情
...@@ -558,6 +559,11 @@ PAGE_RULES = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_data", ...@@ -558,6 +559,11 @@ PAGE_RULES = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_data",
POLLING_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "janus_request.yaml") POLLING_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "janus_request.yaml")
POLLING = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_data", "polling.yaml") POLLING = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_data", "polling.yaml")
#主播-获取美颜效果
#BEAUTY_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "janus_request.yaml")
BEAUTY = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_data", "beauty.yaml")
BEAUTY_POST = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_data", "beauty_post.yaml")
#直播关注/取关主播 #直播关注/取关主播
FOLLOW_ADD = os.path.join(BASE_DIR, "backend_auto/test_backend_data/user_data", "follow_add.yaml") FOLLOW_ADD = os.path.join(BASE_DIR, "backend_auto/test_backend_data/user_data", "follow_add.yaml")
FOLLOW_DEL = os.path.join(BASE_DIR, "backend_auto/test_backend_data/user_data", "follow_del.yaml") FOLLOW_DEL = os.path.join(BASE_DIR, "backend_auto/test_backend_data/user_data", "follow_del.yaml")
...@@ -591,6 +597,30 @@ DELETELIVESERVICE = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus ...@@ -591,6 +597,30 @@ DELETELIVESERVICE = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus
DELETEGIFT_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "janus_live_request.yaml") DELETEGIFT_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "janus_live_request.yaml")
DELETEGIFT = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_live_data", "delete_live_gift.yaml") DELETEGIFT = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_live_data", "delete_live_gift.yaml")
#获取直播间状态
M_GET_CHANNEL_STATUS_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "janus_live_request.yaml")
M_GET_CHANNEL_STATUS = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_live_data", "m_get_channel_status.yaml")
#观众进入直播间
ENTER_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "live_request.yaml")
ENTER = os.path.join(BASE_DIR, "backend_auto/test_backend_data/live_data", "enter.yaml")
#观众离开直播间
LEAVE_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "live_request.yaml")
LEAVE = os.path.join(BASE_DIR, "backend_auto/test_backend_data/live_data", "leave.yaml")
#直播结束-主播下播
FINISH_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "live_request.yaml")
FINISH = os.path.join(BASE_DIR, "backend_auto/test_backend_data/live_data", "finish.yaml")
#主播标记讲解商品+取消标记
MARK_LIVE_SERVICE_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "janus_live_request.yaml")
MARK_LIVE_SERVICE = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_live_data", "mark_live_service.yaml")
#主播-分享按钮的点击
GET_LIVE_INFO_AUDIENCE_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "live_request.yaml")
GET_LIVE_INFO_AUDIENCE = os.path.join(BASE_DIR, "backend_auto/test_backend_data/live_data", "get_live_info_audience.yaml")
#免费招募活动详情 #免费招募活动详情
FREE_RECRUIT_DETAIL_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "feed_request.yaml") FREE_RECRUIT_DETAIL_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "feed_request.yaml")
FREE_RECRUIT_DETAIL = os.path.join(BASE_DIR, "backend_auto/test_backend_data/feed_data", "free_recruit_detail.yaml") FREE_RECRUIT_DETAIL = os.path.join(BASE_DIR, "backend_auto/test_backend_data/feed_data", "free_recruit_detail.yaml")
...@@ -607,10 +637,25 @@ WINNING_USER_LIST = os.path.join(BASE_DIR, "backend_auto/test_backend_data/feed_ ...@@ -607,10 +637,25 @@ WINNING_USER_LIST = os.path.join(BASE_DIR, "backend_auto/test_backend_data/feed_
MY_DIARY_V2_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "user_request.yaml") MY_DIARY_V2_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "user_request.yaml")
MY_DIARY_V2 = os.path.join(BASE_DIR, "backend_auto/test_backend_data/user_data", "my_diary_v2.yaml") MY_DIARY_V2 = os.path.join(BASE_DIR, "backend_auto/test_backend_data/user_data", "my_diary_v2.yaml")
#我的-帖子 #我的-帖子-我发布的
USER_TRACTATE_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "user_request.yaml") USER_TRACTATE_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "user_request.yaml")
USER_TRACTATE = os.path.join(BASE_DIR, "backend_auto/test_backend_data/user_data", "user_tractate.yaml") USER_TRACTATE = os.path.join(BASE_DIR, "backend_auto/test_backend_data/user_data", "user_tractate.yaml")
#我的-问题
MY_QUESTION_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "user_request.yaml")
MY_QUESTION = os.path.join(BASE_DIR, "backend_auto/test_backend_data/user_data", "my_question.yaml")
#我的-收藏
FAVORS_SERVICES_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "user_request.yaml")
FAVORS_SERVICES = os.path.join(BASE_DIR, "backend_auto/test_backend_data/user_data", "favors_services.yaml")
#我的-帖子-我回复的
REPLY_TRACTATE_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "user_request.yaml")
REPLY_TRACTATE = os.path.join(BASE_DIR, "backend_auto/test_backend_data/user_data", "reply_tractate.yaml")
#直播-新增标签
TAG_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "tag_request.yaml")
TAG_ADD = os.path.join(BASE_DIR, "backend_auto/test_backend_data/tag_data", "tag_add.yaml")
if __name__ == '__main__': if __name__ == '__main__':
print("==========",LIVEYAML_CONFIG) print("==========",LIVEYAML_CONFIG)
...@@ -12,5 +12,33 @@ class TestPlasticnAnalysisV3: ...@@ -12,5 +12,33 @@ class TestPlasticnAnalysisV3:
@pytest.mark.parametrize("param",plasticanalysisv3_data,ids=plasticanalysisv3_case) @pytest.mark.parametrize("param",plasticanalysisv3_data,ids=plasticanalysisv3_case)
def test_plastic_analysis_v3(self,param): 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"]) r = gmai_request().plastic_analysis_v3(param["device_id"], param["image_url"], param["landmark"],param["cheek_style_classify_id"])
assert r["error"] == 0 assert r["error"] == 0
# 风格脸
face_analytics_info = r["data"]["face_analytics_info"]
assert len(face_analytics_info) > 0
for item in face_analytics_info:
name = item["name"]
# 脸型科普
kepu_text = item["analytics_info"]["unscramble"][0]["content_items"][0]["text"]
# print(name,kepu_text)
assert name not in (None, "")
assert kepu_text not in (None, "")
# 模拟整形方向
content_items = item["analytics_info"]["unscramble"][1]["content_items"]
for con in content_items:
text = con["text"]
# print(text)
assert text not in (None, "")
# 模拟整形方案
recommends = item["analytics_info"]["project"]["recommends"]
assert len(recommends) == 8
for ser in recommends:
text = ser["text"]
tag_name = ser["tag_name"]
gengmei_url = ser["gengmei_url"]
assert text not in (None, "")
assert tag_name not in (None, "")
assert gengmei_url == "gengmei://search_result?q={}&searchTabType=8".format(tag_name)
...@@ -14,4 +14,8 @@ class TestSimulateAnalyze: ...@@ -14,4 +14,8 @@ class TestSimulateAnalyze:
def test_plastic_analysis_v3(self,param): def test_plastic_analysis_v3(self,param):
r = gmai_request().simulate_analyze(param["device_id"], param["image_url"], param["style_id"] ,param["type_id"]) r = gmai_request().simulate_analyze(param["device_id"], param["image_url"], param["style_id"] ,param["type_id"])
assert r["error"] == 0 assert r["error"] == 0
print("效果图: ", r["data"]["plastic_image_url"]) gm_url = r["data"]["plastic_image_url"]
\ No newline at end of file print("效果图: ", gm_url)
before_charm_val = r["data"]["before_charm_val"]
after_charm_val = r["data"]["after_charm_val"]
assert before_charm_val < after_charm_val
\ No newline at end of file
...@@ -10,7 +10,7 @@ class TestSkinNewReport: ...@@ -10,7 +10,7 @@ class TestSkinNewReport:
data = BaseRequest().api_load(path_setting.GMAI_SKIN_NEWREPORT_DATA) data = BaseRequest().api_load(path_setting.GMAI_SKIN_NEWREPORT_DATA)
skinnewReport_case, skinnewReport_data = get_ids(data, "skin_newReport") skinnewReport_case, skinnewReport_data = get_ids(data, "skin_newReport")
@pytest.mark.parametrize("param",skinnewReport_data,ids=skinnewReport_case) @pytest.mark.parametrize("param", skinnewReport_data, ids=skinnewReport_case)
def test_skinnewReport(self,param): def test_skinnewReport(self,param):
r = gmai_request().skin_newReport(param["version"], param["image_url"]) r = gmai_request().skin_newReport(param["version"], param["image_url"])
if r["error"] == 0: if r["error"] == 0:
...@@ -19,11 +19,45 @@ class TestSkinNewReport: ...@@ -19,11 +19,45 @@ class TestSkinNewReport:
# 大家都在买 # 大家都在买
packages = data.get("packages") packages = data.get("packages")
assert len(packages) == 6 assert len(packages) == 6
for item in packages:
# 皮肤检测结果 package_id = item["package_id"]
package_name = item["package_name"]
tag_name = item["tag_name"]
gengmei_url = item["gengmei_url"]
print(package_id,package_name,tag_name,gengmei_url)
assert package_id not in (None, "")
assert package_name not in (None, "")
assert tag_name not in (None, "")
assert gengmei_url == "gengmei://service?service_id={}&has_task=0&sign_task_seconds=10&sign_points=20".format(package_id)
# 皮肤检测结果,重点关注部分
disadvantage_tabs = data.get("disadvantage_tabs") disadvantage_tabs = data.get("disadvantage_tabs")
result_word = disadvantage_tabs[0].get("result_word") result_word = disadvantage_tabs[0].get("result_word")
assert result_word == "色素型黑眼圈" analysis = disadvantage_tabs[0]["tab_data"]["analysis"]
seriousness = disadvantage_tabs[0]["tab_data"]["seriousness"]
print(result_word, analysis, seriousness)
assert result_word not in (None, "")
assert analysis not in (None, "")
assert seriousness not in (None, "")
# 皮肤检测结果,其他部分
advantage_tabs = data.get("advantage_tabs")
for item in advantage_tabs:
result_word = item.get("result_word")
analysis = item["tab_data"]["analysis"]
seriousness = item["tab_data"]["seriousness"]
print(result_word, analysis, seriousness)
# assert result_word not in (None, "") 测试环境有部分数据没有配置
# assert analysis not in (None, "")
# assert seriousness not in (None, "")
# 用户信息部分
user_info = r["data"]["user_info"]
count = user_info["count"]
assert count == 1
# 底部按钮
bottom_buttons = r["data"]["bottom_buttons"]
assert bottom_buttons[0]["gm_url"] == "gengmei://scan_faceimage?face_skin_tab_index=0&amp;has_task=0"
assert bottom_buttons[0]["name"] == "AI测颜值"
assert bottom_buttons[1]["gm_url"] == "gengmei://transfer_consult?conversation_type=4"
assert bottom_buttons[1]["name"] == "变美1V1咨询"
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 TestBeauty:
data = BaseRequest().api_load(path_setting.BEAUTY)
beauty_case, beauty_data = get_ids(data, "beauty")
@pytest.mark.parametrize("param",beauty_data,ids=beauty_case)
def test_beauty(self,param):
print("******************")
r = janus_request().beauty(param["channel_id"])
if r["error"] == 0:
assert r["error"] == param["assert"]
...@@ -12,7 +12,9 @@ class TestBeautyCardDetail: ...@@ -12,7 +12,9 @@ class TestBeautyCardDetail:
@pytest.mark.parametrize("param", beauty_card_detail_data, ids=beauty_card_detail_case) @pytest.mark.parametrize("param", beauty_card_detail_data, ids=beauty_card_detail_case)
def test_beauty_card_detail(self, param): 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"]) r = janus_request().beauty_card_detail(param["spu_id"], param["sku_id"], param["version"])
if r["error"] == 0: if param["spu_id"] == 100018:
assert len(r["data"]["beautycart_list"]) > param["assert"] assert r["error"] == param["assert_error"]
if param["spu_id"] == 1000180:
assert r["data"] == param["assert_data"]
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 TestBeautyPost:
data = BaseRequest().api_load(path_setting.BEAUTY_POST)
beauty_post_case, beauty_post_data = get_ids(data, "beauty_post")
@pytest.mark.parametrize("param",beauty_post_data,ids=beauty_post_case)
def test_beauty_post(self,param):
r = janus_request().beauty_post(param["channel_id"],param["is_open"],param["smooth"],param["white"],param["rosy"])
if r["error"] == 0:
assert r["error"] == param["assert"]
import pytest
import path_setting
from all_backend_api.janus_live_request import live_request
from all_backend_api.live_request import living_request
from ids_list import get_ids
from in_common.base_request import BaseRequest
class TestMGetChannelStatus:
data = BaseRequest().api_load(path_setting.M_GET_CHANNEL_STATUS)
m_get_channel_status_case, m_get_channel_status_data = get_ids(data, "m_get_channel_status")
@pytest.mark.parametrize("param", m_get_channel_status_data, ids=m_get_channel_status_case)
def test_m_get_channel_status_data(self, param):
print("查看直播状态啦~~~")
living_request().pushlive_info("小冤家", "2021/04/22/1003/cef471cff5e6", "", "1", "1", "1")
r = live_request().m_get_channel_status(param["channel_id"], param["version"])
if r["error"] == 0:
assert r["data"]["status"] == param["assert"]
\ No newline at end of file
import pytest
import path_setting
from all_backend_api.janus_live_request import live_request
from ids_list import get_ids
from in_common.base_request import BaseRequest
class TestMarkLiveService:
data = BaseRequest().api_load(path_setting.MARK_LIVE_SERVICE)
mark_live_service_case, mark_live_service_data = get_ids(data, "mark_live_service")
@pytest.mark.parametrize("param", mark_live_service_data, ids=mark_live_service_case)
def test_mark_live_service(self, param):
print(111111111111111111111)
r = live_request().mark_live_service(param["stream_id"], param["channel_id"], param["live_service_id"], param["mark_status"], param["version"])
if r["error"] == 0:
assert r["data"]["toast"] == 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.live_request import living_request
class TestEnter:
data = BaseRequest().api_load(path_setting.ENTER)
enter_case, enter_data = get_ids(data,"enter")
@pytest.mark.parametrize("param", enter_data, ids=enter_case)
def test_enter(self, param):
r = living_request().enter(param["channel_id"], param["from_source"], param["version"])
print("观众进入直播间啦~~~")
if r["error"] == 0:
assert r["error"] == 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.live_request import living_request
class TestFinish:
data = BaseRequest().api_load(path_setting.FINISH)
finish_case, finish_data = get_ids(data,"finish")
@pytest.mark.parametrize("param", finish_data, ids=finish_case)
def test_finish(self, param):
r = living_request().finish(param["channel_id"], param["version"])
print("主播下播了,呜呜呜")
if r["error"] == 0:
assert r["error"] == 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.live_request import living_request
class TestGetLiveInfoAudience:
data = BaseRequest().api_load(path_setting.GET_LIVE_INFO_AUDIENCE)
get_live_info_audience_case, get_live_info_audience_data = get_ids(data,"get_live_info_audience")
@pytest.mark.parametrize("param", get_live_info_audience_data, ids=get_live_info_audience_case)
def test_get_live_info_audience(self, param):
r = living_request().get_live_info_audience(param["channel_id"], param["version"])
print("主播分享直播间")
if r["error"] == 0:
assert r["data"]["channel_id"] == param["assert"]
assert r["data"]["share_data"]["wechat"]["title"][0:7] == param["assert0"]
assert r["data"]["share_data"]["wechatline"]["title"][0:7] == param["assert0"]
assert r["data"]["share_data"]["qq"]["title"][0:7] == param["assert0"]
\ 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 TestLeave:
data = BaseRequest().api_load(path_setting.LEAVE)
leave_case, leave_data = get_ids(data,"leave")
@pytest.mark.parametrize("param", leave_data, ids=leave_case)
def test_leave(self, param):
r = living_request().leave(param["channel_id"], param["version"])
print("观众离开直播间了,呜呜呜")
if r["error"] == 0:
assert r["error"] == 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.live_request import living_request
#@pytest.fixture(scope='function')
#def create_live():
# pass
class TestSendmsg:
data = BaseRequest().api_load(path_setting.SENDMSG)
sendmsg_case, sendmsg_data = get_ids(data, "sendmsg")
@pytest.mark.parametrize("param",sendmsg_data,ids=sendmsg_case)
def test_sendmsg(self,param):
r = living_request().sendmsg(param["channel_id"],param["msg"])
if r["error"] == 0:
assert r["error"] == param["assert"]
if r["error"] == 1:
assert r["message"] == param["assert"]
\ No newline at end of file
...@@ -24,10 +24,23 @@ class TestShareV4: ...@@ -24,10 +24,23 @@ class TestShareV4:
classification_info = r["data"]["classification_info"] classification_info = r["data"]["classification_info"]
# 测颜值结果,保证五官有值 # 测颜值结果,保证五官有值
for key,value in classification_info.items(): for key,value in classification_info.items():
print(key, value["name"], value["param"]) # print(key, value["name"], value["param"])
assert value["name"] is not None assert value["name"] is not None
assert value["param"] is not None assert value["param"] is not None
# 颜值报告 # 颜值报告
content = r["data"]["tractate_info"]["content"] content = r["data"]["tractate_info"]["content"]
print(content) # print(content)
assert content is not None assert content is not None
# 五官描述
info_list = r["data"]["facial_feature"]["info_list"]
for item in info_list:
print(item["family"], item["description"])
assert item["family"] is not None
assert item["description"] is not None
# 底部按钮
bottom_buttons = r["data"]["bottom_buttons"]
assert bottom_buttons[0]["gm_url"] == param["skin_url"]
assert bottom_buttons[0]["name"] == param["skin_name"]
assert bottom_buttons[1]["gm_url"] == param["con_url"]
assert bottom_buttons[1]["name"] == param["con_name"]
\ 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.tag_request import tag_request
class TestTagAdd:
data = BaseRequest().api_load(path_setting.TAG_ADD)
tag_add_case, tag_add_data = get_ids(data,"tag_add")
@pytest.mark.parametrize("param",tag_add_data, ids=tag_add_case)
def test_tag_add(self,param):
r = tag_request().tag_add(param["name"])
if r["error"] == 0:
assert r["error"] == 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.user_request import user_request
class TestFavorsServices:
data = BaseRequest().api_load(path_setting.FAVORS_SERVICES)
favors_services_case, favors_services_data = get_ids(data, "favors_services")
@pytest.mark.parametrize("param", favors_services_data, ids=favors_services_case)
def test_favors_services(self, param):
r = user_request().favors_services(param["start_num"], param["count"], param["current_city_id"], param["device_id"], param["version"])
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.user_request import user_request
class TestMyQuestion:
data = BaseRequest().api_load(path_setting.MY_QUESTION)
my_question_case, my_question_data = get_ids(data, "my_question")
@pytest.mark.parametrize("param", my_question_data, ids=my_question_case)
def test_my_question(self, param):
r = user_request().my_question(param["start_num"], param["count"])
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.user_request import user_request
class TestReplyTractate:
data = BaseRequest().api_load(path_setting.REPLY_TRACTATE)
reply_tractate_case, reply_tractate_data = get_ids(data, "reply_tractate")
@pytest.mark.parametrize("param", reply_tractate_data, ids= reply_tractate_case)
def test_reply_tractate(self, param):
r = user_request().reply_tractate(param["page"], param["count"], param["version"])
assert r["error"] == param["assert"]
beauty:
-
case: "主播获取美颜效果"
channel_id: "739"
assert: 0
\ No newline at end of file
beauty_card_detail: beauty_card_detail:
#次卡商详页 #次卡商详页
- -
case: "次卡商详页spuid=100018" case: "次卡商详页spu正常case"
assert: 0
spu_id: 100018 spu_id: 100018
sku_id: 10046 sku_id: 10046
welfareId: 100018
version: 7.44.0 version: 7.44.0
current_city_id: beijing assert_error: 0
lat: 40.001879
lng: 116.487194
- -
case: "次卡商详页spuid=100021" case: "次卡商详页spu不存在case"
assert: 0 spu_id: 1000180
spu_id: 100021 sku_id: 10046
sku_id: 10159
welfareId: 100021
version: 7.44.0 version: 7.44.0
current_city_id: beijing assert_data: {}
lat: 40.001879
lng: 116.487194
......
beauty_post:
-
case: "主播更改美颜效果"
channel_id: "739"
is_open: "true"
smooth: "0.60"
white: "0.40"
rosy: "0.70"
assert: 0
-
case: "主播关闭美颜"
channel_id: "739"
is_open: "false"
smooth: "0"
white: "0"
rosy: "0"
assert: 0
\ No newline at end of file
...@@ -62,7 +62,7 @@ content_v7: ...@@ -62,7 +62,7 @@ content_v7:
- -
#搜索结果页-综合tab---搜索词为医院全称或简称,搜索结果页医院穿插置顶展示 #搜索结果页-综合tab---搜索词为医院全称或简称,搜索结果页医院穿插置顶展示
case: "搜索结果页-综合tab---搜索词为医院全称或简称,搜索结果页医院穿插置顶展示" case: "搜索结果页-综合tab---搜索词为医院全称或简称,搜索结果页医院穿插置顶展示"
query: "北京凯润婷" query: "北京画美"
device_id: "1321222222222222135" device_id: "1321222222222222135"
current_city_id: "beijing" current_city_id: "beijing"
version: "742.2" version: "742.2"
......
m_get_channel_status:
#查看直播状态
-
case: "查看直播状态"
channel_id: "739"
version: "7.45.0"
assert : True
\ No newline at end of file
mark_live_service:
#主播-主播标记讲解商品
-
case: "主播-主播标记讲解商品"
stream_id: "4233"
channel_id: "745"
live_service_id: "7269"
mark_status: "1"
version: "7.45.0"
assert : 操作成功
#主播-主播取消标记讲解商品
-
case: "主播-主播取消标记讲解商品"
stream_id: "4233"
channel_id: "745"
live_service_id: "7269"
mark_status: "0"
version: "7.45.0"
assert : 操作成功
enter:
#观众从app进入直播间
-
case: "观众从app进入直播间"
channel_id: "745"
from_source: "app"
version: "7.45.0"
assert: 0
\ No newline at end of file
finish:
#主播下播了,呜呜呜
-
case: "主播下播了,呜呜呜"
channel_id: "745"
version: "7.45.0"
assert: 0
\ No newline at end of file
get_live_info_audience:
#主播分享直播间
-
case: "主播分享直播间"
channel_id: "745"
version: "7.45.0"
assert: 745
assert0: 更美APP直播
\ No newline at end of file
leave:
#观众离开直播间了,呜呜呜
-
case: "观众离开直播间了,呜呜呜"
channel_id: "745"
version: "7.45.0"
assert: 0
\ No newline at end of file
sendmsg:
#发送弹幕
-
case: "发送弹幕"
channel_id: "726"
msg: "主播可真美"
assert: 0
#弹幕内容包含敏感信息,发送失败
-
case: "弹幕内容包含敏感信息,发送失败"
channel_id: "784"
msg: "黄色图片"
assert: 您输入的内容包含敏感信息,请重新输入
\ No newline at end of file
...@@ -5,3 +5,7 @@ share_v4: ...@@ -5,3 +5,7 @@ share_v4:
version: "7.42.2" version: "7.42.2"
face_id: "15844721" face_id: "15844721"
assert: 0 assert: 0
skin_url: "gengmei://scan_faceimage?face_skin_tab_index=1"
skin_name: "AI测肤质"
con_url: "gengmei://transfer_consult?conversation_type=4"
con_name: "变美1V1咨询"
\ No newline at end of file
tag_add:
-
case: "直播-新增标签"
name: "小冤家专属标签"
assert: 0
\ No newline at end of file
...@@ -3,7 +3,7 @@ reply_create: ...@@ -3,7 +3,7 @@ reply_create:
beuzhu: '# 备注: 这个文件有冲突的话,那个版本都行不会影响,回退/接受当前版本都行,因为每次运行content都会改变' beuzhu: '# 备注: 这个文件有冲突的话,那个版本都行不会影响,回退/接受当前版本都行,因为每次运行content都会改变'
case: 日记贴一级评论创建--正常校验&创建二级评论--正常校验 case: 日记贴一级评论创建--正常校验&创建二级评论--正常校验
channel: benzhan channel: benzhan
content: ces测试+2021-07-14 18:15:39 content: ces测试+2021-07-22 18:42:59
message: 请勿回复重复内容 message: 请勿回复重复内容
message1: 回复成功 message1: 回复成功
message2: 你的回复有点频繁,稍后再来 message2: 你的回复有点频繁,稍后再来
......
favors_services:
#我的-收藏
-
case: "我的页面-收藏"
start_num: 0
count: 10
current_city_id: "beijing"
device_id: "androidid_16a95f3fa31a4c0b"
version: "7.46.0"
assert: 0
my_question:
#我的-问题
-
case: "我的页面-问题"
start_num: 0
count: 10
assert: 0
reply_tractate:
#我的-帖子
-
case: "我的页面-帖子-我回复的"
page: 1
count: 10
version: 7.46.0
assert: 0
user_tractate: user_tractate:
- -
#我的-帖子 #我的-帖子-我发布的
case: "我的页面-帖子" case: "我的页面-帖子-我发布的"
page: 1 page: 1
count: 10 count: 10
assert: 0 assert: 0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment