Commit ba6c15fa authored by 张淑琴's avatar 张淑琴

Merge branch 'common_dev' into zzsq_dev

parents f0979222 22ddcd53
......@@ -7,8 +7,6 @@ class hybrid_request(BaseRequest):
def __init__(self):
#百科详情页-项目聚合百科
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)
#百科详情页-品牌百科
......@@ -23,12 +21,6 @@ class hybrid_request(BaseRequest):
return self.api_send(self.data['sub_wiki'])
# 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'):
self.params['version'] = version
......@@ -67,7 +59,7 @@ class hybrid_request(BaseRequest):
if __name__ == '__main__':
# print(self.data)
# 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
print(soup.prettify(),'百科详情页-项目聚合百科') #输出soup对象的内容
print(soup.title)
\ No newline at end of file
# print(soup.title)
\ No newline at end of file
......@@ -9,16 +9,6 @@ sub_wiki:
data: {}
json: {}
#百科详情页-项目百科-水光针
basewiki_item:
method: GET
url: /hybrid/base_wiki/item/141
params:
version: ${version}
data: {}
json: {}
#百科详情页-药品(仪器、材料)百科-菲洛嘉
basewiki_product:
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
......@@ -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_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")
# 回答评论点赞&取消点赞
......@@ -462,8 +464,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")
#百科详情页-项目百科
BASEWIKI_ITEM_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "hybrid_request.yaml")
BASEWIKI_ITEM = os.path.join(BASE_DIR, "backend_auto/test_backend_data/hybrid_data", "basewiki_item.yaml")
WIKI_ITEM_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "wiki_request.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")
......
......@@ -18,7 +18,7 @@ class TestDoctor:
assert r["data"][0]["id"] == param["assert_id"]
assert r["data"][0]["doctor_name"] == param["assert_name"]
assert r["data"][0]["good_at"][0] == param["assert_good_at"]
assert r["data"][0]["cases"][0]["name"] == param["assert_cases"]
# assert r["data"][0]["cases"][0]["name"] == param["assert_cases"]
assert r["data"][0]["title"] == param["assert_title"]
......
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
......@@ -15,6 +15,8 @@ class TestBeautyCardRefundSubmit:
r = janus_request().beauty_card_refund_submit(param["order_id"], param["reason_id"], param["reason_text"],
param["reason_type"])
if r["error"] == 1:
if param["reason_id"] == -1:
assert r["message"] == param["assert_message"]
if param["reason_id"] != -1:
assert r["message"] == param["assert_message"]
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
......@@ -5,7 +5,7 @@ doctor:
assert_id: "ad99d0b0b6eb4a2c97ffadad48b7cdfd"
assert_name: "赵希军"
assert_good_at: "吸脂瘦身"
assert_cases: "自体脂肪填充面部 80例"
# assert_cases: "自体脂肪填充面部 80例"
assert_title: "副主任"
-
case: "校验医生id case"
......@@ -13,7 +13,7 @@ doctor:
assert_id: "ad99d0b0b6eb4a2c97ffadad48b7cdfd"
assert_name: "赵希军"
assert_good_at: "吸脂瘦身"
assert_cases: "自体脂肪填充面部 80例"
# assert_cases: "自体脂肪填充面部 80例"
assert_title: "副主任"
-
case: "校验医生名称case"
......@@ -21,7 +21,7 @@ doctor:
assert_id: "ad99d0b0b6eb4a2c97ffadad48b7cdfd"
assert_name: "赵希军"
assert_good_at: "吸脂瘦身"
assert_cases: "自体脂肪填充面部 80例"
# assert_cases: "自体脂肪填充面部 80例"
assert_title: "副主任"
-
case: "校验医生明星项目case"
......@@ -29,7 +29,7 @@ doctor:
assert_id: "ad99d0b0b6eb4a2c97ffadad48b7cdfd"
assert_name: "赵希军"
assert_good_at: "吸脂瘦身"
assert_cases: "自体脂肪填充面部 80例"
# assert_cases: "自体脂肪填充面部 80例"
assert_title: "副主任"
-
case: "校验医生案例case"
......@@ -37,7 +37,7 @@ doctor:
assert_id: "ad99d0b0b6eb4a2c97ffadad48b7cdfd"
assert_name: "赵希军"
assert_good_at: "吸脂瘦身"
assert_cases: "自体脂肪填充面部 80例"
# assert_cases: "自体脂肪填充面部 80例"
assert_title: "副主任"
-
case: "校验医生title case"
......@@ -45,5 +45,5 @@ doctor:
assert_id: "ad99d0b0b6eb4a2c97ffadad48b7cdfd"
assert_name: "赵希军"
assert_good_at: "吸脂瘦身"
assert_cases: "自体脂肪填充面部 80例"
# assert_cases: "自体脂肪填充面部 80例"
assert_title: "副主任"
\ No newline at end of file
beauty_card_refund_submit:
-
case: "次卡-提交退款申请-接口调用成功case"
case: "次卡-提交退款申请-非其他原因case"
order_id: "102813852173916"
reason_id: 3
reason_text: "个人身体原因"
reason_type: 0
assert_message: "订单已经退款"
-
case: "次卡-提交退款申请-其他原因case"
order_id: "102813852173916"
reason_id: -1
reason_text: "其他原因不得少于10个字"
reason_type: 0
assert_message: "订单已经退款"
\ No newline at end of file
......@@ -3,7 +3,7 @@ reply_create:
beuzhu: '# 备注: 这个文件有冲突的话,那个版本都行不会影响,回退/接受当前版本都行,因为每次运行content都会改变'
case: 日记贴一级评论创建--正常校验&创建二级评论--正常校验
channel: benzhan
content: ces测试+2021-07-13 10:43:03
content: ces测试+2021-07-14 18:15:39
message: 请勿回复重复内容
message1: 回复成功
message2: 你的回复有点频繁,稍后再来
......
basewiki_item:
wiki_item:
-
#百科详情页-项目百科,水光针
case: "百科详情页-项目百科,水光针"
tag_ids: "2059"
q: "水光针"
start_num: "0"
version: "744.0"
assert: 水光针
\ No newline at end of file
device_id: "97B6764B-2135-4761-9911-701C38CBC272"
assert: 141
\ 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