def test_account_login(self): self.Log.debug("登录测试开始") Mine(self.driver).stay_unlocation() Login(self.driver).account_login(account, password) try: #验证登录 Mine(self.driver).get_accountname() except Exception as e: self.driver.save_screenshot( Project_path.Image_path + "%s_%s.png" % (sys._getframe().f_code.co_name, self.nowtime)) raise e else: self.Log.debug("登录成功") self.Log.info("%s test pass" % sys._getframe().f_code.co_name)
def into_account_login(self): Mine(self.driver).into_login() try: WebDriverWait(self.driver, 10, 0.2).until( EC.visibility_of_element_located( (By.ID, account_login_location))) except Exception as e: raise e else: self.driver.find_element_by_id(account_login_location).click()
def setUpClass(cls): Log = Logger() Log.info("========%s测试开始:========" % __class__.__name__) nowtime = time.strftime("%Y%m%d%H%M") driver = webdriver.Remote(appium_url, desired_caps) cls.nowtime=nowtime cls.Log=Log cls.driver=driver # 判断是否有弹窗,并关闭 Main(driver).close_ad() Main(driver).close_update() Mine(driver).stay_location() Main(driver).into_Mainpage(1)
def setUp(self): Main(self.driver).close_ad() Main(self.driver).close_update() Mine(self.driver).stay_unlocation()
def phone_login(self, phone, vcode): Mine(self.driver).into_login() pass