Commit a8e85c19 authored by 张伟男's avatar 张伟男

Merge branch 'common_dev' into zwn_dev

parents bf4e25db 97c8e6db
......@@ -12,13 +12,19 @@ class im_request(BaseRequest):
self.params["conversation_type"] = conversation_type
self.params["end_msg_id"] = end_msg_id
self.params["referrer"] = referrer
return self.api_send(self.data["conversation_detail"])
def auto_msg(self,version,uqid,trace_id,conversation_id):
self.params["version"] = version
self.params["uqid"] = uqid
self.params["trace_id"] = trace_id
self.params["conversation_id"] = conversation_id
return self.api_send(self.data["auto_msg"])
if __name__ == '__main__':
print(im_request().conversation_detail("beijing", 0, 4, 0, "message_home"))
print("第二个接口")
print(im_request().auto_msg("7.42.2","1B519701-A4F5-453E-9D99-140B5AF697A0","2021/04/22/1722/70a1791606d5",368))
......
......@@ -9,5 +9,19 @@ conversation_detail:
referrer: ${referrer}
data: {}
json: {}
isLogin: 1 #需要登录的接口
auto_msg:
method: post
url: /api/im/auto_msg
params:
version: ${version}
trace_id: ${trace_id}
uqidd: ${uqid}
data:
conversation_id: ${conversation_id}
json: {}
isLogin: 1 #需要登录的接口
\ No newline at end of file
import path_setting
from in_common.base_request import BaseRequest
class janus_request(BaseRequest):
def __init__(self):
self.data = self.api_load(path_setting.CONTENTV7_CONFIG)
self.data = self.api_load(path_setting.HOSPITALSEARCH_CONFIG)
#搜索结果页-综合/百科tab
def content_v7(self, query, device_id, current_city_id, version, is_first, tab_type, offset):
#搜索词
self.params['query'] = query
#设备号
self.params['device_id'] = device_id
#当前城市
self.params['current_city_id'] = current_city_id
#APP版本
self.params['version'] = version
#是否为第一次请求
self.params['is_first'] = is_first
#类型
self.params['tab_type'] = tab_type
#请求的页数 0,10,20
self.params['offset'] = offset
return self.api_send(self.data['content_v7'])
#医院主页搜索
def hospital_search(self, query, device_id, hospital_id, current_city_id, version, offset):
#搜索词
self.params['query'] = query
#设备号
self.params['device_id'] = device_id
#医院id
self.params['hospital_id'] = hospital_id
#当前城市
self.params['current_city_id'] = current_city_id
#APP版本
self.params['version'] = version
#请求的页数 0,10,20
self.params['offset'] = offset
return self.api_send(self.data['hospital_search'])
content_v7:
method : get
url : /api/janus/search/v7/content
params :
query: ${query}
device_id: ${device_id}
current_city_id: ${current_city_id}
version: ${version}
is_first: ${is_first}
tab_type: ${tab_type}
offset: ${offset}
data: {}
json: {}
hospital_search:
method: get
url: /api/janus/search/hospital_search
params:
query: ${query}
device_id: ${device_id}
hospital_id: ${hospital_id}
current_city_id: ${current_city_id}
version: ${version}
offset: ${offset}
data: { }
json: { }
......@@ -78,6 +78,15 @@ MY_CONVERSATION = os.path.join(BASE_DIR, "backend_auto/test_backend_data/my_conv
HOME_V5_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "service_request.yaml")
HOME_V5=os.path.join(BASE_DIR,"backend_auto/test_backend_data/service_data","home_v5.yaml")
#搜索结果页-综合/百科
CONTENTV7_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "janus_request.yaml")
CONTENTV7 = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_data", "content_v7.yaml")
#医院主页搜索
HOSPITALSEARCH_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "janus_request.yaml")
HOSPITALSEARCH = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_data", "hospital_search.yaml")
#直播
LIVEYAML_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "live_request.yaml")
#直播-获取弹幕
......@@ -92,11 +101,12 @@ MESSAGE_READ = os.path.join(BASE_DIR, "backend_auto/test_backend_data/conversati
#咨询顾问
CONVERSATION_DETAIL_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "im_request.yaml")
CONVERSATION_DETAIL = os.path.join(BASE_DIR, "backend_auto/test_backend_data/im_data", "conversation_detail.yaml")
AUTO_MSG = os.path.join(BASE_DIR, "backend_auto/test_backend_data/im_data", "auto_msg.yaml")
#消息页未读数
UNREAD_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "notification_request.yaml")
UNREAD = os.path.join(BASE_DIR, "backend_auto/test_backend_data/notification_data", "unread.yaml")
if __name__ == '__main__':
print("==========",LIVEYAML_CONFIG)
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.im_request import im_request
class TestConversationDetail:
data = BaseRequest().api_load(path_setting.AUTO_MSG)
automsg_case, automsg_data = get_ids(data, "auto_msg")
@pytest.mark.parametrize("param",automsg_data,ids=automsg_case)
def test_conversation_detail(self,param):
r = im_request().auto_msg(param["version"], param["uqid"], param["trace_id"], param["conversation_id"])
if r["error"] == 0:
assert r["data"]["send_result"] == param["assert"]
import pytest
import path_setting
from all_backend_api.janus_request import janus_request
from ids_list import get_ids
from in_common.base_request import BaseRequest
#搜索结果页-综合/百科tab
class TestContentV7:
data = BaseRequest().api_load(path_setting.CONTENTV7)
contentv7_case, contentv7_data = get_ids(data, "content_v7")
@pytest.mark.parametrize("param", contentv7_data, ids=contentv7_case)
def test_content_v7(self, param):
print(param['query'])
r = janus_request().content_v7(param["query"], param["device_id"], param["current_city_id"], param["version"], param["is_first"], param["tab_type"], param["offset"])
if r["error"] == 0:
assert r["data"]["cards"][0]["type"] == param["assert"]
if r["error"] == 1:
assert r["message"] == param["assert"]
\ No newline at end of file
import pytest
import path_setting
from all_backend_api.janus_request import janus_request
from ids_list import get_ids
from in_common.base_request import BaseRequest
#医院主页搜索
class TestHospitalSearch:
data = BaseRequest().api_load(path_setting.HOSPITALSEARCH)
hospitalsearch_case, hospitalsearch_data = get_ids(data, "hospital_search")
@pytest.mark.parametrize("param", hospitalsearch_data, ids=hospitalsearch_case)
def test_hospital_search(self, param):
print(param['query'])
r = janus_request().hospital_search(param["query"], param["device_id"], param["hospital_id"], param["current_city_id"], param["version"], param["offset"])
if r["error"] == 0:
assert len(r["data"]["search_skus"]) != param["assert1"]
assert len(r["data"]["search_skus"]) == param["assert2"]
if r["error"] == 1:
assert r["message"] == param["assert"]
auto_msg:
#验证成功case
-
case: "请求成功,有数据返回"
version: 7.42
uqid: "1B519701-A4F5-453E-9D99-140B5AF697A0"
trace_id: "2021/04/22/1722/70a1791606d5"
conversation_id: 368
assert: True
\ No newline at end of file
content_v7:
-
#搜索结果页-综合tab---搜索成功
case: "搜索结果页--综合tab---搜索成功"
query: "脱毛"
device_id: "1321222222222222135"
current_city_id: "beijing"
version: "742.2"
is_first: "1"
tab_type: "0"
offset: "0"
assert: 2
-
#搜索结果页-百科tab---搜索成功
case: "搜索结果页-百科tab---搜索成功"
query: "双眼皮"
device_id: "1321222222222222135"
current_city_id: "beijing"
version: "742.2"
is_first: "0"
tab_type: "12"
offset: "0"
assert: 12
-
#搜索结果页-综合tab---下拉加载成功(请求第二波数据)
case: "搜索结果页--综合tab---下拉加载成功(请求第二波数据)"
query: "双眼皮"
device_id: "1321222222222222135"
current_city_id: "beijing"
version: "742.2"
is_first: "0"
tab_type: "0"
offset: "10"
assert: 2
-
#搜索结果页-百科tab---下拉加载成功(请求第二波数据)
case: "搜索结果页-百科tab---下拉加载成功(请求第二波数据)"
query: "双眼皮"
device_id: "1321222222222222135"
current_city_id: "beijing"
version: "742.2"
is_first: "0"
tab_type: "12"
offset: "10"
assert: 12
# -测试环境无法验证该用例
# #搜索结果页-综合tab---召回百科穿插
# case: "搜索结果页--综合tab---没有召回百科穿插"
# query: "双眼皮"
# device_id: "1321222222222222135"
# current_city_id: "beijing"
# version: "742.2"
# is_first: "1"
# tab_type: "0"
# offset: "0"
# assert: 12
-
#搜索结果页-综合tab---搜索词为医院全称或简称,搜索结果页医院穿插置顶展示
case: "搜索结果页-综合tab---搜索词为医院全称或简称,搜索结果页医院穿插置顶展示"
query: "北京凯润婷"
device_id: "1321222222222222135"
current_city_id: "beijing"
version: "742.2"
is_first: "1"
tab_type: "0"
offset: "0"
assert: 3
-
#搜索结果页-综合tab---搜索词为医生全称,搜索结果页医生穿插置顶展示
case: "搜索结果页-综合tab---搜索词为医生全称,搜索结果页医生穿插置顶展示"
query: "崔鑫"
device_id: "1321222222222222135"
current_city_id: "beijing"
version: "742.2"
is_first: "1"
tab_type: "0"
offset: "0"
assert: 6
\ No newline at end of file
hospital_search:
-
#医院主页搜索---搜索成功,有数据召回
case: "医院主页搜索---搜索成功,有数据召回"
query: "玻尿酸"
device_id: "1321222222222222135"
hospital_id: "96ea37eef81d11e692f800163e000a4a"
current_city_id: "beijing"
version: "742.2"
offset: "0"
assert1: 0
assert2: 10
-
#医院主页搜索---搜索成功,无数据召回
case: "医院主页搜索---搜索成功,无数据召回"
query: "美白针"
device_id: "1321222222222222135"
hospital_id: "96ea37eef81d11e692f800163e000a4a"
current_city_id: "beijing"
version: "742.2"
offset: "0"
assert1: 10
assert2: 0
# -
# #医院主页搜索---搜索成功,无数据召回
# case: "医院主页搜索---搜索成功,无数据召回"
# query: "瘦脸针"
# device_id: "1321222222222222135"
# hospital_id: "96ea37eef81d11e692f800163e000a4a"
# current_city_id: "beijing"
# version: "742.2"
# offset: "0"
# assert1: 0
# assert2: 0
\ 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