Beispiel #1
0
    def test_002_qq(self):
        open.my(self)
        username = self.driver.find_element_by_id(
            'org.fungo.a8sport:id/tvUserName').text

        if username != '点击登录':
            login.quit(self)
            print('退出登陆')
            self.driver.swipe(540, 800, 650, 1630, 2000)
            time.sleep(1)
            self.driver.find_element_by_id(
                'org.fungo.a8sport:id/ivUserAvatar').click()
            time.sleep(1)
            self.driver.find_element_by_id(
                'org.fungo.a8sport:id/qqlogin').click()
            time.sleep(3)
            self.driver.find_element_by_android_uiautomator(
                "text(\"登录\")").click()
            time.sleep(2)
            print('QQ登陆')
        else:
            self.driver.find_element_by_android_uiautomator(
                "text(\"点击登录\")").click()
            time.sleep(1)
            self.driver.find_element_by_id(
                'org.fungo.a8sport:id/qqlogin').click()
            time.sleep(3)
            self.driver.find_element_by_android_uiautomator(
                "text(\"登录\")").click()
            time.sleep(2)
            print('QQ登陆')
        self.assertNotEquals(username, u'点击登录', '没有登陆成功')
Beispiel #2
0
    def test_001_wx(self):
        open.my(self)
        username = self.driver.find_element_by_id(
            'org.fungo.a8sport:id/tvUserName').text

        if username != '点击登录':
            login.quit(self)
            print('退出登陆')
            self.driver.swipe(540, 800, 650, 1630, 2000)
            time.sleep(1)
            self.driver.find_element_by_id(
                'org.fungo.a8sport:id/ivUserAvatar').click()
            time.sleep(1)
            self.driver.find_element_by_id(
                'org.fungo.a8sport:id/id_imgWechat').click()
            time.sleep(3)
            print('微信登陆')
        else:
            self.driver.find_element_by_id(
                'org.fungo.a8sport:id/ivUserAvatar').click()
            time.sleep(1)
            self.driver.find_element_by_id(
                'org.fungo.a8sport:id/id_imgWechat').click()
            time.sleep(3)
            print('微信登陆')
        self.assertEquals(username, u'点击登录', '没有登陆成功')
Beispiel #3
0
 def quit(self):
     open.my(self)
     self.driver.swipe(650, 1630, 540, 800, 2000)
     time.sleep(5)
     self.driver.find_element_by_android_uiautomator("text(\"设置\")").click()
     time.sleep(1)
     self.driver.swipe(650, 1630, 540, 800, 2000)
     self.driver.find_element_by_id(
         'org.fungo.a8sport:id/login_text').click()
Beispiel #4
0
 def test_005(self):
     open.my(self)
     login.quit(self)
     a = Toast.is_toast_exist(self.driver, '成功退出当前账号!')
     #        Toast.find_toast(self.driver, "成功退出当前账号!", 10, 0.5)
     if a is True:
         print('对的')
     else:
         print('没找到')