def setUp_test_login_0057(): from settings.available_devices import TARGET_APP Preconditions.select_mobile('Android-移动') current_mobile().hide_keyboard_if_display() if not current_mobile().is_app_installed(TARGET_APP.get('APP_PACKAGE')): current_mobile().install_app(TARGET_APP.get('DOWNLOAD_URL'), replace=True)
def test_login_0056(self): """ 先卸载后安装""" # 卸载和飞信 from settings.available_devices import TARGET_APP current_mobile().remove_app(TARGET_APP.get('APP_PACKAGE')) current_mobile().install_app(TARGET_APP.get('DOWNLOAD_URL'), replace=True) Preconditions.make_already_in_message_page()
def test_login_0074(self): """ 先卸载后安装""" # 卸载和飞信 from settings.available_devices import TARGET_APP current_mobile().remove_app(TARGET_APP.get('APP_PACKAGE')) current_mobile().install_app(TARGET_APP.get('DOWNLOAD_URL'), replace=True) # Preconditions.make_already_in_message_page() Preconditions.select_mobile('Android-移动') current_mobile().hide_keyboard_if_display() Preconditions.app_start_for_the_first_time() sl = SmsLoginPage() sl.page_should_not_contain_text('一键登陆')
def tearDown_test_login_0057(self): from settings.available_devices import TARGET_APP Preconditions.select_mobile('Android-移动') if current_mobile().is_app_installed(TARGET_APP.get('APP_PACKAGE')): return # 预防安装应用的时候发生异常,尝试恢复安装,(还不知道好不好使) reinstall_try_time = 3 while reinstall_try_time > 0: try: current_mobile().remove_app(TARGET_APP.get('APP_PACKAGE')) current_mobile().install_app(TARGET_APP.get('DOWNLOAD_URL'), replace=True) break except: reinstall_try_time -= 1 if reinstall_try_time == 0: import traceback traceback.print_exc()
def test_login_0117(self): """ 老版用户更新后登录""" oklp = OneKeyLoginPage() sl = SmsLoginPage() oklp.wait_for_page_load() oklp.click_one_key_login() time.sleep(1) oklp.page_should_contain_text('查看详情') # 查看详情 sl.click_read_agreement_detail() # 同意协议 agreement = AgreementDetailPage() agreement.click_agree_button() time.sleep(1) from settings.available_devices import TARGET_APP current_mobile().install_app(TARGET_APP.get('DOWNLOAD_URL'), replace=True) time.sleep(5) current_mobile().activate_app() time.sleep(10) oklp.page_should_contain_text('消息')