def start(cls): caps = {} caps['platformName'] = "Android" caps['deviceName'] = "127.0.0.1:62001" caps['unicodeKeyboard'] = True caps['resetKeyboard'] = True caps['automationName'] = 'uiautomator2' caps['noReset'] = False caps['appPackage'] = 'com.youdao.yread' caps[ 'appActivity'] = '.app.presentation.infrastructure.activity.splash.SplashActivity' cls.driver = webdriver.Remote('http://localhost:4723/wd/hub', caps) cls.driver.implicitly_wait(8) try: element = cls.driver.find_element_by_id('btnRight') except: print('PrivacyRightBtn element is not found!') else: print('同意隐私协议') element.click() try: element = cls.driver.find_element_by_id('iv_popup_close') except: print('PopupCloseBtn element is not found!') else: print('关闭开机弹窗') element.click() return MainPage(cls.driver)
def login(self, login_iphone, login_password): from page.MainPage import MainPage # 账号 密码 self.clear_and_sendkeys(login_iphone, *self._iphone) self.clear_and_sendkeys(login_password, *self._password) logg.info("输入手机号是:%s 和密码,登陆" % login_iphone) # 点击登陆 self.click_element(*self._login_btn) logg.info("点击登陆按钮") return MainPage()
def backtomain(self): self.find(By.XPATH, '//Button[contains(@Name, "Close")]').click() return MainPage()
def loginSuccessByPassword(self, account, password): # 登录成功 from page.MainPage import MainPage return MainPage()
def test_login_telephone(self, telephone, pw, msg): self.LoginPage.loginByTelephone(telephone, pw) from page.MainPage import MainPage return MainPage()
def main_page(cls): cls.getClient().open_browser(cf.browser, cf.baseURL) return MainPage()
def main(cls): cls.getClient().initial_web() from page.MainPage import MainPage return MainPage()
def main(cls): cls.getClient().restart_app() return MainPage()
def main(cls): cls.getClient().launch_app() return MainPage()