def test_logincustomer(self, get_session): case_data = get_test_data(self.excel_data, 'logincustomer') # 从数据列表中查找到该用例数据 res = send_request(get_session, case_data) assert case_data['expect_res'] == res["message"] assert_in_text(res, case_data['expect_res']) log_case_info(case_data, res)
def test_add_contract03(self, get_session): case_data = get_test_data(self.excel_data, 'deletecontract') a = StudentPage() da = a.delete_contract_data() case_data['data'] = da res = send_request(get_session, case_data) assert case_data['expect_res'] == res["message"] log_case_info(case_data, res)
def test_daycare_course01(self, get_session): case_data = get_test_data(self.excel_data, 'daycarecourse') a = DayCareCourse() da = a.add_course() case_data['data'] = da res = send_request(get_session, case_data) assert case_data['expect_res'] == res["message"] log_case_info(case_data, res)
def test_user_login_wrong(self): case_data = get_test_data(self.excel_data, 'userloginwrong') # 从数据列表中查找到该用例数据 print(case_data['url']) if not case_data: # 有可能为None print("用例数据不存在") else: res = send_request(case_data) assert case_data['expect_res'] == res["detail"] log_case_info(case_data, res)
def test_user_login_normal(self): case_data = get_test_data(self.excel_data,'userloginnormal') # 从数据列表中查找到该用例数据 res = send_request(case_data) assert case_data['expect_res'] == res["data"]["account"]["name"] log_case_info(case_data, res)
def test_daycare_course02(self, get_session): case_data = get_test_data(self.excel_data, 'deletedaycourse') res = send_request(get_session, case_data) assert case_data['expect_res'] == res["message"] log_case_info(case_data, res)
def test_addstudent(self, get_session): case_data = get_test_data(self.excel_data, 'addstudent') res = send_request(get_session, case_data) assert case_data['expect_res'] == res["message"] log_case_info(case_data, res)