def test_1bindhouse_owner_not_pass(self): logging.info('===========test_bindhouse_owner_not_pass==========') b = bindhouseView(self.driver) l = loginView(self.driver) l.login_action(owner_not_pass['phone'], '111111') b.bindhouse_action(owner_not_pass) self.assertTrue(b.check_bind_result(113))
def test_1bindhouse_owner_del_dep(self): logging.info('===========test_bindhouse_owner_del_dep==========') b = bindhouseView(self.driver) l = loginView(self.driver) l.login_action(owner_del_dep['phone'], '111111') b.bindhouse_action(owner_del_dep) self.assertTrue(b.check_bind_result(112))
def test_rub_dist_char(self): logging.info('===============test_rub_dist_char================') l = loginView(self.driver) ru = rubbishgameView(self.driver) l.login_action('15500001010', '111111') ru.rub_dist_char() self.assertTrue(ru.check_rub_dist_char_result())
def test_service(self): logging.info('===============test_service==============') l = loginView(self.driver) s = serviceView(self.driver) l.login_action('15500001010', '111111') s.search_store_action() self.assertTrue(s.check_search_result())
def test_2verify_2owner_not_pass(self): logging.info('===========test_2verify_2owner_not_pass==========') v = committee_verify_View(self.driver) l = loginView(self.driver) l.login_action('15500001010', '111111') v.committee_verify_action() v.verify_owner_not_pass_action() self.assertTrue(v.check_owner_not_pass_result())
def test_2verify_3owner_be_deleted(self): logging.info('===========test_2verify_3owner_be_deleted==========') v = committee_verify_View(self.driver) l = loginView(self.driver) l.login_action('15500001010', '111111') v.committee_verify_action() v.verify_owner_be_deleted_action() self.assertTrue(v.check_owner_be_deleted_result())
def test_send_capturebyhand(self): '''随手拍测试用例,验证添加图片和录音并提交''' logging.info('=============test_send_capturebyhand============') l=loginView(self.driver) ca=capturebyhandView(self.driver) c=common(self.driver) l.login_action('15500001010', '111111') ca.send_capturebyhand_action() self.assertTrue(ca.check_capturebyhand_result()) c.add_screenshot_to_report('test_send_capturebyhand')
def check_no_dep_result(self): #driver=appium_desired() 这句有错,因为在执行测试时 会有一个driver已经起来,此处写上造成session冲突 l=loginView(self.driver) l.login_action(owner_del_dep['phone'],'111111') self.click(*self.usercenter_my2) self.click(*self.family_meb) try: self.find_element(*self.owner_be_deleted_elem) except NoSuchElementException: logging.info('家属列表中按预期未找到:%s' % owner_be_deleted['name']) return True else: logging.info('家属列表中错误的找到:%s' % owner_be_deleted['name']) self.getscreenshot('家属中错误的找到业主—被删除') return False
def check_have_dep_result(self): #driver=appium_desired() l=loginView(self.driver) l.login_action(owner_have_dep['phone'],'111111') self.click(*self.usercenter_my3) self.click(*self.family_meb) try: self.find_element(*self.owner_dependents_elem) except NoSuchElementException: logging.info('家属列表中未找到:%s' % owner_dependents['name']) self.getscreenshot('家属中未发现业主—家属') return False else: logging.info('家属列表中成功找到:%s' % owner_dependents['name']) return True
self.click(*self.family_meb) try: self.find_element(*self.owner_be_deleted_elem) except NoSuchElementException: logging.info('家属列表中按预期未找到:%s' % owner_be_deleted['name']) return True else: logging.info('家属列表中错误的找到:%s' % owner_be_deleted['name']) self.getscreenshot('家属中错误的找到业主—被删除') return False if __name__ == '__main__': driver=appium_desired() v=committee_verify_View(driver) l = loginView(driver) b = bindhouseView(driver) reg = registerView(driver) reg.register_action(owner_dependents) reg.check_register_success() b.bindhouse_action(owner_dependents) b.check_bind_result(113) b.logout_after_bind() reg.register_action(owner_have_dep) reg.check_register_success() b.bindhouse_action(owner_have_dep) b.check_bind_result(113) b.logout_after_bind() l.login_action('15500001010', '111111') time.sleep(5) v.committee_verify_action()
def test_login_fail(self): logging.info('===========est_login_fail==========') l = loginView(self.driver) l.login_action('15500001010','222222') self.assertTrue(l.check_login_fail)
def test_login_success(self): logging.info('===========test_login_success==========') l=loginView(self.driver) l.login_action('15500001010','111111') self.assertTrue(l.check_login_success())