Exemplo n.º 1
0
 def test_login_1(self):
     logging.info('========test_login_1========')
     driver = appium_desired()
     sleep(5)
     com = Common(driver)
     com.swipeLr(0.1, 0.9, 0.5)
     lo = LoginView(driver)
     lo.login_action('80403765', 'zaijian11')
Exemplo n.º 2
0
 def setUpClass(cls):
     # logging.info("======== setUpClass========")
     cls.driver = appium_desired()
     status = ZhiXin(cls.driver).login_status
     if status:
         ZhiXin(cls.driver).login_out_zx()
     else:
         pass
     ZhiXin(cls.driver).login_zx2()
Exemplo n.º 3
0
    def login_case(self, username, password):
        logger.debug('======ready to login==========')
        driver = desired_caps.appium_desired()

        first_page = pageObject.FirstPage(driver)
        elements_name = first_page.get_elements_name()
        first_page.upgrade_cancel(elements_name)
        first_page.skip_page(elements_name)

        login_page = pageObject.LoginPage(driver)
        login_page.send_username(elements_name, username)
        login_page.send_password(elements_name, password)
        login_page.login_btn(elements_name)
        sleep(2)
        login_page.get_screen_shot('登录结果')
        return login_page.login_toast(elements_name)
 def setUp(self):
     logging.info('--------setUp-----------')
     self.driver=appium_desired()
Exemplo n.º 5
0
            logger.debug(('?',e))
        else:
            #print(element.text)
            return element.text

    def myself_setup_relogin(self,elements_name):
        location = (By.ID,elements_name['setup_page_relogin'])
        try:
            element = self.find_element(*location)
        except Exception as e:
            logger.debug(('?',e))
        else:
            element.click()

if __name__ == "__main__":

    import desired_caps
    driver = desired_caps.appium_desired()

    first_page = FirstPage(driver)
    elements_name = first_page.get_elements_name()
    first_page.upgrade_cancel(elements_name)
    first_page.skip_page(elements_name)

    login_page = LoginPage(driver)
    login_page.send_username(elements_name,'abcd')
    login_page.send_password(elements_name,'')
    login_page.login_btn(elements_name)
    login_page.understand(elements_name)

Exemplo n.º 6
0
 def setUp(self):
     logging.info('============setUp============')
     self.driver = appium_desired()
Exemplo n.º 7
0
        logging.info(image_file)
        logging.info('get %s screenshot' % module)
        self.driver.get_screenshot_as_file(image_file)

    def check_market_ad(self):
        logging.info('====check_market_ad====')
        try:
            element = self.find_element(*self.wemedia_cacel)
        except NoSuchElementException:
            pass
        else:
            logging.info('close market ad')
            element.click()

    def get_csv_data(self, csv_file, line):
        logging.info('=====get_csv_data======')
        with open(csv_file, 'r', encoding='utf-8-sig') as file:
            reader = csv.reader(file)
            for index, row in enumerate(reader, 1):
                if index == line:
                    return row


if __name__ == '__main__':
    driver = appium_desired()
    com = Common(driver)
    com.check_cancelBtn()
    com.check_skipBtn()
    com.check_market_ad()
    com.swipeLeft()
    com.getScreenShot('startApp')
Exemplo n.º 8
0
 def setUp(self):
     warnings.simplefilter('ignore', ResourceWarning)
     logging.info('========setUp========')
     self.driver = appium_desired()
     sleep(5)