Пример #1
0
    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)
Пример #2
0
    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()
Пример #3
0
 def backtomain(self):
     self.find(By.XPATH, '//Button[contains(@Name, "Close")]').click()
     return MainPage()
Пример #4
0
 def loginSuccessByPassword(self, account, password):
     # 登录成功
     from page.MainPage import MainPage
     return MainPage()
Пример #5
0
 def test_login_telephone(self, telephone, pw, msg):
     self.LoginPage.loginByTelephone(telephone, pw)
     from page.MainPage import MainPage
     return MainPage()
Пример #6
0
 def main_page(cls):
     cls.getClient().open_browser(cf.browser, cf.baseURL)
     return MainPage()
Пример #7
0
 def main(cls):
     cls.getClient().initial_web()
     from page.MainPage import MainPage
     return MainPage()
 def main(cls):
     cls.getClient().restart_app()
     return MainPage()
Пример #9
0
 def main(cls):
     cls.getClient().launch_app()
     return MainPage()