Commit c000a00b authored by 张慧's avatar 张慧

Merge branch 'common_dev' into zhanghui_dev

次卡用例完善
parents d15b8ce9 9d73b4e0
......@@ -10,6 +10,7 @@ class live_request(BaseRequest):
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.DELETEGIFT_CONFIG)
self.data = self.api_load(path_setting.M_GET_CHANNEL_STATUS_CONFIG)
#主播-推荐袋美购列表展示
def live_services(self, channel_id, stream_id, offset, size):
......@@ -73,8 +74,15 @@ class live_request(BaseRequest):
self.params["version"] = version
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"])
if __name__ == '__main__':
print(live_request().live_services("745", "4177", "0", "10"))
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().delete_live_service("745", "7242", "7.45.0"))
\ No newline at end of file
# print(live_request().live_services("745", "4177", "0", "10"))
# 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().delete_live_service("745", "7242", "7.45.0"))
print(live_request().m_get_channel_status("745", "7.46.0"))
\ No newline at end of file
......@@ -78,4 +78,15 @@ delete_live_gift:
json: {}
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
......@@ -21,6 +21,19 @@ class living_request(BaseRequest):
self.params["device_type"] = device_type
return self.api_send(self.data["pushlive_info"])
#观众进入直播间
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"])
if __name__ == '__main__':
......
......@@ -24,30 +24,25 @@ pushlive_info:
json: {}
isLogin: 1
#主播-推荐袋美购列表展示
live_services:
method: GET
url: /api/janus/live/live_services
#观众进入直播间
enter:
method: get
url: /api/live/enter
params:
channel_id: ${channel_id}
stream_id: ${stream_id}
offset: ${offset}
size: ${size}
from_source: ${from_source}
version: ${version}
data: {}
json: {}
isLogin: 1
#主播-推荐袋商品捜索功能
search_services:
method: GET
url: /api/janus/live/search_services
#观众离开直播间
leave:
method: get
url: /api/live/leave
params:
current_city_id: ${current_city_id}
channel_id: ${channel_id}
query: ${query}
offset: ${offset}
size: ${size}
trace_id: ${trace_id}
version: ${version}
data: {}
json: {}
isLogin: 1
......
......@@ -52,9 +52,10 @@ class user_request(BaseRequest):
self.params["count"] = count
return self.api_send(self.data["my_diary_v2"])
# 我的-日记
# 我的-帖子-我发布的
def user_tractate(self, page, count):
self.params["page"] = page
......@@ -63,6 +64,38 @@ class user_request(BaseRequest):
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__':
#个人中心
print(user_request().personal_center())
......@@ -79,6 +112,15 @@ if __name__ == '__main__':
#我的-日记
print(user_request().my_diary_v2(0, 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:
isLogin: 1
# 我的-帖子
# 我的-帖子-我发布的
user_tractate:
method: GET
url: /api/user/tractate
......@@ -83,3 +83,41 @@ user_tractate:
json: {}
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
......@@ -84,6 +84,10 @@ class web_request(BaseRequest):
self.params["start_time"] = start_time
self.params["end_time"] = end_time
return self.api_send(self.ACCOUNT_URL["cpc_community_data_info"])
def cpc_community_click_logs(self,page):
"点点通-内容-推广明细"
self.params["page"] = page
return self.api_send(self.ACCOUNT_URL["cpc_community_click_logs"])
......@@ -113,4 +117,5 @@ if __name__ == '__main__':
print(web_request().artemis_order_id_detail())
print(web_request().cpc_community_homepage())
print(web_request().cpc_community_diaries())
print(web_request().cpc_community_data_info("15604767","2021-07-02","2021-07-12"))
\ No newline at end of file
print(web_request().cpc_community_data_info("15604767","2021-07-02","2021-07-12"))
print(web_request().cpc_community_click_logs(1))
\ No newline at end of file
......@@ -180,4 +180,13 @@ cpc_community_data_info:
end_time: ${end_time}
data: {}
json: {}
isLogin: 1 #需要登录
\ No newline at end of file
isLogin: 1 #需要登录
cpc_community_click_logs:
method: get
url: /api/web/cpc_community/click_logs
params:
page: ${page}
data: {}
json: {}
isLogin: 1 #需要登录
......@@ -443,6 +443,8 @@ CPCCOMMUNITYHOMEPAGE=os.path.join(BASE_DIR, "backend_auto/test_doctor_data/web_d
CPCCOMMUNITYDIARIES=os.path.join(BASE_DIR, "backend_auto/test_doctor_data/web_data", "cpc_community_diaries.yaml")
#医生后台-点点通内容-数据统计
CPCCOMMUNITYDATAINFO=os.path.join(BASE_DIR, "backend_auto/test_doctor_data/web_data", "cpc_community_data_info.yaml")
#医生后台-点点通内容-推广明细
CPCCOMMUNITYCLICKLOGS=os.path.join(BASE_DIR, "backend_auto/test_doctor_data/web_data", "cpc_community_click_logs.yaml")
#更美次卡橱窗组件商品
......@@ -573,6 +575,18 @@ 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 = 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")
#免费招募活动详情
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")
......@@ -589,10 +603,21 @@ 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 = 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 = 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")
if __name__ == '__main__':
print("==========",LIVEYAML_CONFIG)
......@@ -12,5 +12,33 @@ class TestPlasticnAnalysisV3:
@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
r = gmai_request().plastic_analysis_v3(param["device_id"], param["image_url"], param["landmark"],param["cheek_style_classify_id"])
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:
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
gm_url = r["data"]["plastic_image_url"]
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:
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)
@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:
......@@ -19,11 +19,45 @@ class TestSkinNewReport:
# 大家都在买
packages = data.get("packages")
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")
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
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
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 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
......@@ -24,10 +24,23 @@ class TestShareV4:
classification_info = r["data"]["classification_info"]
# 测颜值结果,保证五官有值
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["param"] is not None
# 颜值报告
content = r["data"]["tractate_info"]["content"]
print(content)
# print(content)
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.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"]
......@@ -62,7 +62,7 @@ content_v7:
-
#搜索结果页-综合tab---搜索词为医院全称或简称,搜索结果页医院穿插置顶展示
case: "搜索结果页-综合tab---搜索词为医院全称或简称,搜索结果页医院穿插置顶展示"
query: "北京凯润婷"
query: "北京画美"
device_id: "1321222222222222135"
current_city_id: "beijing"
version: "742.2"
......
m_get_channel_status:
#查看直播状态
-
case: "查看直播状态"
channel_id: "739"
version: "7.45.0"
assert : True
\ No newline at end of file
enter:
#观众从app进入直播间
-
case: "观众从app进入直播间"
channel_id: "745"
from_source: "app"
version: "7.45.0"
assert: 0
\ No newline at end of file
leave:
#观众离开直播间了,呜呜呜
-
case: "观众离开直播间了,呜呜呜"
channel_id: "745"
version: "7.45.0"
assert: 0
\ No newline at end of file
......@@ -4,4 +4,8 @@ share_v4:
case: "请求成功,有数据返回"
version: "7.42.2"
face_id: "15844721"
assert: 0
\ No newline at end of file
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
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:
-
#我的-帖子
case: "我的页面-帖子"
#我的-帖子-我发布的
case: "我的页面-帖子-我发布的"
page: 1
count: 10
assert: 0
......
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 TestCpcCommunityClickLogs:
data = BaseRequest().api_load(path_setting.CPCCOMMUNITYCLICKLOGS)
cpccommunityclicklogs_case, cpccommunityclicklogs_data = get_ids(data, "cpc_community_click_logs")
@pytest.mark.parametrize("param",cpccommunityclicklogs_data,ids=cpccommunityclicklogs_case)
def test_cpc_community_click_logs(self, param):
'''点点通内容-数据统计'''
r = web_request().cpc_community_click_logs(param["page"])
if r["error"] == 0:
click_list = r.get("data").get("click_list", [])
assert len(click_list) >= param["assert"]
cpc_community_click_logs:
#点点通内容-推广明细case
-
case: "点点通内容-推广明细"
page: 1
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