Commit 22ddcd53 authored by 张慧's avatar 张慧

Merge branch 'common_dev' into zhanghui_dev

修复医院主页数据问题
parents 14eeef28 248da587
...@@ -7,8 +7,6 @@ class hybrid_request(BaseRequest): ...@@ -7,8 +7,6 @@ class hybrid_request(BaseRequest):
def __init__(self): def __init__(self):
#百科详情页-项目聚合百科 #百科详情页-项目聚合百科
self.data = self.api_load(path_setting.SUBWIKI_CONFIG) self.data = self.api_load(path_setting.SUBWIKI_CONFIG)
#百科详情页-项目百科
self.data = self.api_load(path_setting.BASEWIKI_ITEM_CONFIG)
#百科详情页-药品(仪器、材料)百科 #百科详情页-药品(仪器、材料)百科
self.data = self.api_load(path_setting.BASEWIKI_PRODUCT_CONFIG) self.data = self.api_load(path_setting.BASEWIKI_PRODUCT_CONFIG)
#百科详情页-品牌百科 #百科详情页-品牌百科
...@@ -23,12 +21,6 @@ class hybrid_request(BaseRequest): ...@@ -23,12 +21,6 @@ class hybrid_request(BaseRequest):
return self.api_send(self.data['sub_wiki']) return self.api_send(self.data['sub_wiki'])
# return self.data # return self.data
#百科详情页-项目百科
def basewiki_item(self, version, device_id = '97B6764B-2135-4761-9911-701C38CBC272'):
self.params['version'] = version
return self.api_send(self.data['basewiki_item'])
#百科详情页-药品(仪器、材料)百科 #百科详情页-药品(仪器、材料)百科
def basewiki_product(self, version, device_id = '97B6764B-2135-4761-9911-701C38CBC272'): def basewiki_product(self, version, device_id = '97B6764B-2135-4761-9911-701C38CBC272'):
self.params['version'] = version self.params['version'] = version
...@@ -67,7 +59,7 @@ class hybrid_request(BaseRequest): ...@@ -67,7 +59,7 @@ class hybrid_request(BaseRequest):
if __name__ == '__main__': if __name__ == '__main__':
# print(self.data) # print(self.data)
# print(hybrid_request().sub_wiki("744.0", "beijing")) # print(hybrid_request().sub_wiki("744.0", "beijing"))
# print(type(hybrid_request().sub_wiki("744.0", "beijing"))) print(type(hybrid_request().sub_wiki("744.0", "beijing")))
soup = BeautifulSoup(hybrid_request().sub_wiki("744.0", "beijing"), 'lxml') # html.parser是解析器,也可是lxml soup = BeautifulSoup(hybrid_request().sub_wiki("744.0", "beijing"), 'lxml') # html.parser是解析器,也可是lxml
print(soup.prettify(),'百科详情页-项目聚合百科') #输出soup对象的内容 print(soup.prettify(),'百科详情页-项目聚合百科') #输出soup对象的内容
print(soup.title) # print(soup.title)
\ No newline at end of file \ No newline at end of file
...@@ -9,16 +9,6 @@ sub_wiki: ...@@ -9,16 +9,6 @@ sub_wiki:
data: {} data: {}
json: {} json: {}
#百科详情页-项目百科-水光针
basewiki_item:
method: GET
url: /hybrid/base_wiki/item/141
params:
version: ${version}
data: {}
json: {}
#百科详情页-药品(仪器、材料)百科-菲洛嘉 #百科详情页-药品(仪器、材料)百科-菲洛嘉
basewiki_product: basewiki_product:
method: GET method: GET
......
import path_setting
from in_common.base_request import BaseRequest
from bs4 import BeautifulSoup
class wiki_request(BaseRequest):
def __init__(self):
#百科详情页-项目百科
self.data = self.api_load(path_setting.WIKI_ITEM_CONFIG)
#百科详情页-项目百科
def wiki_item(self, tag_ids, q, start_num, version, device_id):
self.params['tag_ids'] = tag_ids
self.params['q'] = q
self.params['start_num'] = start_num
self.params['version'] = version
self.params['device_id'] = device_id
return self.api_send(self.data['wiki_item'])
if __name__ == '__main__':
print(type(wiki_request().wiki_item("2059", "水光针", "0", "7.46.0", "97B6764B-2135-4761-9911-701C38CBC272")))
# soup = BeautifulSoup(hybrid_request().sub_wiki("744.0", "beijing"), 'lxml') # html.parser是解析器,也可是lxml
# print(soup.prettify(),'百科详情页-项目聚合百科') #输出soup对象的内容
# print(soup.title)
\ No newline at end of file
#百科详情页-项目百科-水光针
wiki_item:
method: GET
url: /api/wiki/item/141/
params:
tag_ids: ${tag_ids}
q: ${q}
start_num: ${start_num}
version: ${version}
device_id: ${device_id}
data: {}
json: {}
\ No newline at end of file
...@@ -75,6 +75,18 @@ class web_request(BaseRequest): ...@@ -75,6 +75,18 @@ class web_request(BaseRequest):
def cpc_community_homepage(self): def cpc_community_homepage(self):
"点点通-内容-概览" "点点通-内容-概览"
return self.api_send(self.ACCOUNT_URL["cpc_community_homepage"]) return self.api_send(self.ACCOUNT_URL["cpc_community_homepage"])
def cpc_community_diaries(self):
"点点通-内容-数据统计-内容"
return self.api_send(self.ACCOUNT_URL["cpc_community_diaries"])
def cpc_community_data_info(self,diary_id,start_time,end_time):
"点点通-内容-数据统计"
self.params["diary_id"] = diary_id
self.params["start_time"] = start_time
self.params["end_time"] = end_time
return self.api_send(self.ACCOUNT_URL["cpc_community_data_info"])
...@@ -95,9 +107,10 @@ if __name__ == '__main__': ...@@ -95,9 +107,10 @@ if __name__ == '__main__':
print(web_request().conversation_user_id(0, "您好", 602329, "271caac2ae1687ca0a56ee18115b8183", "NLeTxEx1BOQo1zjv2us9BQ00ViMAHGpJ")) print(web_request().conversation_user_id(0, "您好", 602329, "271caac2ae1687ca0a56ee18115b8183", "NLeTxEx1BOQo1zjv2us9BQ00ViMAHGpJ"))
print(web_request().cpc_homepage()) print(web_request().cpc_homepage())
print(web_request().artemis_ad_type_list()) print(web_request().artemis_ad_type_list())
print("发送")
print(web_request().artemis_order_list(0, 1)) print(web_request().artemis_order_list(0, 1))
print(web_request().artemis_order_list(1, 1)) print(web_request().artemis_order_list(1, 1))
print(web_request().artemis_order_list(2, 1)) print(web_request().artemis_order_list(2, 1))
print(web_request().artemis_order_id_detail()) print(web_request().artemis_order_id_detail())
print(web_request().cpc_community_homepage()) 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
...@@ -162,3 +162,22 @@ cpc_community_homepage: ...@@ -162,3 +162,22 @@ cpc_community_homepage:
data: {} data: {}
json: {} json: {}
isLogin: 1 #需要登录 isLogin: 1 #需要登录
cpc_community_diaries:
method: get
url: /api/web/cpc_community/diaries
params: {}
data: {}
json: {}
isLogin: 1 #需要登录
cpc_community_data_info:
method: get
url: /api/web/cpc_community/data/info
params:
diary_id: ${diary_id}
start_time: ${start_time}
end_time: ${end_time}
data: {}
json: {}
isLogin: 1 #需要登录
\ No newline at end of file
...@@ -99,6 +99,8 @@ ANSWER_LIST = os.path.join(BASE_DIR, "backend_auto/test_backend_data/hybrid_data ...@@ -99,6 +99,8 @@ ANSWER_LIST = os.path.join(BASE_DIR, "backend_auto/test_backend_data/hybrid_data
QA_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "qa_request.yaml") 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") 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")
# 回答评论点赞&取消点赞 # 回答评论点赞&取消点赞
...@@ -437,6 +439,11 @@ ADPACKAGEORDERDETAIL=os.path.join(BASE_DIR, "backend_auto/test_doctor_data/web2_ ...@@ -437,6 +439,11 @@ ADPACKAGEORDERDETAIL=os.path.join(BASE_DIR, "backend_auto/test_doctor_data/web2_
CPCHOMEPAGE=os.path.join(BASE_DIR, "backend_auto/test_doctor_data/web_data", "cpc_homepage.yaml") CPCHOMEPAGE=os.path.join(BASE_DIR, "backend_auto/test_doctor_data/web_data", "cpc_homepage.yaml")
#医生后台-点点通内容-概览 #医生后台-点点通内容-概览
CPCCOMMUNITYHOMEPAGE=os.path.join(BASE_DIR, "backend_auto/test_doctor_data/web_data", "cpc_community_homepage.yaml") CPCCOMMUNITYHOMEPAGE=os.path.join(BASE_DIR, "backend_auto/test_doctor_data/web_data", "cpc_community_homepage.yaml")
#医生后台-点点通内容-数据统计-内容
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")
#更美次卡橱窗组件商品 #更美次卡橱窗组件商品
VISUAL_BEAUTY_CARD_SERVICES_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "visual_beauty_card.yaml") VISUAL_BEAUTY_CARD_SERVICES_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "visual_beauty_card.yaml")
...@@ -455,8 +462,8 @@ SUBWIKI_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "hybrid_ ...@@ -455,8 +462,8 @@ SUBWIKI_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "hybrid_
SUBWIKI = os.path.join(BASE_DIR, "backend_auto/test_backend_data/hybrid_data", "sub_wiki.yaml") SUBWIKI = os.path.join(BASE_DIR, "backend_auto/test_backend_data/hybrid_data", "sub_wiki.yaml")
#百科详情页-项目百科 #百科详情页-项目百科
BASEWIKI_ITEM_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "hybrid_request.yaml") WIKI_ITEM_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "wiki_request.yaml")
BASEWIKI_ITEM = os.path.join(BASE_DIR, "backend_auto/test_backend_data/hybrid_data", "basewiki_item.yaml") WIKI_ITEM = os.path.join(BASE_DIR, "backend_auto/test_backend_data/wiki_data", "wiki_item.yaml")
#百科详情页-药品(仪器、材料)百科 #百科详情页-药品(仪器、材料)百科
BASEWIKI_PRODUCT_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "hybrid_request.yaml") BASEWIKI_PRODUCT_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "hybrid_request.yaml")
......
import pytest
from bs4 import BeautifulSoup
import path_setting
from all_backend_api.hybrid_request import hybrid_request
from ids_list import get_ids
from in_common.base_request import BaseRequest
#百科详情页-项目百科,水光针
class TestBaseWikiItem:
data = BaseRequest().api_load(path_setting.BASEWIKI_ITEM)
basewiki_item_case, basewiki_item_data = get_ids(data, "basewiki_item")
@pytest.mark.parametrize("param", basewiki_item_data, ids=basewiki_item_case)
def test_basewiki_item(self, param):
r = hybrid_request().basewiki_item(param["version"])
soup = BeautifulSoup(r, 'lxml') # html.parser是解析器,也可是lxml
assert soup.title.string == param["assert"]
print('进入项目百科-水光针的百科详情页')
\ No newline at end of file
import pytest
from bs4 import BeautifulSoup
import path_setting
from all_backend_api.wiki_request import wiki_request
from ids_list import get_ids
from in_common.base_request import BaseRequest
#百科详情页-项目百科,水光针
class TestWikiItem:
data = BaseRequest().api_load(path_setting.WIKI_ITEM)
wiki_item_case, wiki_item_data = get_ids(data, "wiki_item")
@pytest.mark.parametrize("param", wiki_item_data, ids=wiki_item_case)
def test_wiki_item(self, param):
r = wiki_request().wiki_item(param["tag_ids"], param["q"], param["start_num"], param["version"], param["device_id"])
# soup = BeautifulSoup(r, 'lxml') # html.parser是解析器,也可是lxml
if r["data"] is True:
assert r["data"]["item_id"] == param["assert"]
print('进入项目百科-水光针的百科详情页')
\ 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-13 10:43:03 content: ces测试+2021-07-14 18:15:39
message: 请勿回复重复内容 message: 请勿回复重复内容
message1: 回复成功 message1: 回复成功
message2: 你的回复有点频繁,稍后再来 message2: 你的回复有点频繁,稍后再来
......
basewiki_item: wiki_item:
- -
#百科详情页-项目百科,水光针 #百科详情页-项目百科,水光针
case: "百科详情页-项目百科,水光针" case: "百科详情页-项目百科,水光针"
tag_ids: "2059"
q: "水光针"
start_num: "0"
version: "744.0" version: "744.0"
assert: 水光针 device_id: "97B6764B-2135-4761-9911-701C38CBC272"
\ No newline at end of file assert: 141
\ No newline at end of file
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_doctor_api.web_request import web_request
class TestCpcCommunityDataInfo:
data = BaseRequest().api_load(path_setting.CPCCOMMUNITYDATAINFO)
cpccommunitydatainfo_case, cpccommunitydatainfo_data = get_ids(data, "cpc_community_data_info")
@pytest.mark.parametrize("param",cpccommunitydatainfo_data,ids=cpccommunitydatainfo_case)
def test_cpc_community_data_info(self, param):
'''点点通内容-数据统计'''
r = web_request().cpc_community_data_info(param["diary_id"], param["start_time"], param["end_time"])
if r["error"] == 0:
click_list = r.get("data").get("click_list", [])
paid_list = r.get("data").get("paid_list", [])
time_list = r.get("data").get("time_list", [])
assert len(click_list) <= param["assert"]
assert len(paid_list) <= param["assert"]
assert len(time_list) <= param["assert"]
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_doctor_api.web_request import web_request
class TestCpcCommunityDiaries:
data = BaseRequest().api_load(path_setting.CPCCOMMUNITYDIARIES)
cpccommunitydiaries_case, cpccommunitydiaries_data = get_ids(data, "cpc_community_diaries")
@pytest.mark.parametrize("param",cpccommunitydiaries_data,ids=cpccommunitydiaries_case)
def test_cpc_community_diaries(self, param):
'''点点通-概览'''
r = web_request().cpc_community_diaries()
if r["error"] == 0:
diaries = r.get("data").get("diaries", [])
assert len(diaries) >= param["assert"]
cpc_community_data_info:
#点点通内容-数据统计case
-
case: "点点通内容-数据统计"
diary_id: 15604767
start_time: "2021-07-02"
end_time: "2021-07-12"
assert: 13
cpc_community_diaries:
#点点通内容-数据统计-内容case
-
case: "点点通内容-数据统计-内容"
#doctor_user_id: "602329"
assert: 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