示例#1
0
    def test_login_0008(self):
        """下线提醒"""
        # 切换到辅助机2,并用测试机的号码登录
        Preconditions.select_mobile('Android-电信')
        sms_page = SmsLoginPage()
        sms_page.wait_for_page_load(30)
        sms_page.input_phone_number(self.login_number)
        # sms_page.click_get_code()

        # 切换回测试机取验证码
        mobile1 = Preconditions.select_mobile('Android-移动')
        with mobile1.listen_verification_code(120) as code:
            # 切换到手机2获取验证码
            switch_to_mobile(REQUIRED_MOBILES['Android-电信'])
            sms_page.click_get_code()
        # code = sms_page.listen_verification_code(60)

        # 切换到辅助机2
        Preconditions.select_mobile('Android-电信')
        sms_page.input_verification_code(code)
        sms_page.click_login()
        OneKeyLoginPage().click_read_agreement_detail()
        AgreementDetailPage().click_agree_button()
        sms_page.click_i_know()

        message_page = MessagePage()
        message_page.wait_for_page_load(60)

        # 切换回测试机等待下线提示
        Preconditions.select_mobile('Android-移动')
        message_page.wait_until(
            condition=lambda d: message_page.is_text_present('下线通知'),
            timeout=30)
示例#2
0
 def select_mobile(category, reset=False):
     """选择手机"""
     client = switch_to_mobile(REQUIRED_MOBILES[category])
     client.connect_mobile()
     if reset:
         current_mobile().reset_app()
     return client
示例#3
0
 def select_single_cmcc_android_4g_client():
     """
     启动
     1、4G,安卓客户端
     2、移动卡
     :return:
     """
     client = switch_to_mobile(REQUIRED_MOBILES['测试机'])
     client.connect_mobile()
示例#4
0
 def disconnect_mobile(category, reset=False):
     """选择手机"""
     client = switch_to_mobile(REQUIRED_MOBILES[category])
     client.disconnect_mobile()
 def disconnect_mobile(category):
     """选择手机手机"""
     client = switch_to_mobile(category)
     client.disconnect_mobile()
     return client
 def connect_mobile(category):
     """选择手机手机"""
     client = switch_to_mobile(REQUIRED_MOBILES[category])
     client.connect_mobile()
     return client
示例#7
0
 def select_assisted_mobile2():
     """切换到单卡、异网卡Android手机 并启动应用"""
     switch_to_mobile(REQUIRED_MOBILES['辅助机2'])
     current_mobile().connect_mobile()
示例#8
0
 def diff_card_enter_sms_login_page(required_mobiles_key):
     """异网卡进入短信登录界面"""
     client = switch_to_mobile(REQUIRED_MOBILES[required_mobiles_key])
     client.connect_mobile()
     Preconditions.diff_card_make_already_in_sms_login_page()
 def disconnect_mobile(category):
     """断开手机连接"""
     client = switch_to_mobile(REQUIRED_MOBILES[category])
     client.disconnect_mobile()
     return client