Commit d34c09be authored by admin's avatar admin

医院主页详情接口自动化

parent 42c6066e
import path_setting
from in_common.base_request import BaseRequest
class hospitals_request(BaseRequest):
def __init__(self):
self.data = self.api_load(path_setting.HDYAML_CONFIG)
def detail(self):
return self.api_send(self.data["detail"])
if __name__ == '__main__':
print(hospitals_request().detail())
\ No newline at end of file
detail:
method: get
url: /api/hospitals/bjxyjcpfbyy/detail
params: {}
data: {}
json: {}
......@@ -7,5 +7,9 @@ HOSTYAML_CONFIG = os.path.join(BASE_DIR, "backend_auto", "host.yaml")
APYAML_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "account_request.yaml")
LOGIN_VFC = os.path.join(BASE_DIR, "backend_auto/test_backend_data/account_data", "login_vfc.yaml")
#医院主页详情
HDYAML_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "hospitals_request.yaml")
HOSPITAL_DETAIL = os.path.join(BASE_DIR, "backend_auto/test_backend_data/hospitals_data", "detail.yaml")
if __name__ == '__main__':
print("==========",HOSTYAML_CONFIG)
import pytest
from all_backend_api.hospitals_request import hospitals_request
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
class TestDetail:
data = BaseRequest().api_load(path_setting.HOSPITAL_DETAIL)
detail_case, detail_data = get_ids(data, "detail")
@pytest.mark.parametrize("param", detail_data, ids=detail_case)
def test_detail(self, param):
r = hospitals_request().detail()
assert r["error"] == param["assert_error"]
assert r["data"]["base_info"]["hospital_name"] == param["assert"]
assert r["data"]["base_info"]["good_at"][0] == param["assert1"]
assert r["data"]["base_info"]["hospital_type"] == param["assert2"]
assert r["data"]["buy_related"]["gifts"][0]["gift_id"] == param["assert3"]
assert r["data"]["tab"] == param["assert4"]
assert r["data"]["image_header_area"]["hospital_images"][0] == param["assert5"]
detail:
#校验成功case
-
case: "校验接口调用成功case"
assert_error: 0
assert: "北京嘉禾医疗美容"
assert1: "私密修复"
assert2: "民营"
assert3: 56895
assert4: {index: true, service: true, doctor: true, publish: false, doctor_say: false, diary: true, answer: false}
assert5: "https://heras.igengmei.com/doctor/2020/07/29/ef19b5fa94-w"
-
case: "校验医院名称case"
assert_error: 0
assert: "北京嘉禾医疗美容"
assert1: "私密修复"
assert2: "民营"
assert3: 56895
assert4: {index: true, service: true, doctor: true, publish: false, doctor_say: false, diary: true, answer: false}
assert5: "https://heras.igengmei.com/doctor/2020/07/29/ef19b5fa94-w"
-
case: "校验明星项目case"
assert_error: 0
assert: "北京嘉禾医疗美容"
assert1: "私密修复"
assert2: "民营"
assert3: 56895
assert4: {index: true, service: true, doctor: true, publish: false, doctor_say: false, diary: true, answer: false}
assert5: "https://heras.igengmei.com/doctor/2020/07/29/ef19b5fa94-w"
-
case: "校验医院类型case"
assert_error: 0
assert: "北京嘉禾医疗美容"
assert1: "私密修复"
assert2: "民营"
assert3: 56895
assert4: {index: true, service: true, doctor: true, publish: false, doctor_say: false, diary: true, answer: false}
assert5: "https://heras.igengmei.com/doctor/2020/07/29/ef19b5fa94-w"
-
case: "校验优惠券返回case"
assert_error: 0
assert: "北京嘉禾医疗美容"
assert1: "私密修复"
assert2: "民营"
assert3: 56895
assert4: {index: true, service: true, doctor: true, publish: false, doctor_say: false, diary: true, answer: false}
assert5: "https://heras.igengmei.com/doctor/2020/07/29/ef19b5fa94-w"
-
case: "校验tab返回case"
assert_error: 0
assert: "北京嘉禾医疗美容"
assert1: "私密修复"
assert2: "民营"
assert3: 56895
assert4: {index: true, service: true, doctor: true, publish: false, doctor_say: false, diary: true, answer: false}
assert5: "https://heras.igengmei.com/doctor/2020/07/29/ef19b5fa94-w"
-
case: "校验医院图片case"
assert_error: 0
assert: "北京嘉禾医疗美容"
assert1: "私密修复"
assert2: "民营"
assert3: 56895
assert4: {index: true, service: true, doctor: true, publish: false, doctor_say: false, diary: true, answer: false}
assert5: "https://heras.igengmei.com/doctor/2020/07/29/ef19b5fa94-w"
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