class TestCase(): def setup(self): self.mainpage = MainPage() def test_shanchu(self): result = self.mainpage.click_txl().person_data().editcy().search() assert result == False
def editcy(self): # 编辑成员 edit_locator = ("id", "b91") queding_locator = ("xpath", '//*[contains(@text,"确定")]') find_element(self.driver, edit_locator).click() find_by_scroll(self.driver, "删除成员").click() find_element(self.driver, queding_locator).click() from page.mainpage import MainPage return MainPage(self.driver)
def loggin(self, uid, pwd): with allure.step("输入账号"): self.driver.find_element_by_id("uid").send_keys(uid) with allure.step("输入密码"): self.driver.find_element_by_id("pwd").send_keys(pwd) with allure.step("双击机构代码"): self.comcode = self.driver.find_element_by_id("comcode") ActionChains(self.driver).double_click( self.comcode).perform() ##执行链中的所有操作 with allure.step("点击登录"): self.driver.find_element_by_id("btn").click() return MainPage(self.driver)
def backtohome(self): self.driver.back() from page.mainpage import MainPage return MainPage()
def goto_main(self, driver): print("进goto_main----------------") return MainPage(driver)
def setup_class(cls): cls.maillistpage = MainPage().to_maillist() cls.maillistpage.logger.info('\n\n' + '*' * 20 + '测试删除联系人成功' + '*' * 20 + '\n')
def setup_class(cls): cls.mailpage = MainPage().to_sendmailpage() cls.mailpage.logger.info('\n\n' + '*' * 20 + '测试发送邮件失败' + '*' * 20 + '\n')
def app_home(cls): cls.get_client().restart_app() return MainPage()
def _click_send_email(self): from page.mainpage import MainPage self._find(self._send_locator).click() return MainPage()
def goto_main(self): '''进入首页''' return MainPage(self.driver)
def setup_class(cls): cls.login_page = MainPage().login_no_cookie() cls.login_page.logger.info('\n\n' + '*' * 20 + '测试用户登录成功' + '*' * 20 + '\n')
def to_mainpage(self): from page.mainpage import MainPage return MainPage()
def setup(self): self.mainpage = MainPage()