logging.info('login finished!')
        return result

    # 执行退出登录操作
    def logout_action(self):
        logging.info("----------logout action---------")
        Common(self.driver).click(self.my_tab)
        Common(self.driver).click(self.sys_setting)
        Common(self.driver).click(self.logout_btn)
        Common(self.driver).click(self.logout_text)

    # 检查登录状态
    def check_login_status(self):
        try:
            Common(self.driver).find_element_by_uiautomator(self.my_tab)
        except NoSuchElementException:
            logging.info("login failure!")
            # Common(self.driver).getScreenShot('login')
            return False
        else:
            logging.info("login success!")
            self.logout_action()
            return True

if __name__ == '__main__':
    driver = appium_desired()
    login = LoginView(driver)
    # test_login.login_action("15616699600", "zh123123")


Beispiel #2
0
from common.commonfunc import Common
import logging
from common import desired_cap


class HomePlay(Common):
    def play(self):
        #
        self.find_element("com.luojilab.player:id/homeLayout").click()

        list = self.find_elements("com.luojilab.player:id/play_state")
        print(list)


if __name__ == '__main__':
    driver = desired_cap.appium_desired()
    hp = HomePlay(driver)
    hp.play()
Beispiel #3
0
 def setUp(self):
     self.driver = appium_desired()
     logging.info("启动APP,开始测试")
Beispiel #4
0
 def setUp(self):
     logging.info('----------setUp----------')
     self.driver = appium_desired()