def test_report(self): Log.log_case_desc("TC002:这个case是生产报告") print(sys.stdout, "<STEP_BEGIN>%s<STEP_END>" % ("发送 https://baidu.com/1/news")) print(sys.stdout, "<STEP_BEGIN>%s<STEP_END>" % ("发送 https://baidu.com/1/news")) Log.log_error_info("meet error when generate report")
def test_APP_179(self): Log.log_case_desc("合法用户成功登录appp") http_handle = HttpHandle() login_url = "http://" + self.config["Host"][ self.env] + self.config["Victy"]["Login"] #检查正确的电话号码 data = eval(self.case_data["APP_179"]["right_account"]) http_handle.do_post(login_url, data) http_handle.response_code_status_should_be(200) http_handle.print_response_python_strcut_body() http_handle.response_keys_type_is_right(target_struct={ "status": "BOOL", "msg": "STRING", "data": "HASH" }) http_handle.response_key_value_is_right(target_value={ "status": True, "msg": "登录成功" }) http_handle.response_keys_type_is_right("data", target_struct={ "userID": "INT", "account": "STRING", "imPass": "******" })
def test_APP_180(self): Log.log_case_desc("非法用户不能成功登录app") http_handle = HttpHandle() login_url = "http://" + self.config["Host"][ self.env] + self.config["Victy"]["Login"] #检查错误的电话号码 data = eval(self.case_data["APP_180"]["illegal_phone_num"]) http_handle.do_post(login_url, data) http_handle.response_code_status_should_be(200) http_handle.response_dictionary_should_have_key_value("status", False) http_handle.response_dictionary_should_have_key_value("data", None) http_handle.response_keys_type_is_right(target_struct={ "status": "BOOL", "msg": "STRING" }) http_handle.response_key_value_is_right(target_value={ "status": False, "msg": "手机格式不正确", "data": None }) #检查错误的密码 data = eval(self.case_data["APP_180"]["wrong_password"]) http_handle.do_post(login_url, data) http_handle.response_code_status_should_be(200) http_handle.response_key_value_is_right(target_value={ "status": False, "msg": "密码错误!请检查!", "data": None }) #检查密码为空 data = eval(self.case_data["APP_180"]["no_password"]) http_handle.do_post(login_url, data) http_handle.print_response_body() http_handle.print_response_python_strcut_body() http_handle.response_code_status_should_be(200) http_handle.response_key_value_is_right(target_value={ "status": False, "msg": "密码错误!请检查!", "data": None })
def test_report1(self): Log.log_case_desc("TC002:/api/test/case/10001:8080/news") print( sys.stdout, "<STEP_BEGIN>%s<STEP_END>" % ("等待元素:(xpath: //div/html/div[1]/a[contains(text(),'点击上传')]//a['登陆'])" ))
def test_report(self): Log.log_case_desc("TC001:这个case是生产报告") print(sys.stdout, "<STEP_BEGIN>%s<STEP_END>" % ("点击元素: //a['登陆']1")) print(sys.stdout, "<STEP_BEGIN>%s<STEP_END>" % ("等待元素://a['登陆']1")) Log.log_error_info("meet error when generate report")