本文整理汇总了Python中Utils.Config.wait_for_element_visibility方法的典型用法代码示例。如果您正苦于以下问题:Python Config.wait_for_element_visibility方法的具体用法?Python Config.wait_for_element_visibility怎么用?Python Config.wait_for_element_visibility使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Utils.Config
的用法示例。
在下文中一共展示了Config.wait_for_element_visibility方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test
# 需要导入模块: from Utils import Config [as 别名]
# 或者: from Utils.Config import wait_for_element_visibility [as 别名]
def test(self):
InitCase.init_case(menu="ALL", taskNo=0)
self.verificationErrors = []
Config.find_element(Config.openSettings).click()
Config.wait_for_element(Config.settings_preferences)
Config.find_element(Config.settings_preferences).click()
Config.wait_for_element(Config.preferences_defaultList)
Config.find_element(Config.preferences_defaultList).click()
Config.wait_for_element(Config.defaultList_changeDefault)
newDefaultName = Config.find_element(Config.defaultList_changeDefault).text
Config.find_element(Config.defaultList_changeDefault).click()
Config.find_element(Config.overlay).click()
Config.wait_for_element_visibility(Config.overlay, visible=False)
CreateTaskF.create_a_task("def")
Config.find_element(Config.taskTitle).click()
Config.wait_for_element(Config.task_FolderSelector)
try: self.assertEqual(Config.find_element(Config.task_FolderSelector).text, newDefaultName)
except AssertionError as e: self.verificationErrors.append(e)
self.assertEqual([], self.verificationErrors)
示例2: test
# 需要导入模块: from Utils import Config [as 别名]
# 或者: from Utils.Config import wait_for_element_visibility [as 别名]
def test(self):
driver = Config.get_driver()
facebook = None
mainWindow = driver.current_window_handle
self.verificationErrors = []
try: Config.wait_for_element_visibility(Config.singUp_FacebookButton, trys=10)
except :
if not Config.is_element_present(Config.settingsPane):
Config.find_element(Config.openSettings).click()
Config.find_element(Config.settings_profile).click()
Config.find_element(Config.profile_signOut).click()
Config.wait_for_element_visibility(Config.singUp_FacebookButton)
Config.find_element(Config.singUp_FacebookButton).click()
try:
facebook = driver.window_handles
facebook.remove(mainWindow)
driver.switch_to_window(facebook)
time.sleep(4)
Config.find_element([By.ID, "email"]).clear()
Config.find_element([By.ID, "email"]).send_keys("[email protected]")
Config.find_element([By.ID, "pass"]).clear()
Config.find_element([By.ID, "pass"]).send_keys("mobiitnow1")
Config.find_element([By.ID, "loginbutton"]).click()
except:
raise FacebookError
finally:
driver.switch_to_window(mainWindow)
Config.wait_for_element(Config.main_hayush, trys=10)
try: self.assertEqual("HI RELASE", Config.find_element(Config.main_hayush).text)
except AssertionError as e: self.verificationErrors.append(str(e))
try: Config.find_element(Config.profilePic).value_of_css_property("background-image").index("facebook")
except ValueError as e: self.verificationErrors.append(e)
示例3: test
# 需要导入模块: from Utils import Config [as 别名]
# 或者: from Utils.Config import wait_for_element_visibility [as 别名]
def test(self):
driver = Config.get_driver()
google = None
mainWindow = driver.current_window_handle
self.verificationErrors = []
try: Config.wait_for_element_visibility(Config.singUp_GooglePlusButton, trys=10)
except ElementNotVisibleException:
if not Config.is_element_present(Config.settingsPane):
Config.find_element(Config.openSettings).click()
Config.find_element(Config.settings_profile).click()
Config.find_element(Config.profile_signOut).click()
Config.wait_for_element_visibility(Config.singUp_GooglePlusButton)
Config.find_element(Config.signIn_alreadyMember).click()
Config.wait_for_element(Config.signIn_googlePlus)
Config.find_element(Config.signIn_googlePlus).click()
time.sleep(6)
try: self.assertFalse(Config.is_element_present(Config.signUp_skipWhatsNew))
except AssertionError as e: self.verificationErrors.append(str(e))
Config.wait_for_element(Config.main_hayush)
try: self.assertEqual("HI ANY", Config.find_element(Config.main_hayush).text)
except AssertionError as e: self.verificationErrors.append(str(e))
try: Config.find_element(Config.profilePic).value_of_css_property("background-image").index("google")
except ValueError as e: self.verificationErrors.append(e)
示例4: change_to_premium
# 需要导入模块: from Utils import Config [as 别名]
# 或者: from Utils.Config import wait_for_element_visibility [as 别名]
def change_to_premium(isPremium=False):
if isPremium == False: isPremium = "Free Account"
else: isPremium = "Premium Account"
Config.find_element(Config.openSettings).click()
time.sleep(1)
if Config.find_element(Config.settings_accountStatus).text == isPremium:
if isPremium == "Free Account": change_user("[email protected]")
else: change_user()
else:
Config.find_element(Config.overlay).click()
Config.wait_for_element_visibility(Config.overlay, visible=False)
示例5: test
# 需要导入模块: from Utils import Config [as 别名]
# 或者: from Utils.Config import wait_for_element_visibility [as 别名]
def test(self):
driver = Config.get_driver()
google = None
mainWindow = driver.current_window_handle
self.verificationErrors = []
try: Config.wait_for_element_visibility(Config.singUp_GooglePlusButton, trys=10)
except ElementNotVisibleException:
if not Config.is_element_present(Config.settingsPane):
Config.find_element(Config.openSettings).click()
Config.find_element(Config.settings_profile).click()
Config.find_element(Config.profile_signOut).click()
Config.wait_for_element_visibility(Config.singUp_GooglePlusButton)
Config.find_element(Config.singUp_GooglePlusButton).click()
try:
google = driver.window_handles
google.remove(mainWindow)
driver.switch_to_window(google)
Config.wait_for_element([By.ID, "Email"])
Config.find_element([By.ID, "Email"]).clear()
Config.find_element([By.ID, "Email"]).send_keys("[email protected]")
if Config.is_element_present([By.ID, "Passwd"]) == False:
Config.find_element([By.ID, "next"]).click()
Config.wait_for_element([By.CSS_SELECTOR, "input#Passwd"])
Config.find_element([By.CSS_SELECTOR, "input#Passwd"]).clear()
Config.find_element([By.CSS_SELECTOR, "input#Passwd"]).send_keys("mobiitnow")
Config.find_element([By.ID, "signIn"]).click()
time.sleep(3)
if Config.is_element_present([By.XPATH, "//button[@id=\"submit_approve_access\"]"]):
Config.wait_for_element([By.XPATH, "//button[@id=\"submit_approve_access\" and @disabled]"], present=False)
Config.find_element([By.ID, "submit_approve_access"]).click()
except NoSuchWindowException:
driver.switch_to_window(mainWindow)
except: self.verificationErrors.append("Google authentication error")
else: driver.switch_to_window(mainWindow)
try:
Config.wait_for_element([By.CSS_SELECTOR, "div#skip.textButton"])
Config.find_element([By.CSS_SELECTOR, "div#skip.textButton"]).click()
except: pass
Config.wait_for_element(Config.main_hayush)
try: self.assertEqual("HI ANY", Config.find_element(Config.main_hayush).text)
except AssertionError as e: self.verificationErrors.append(str(e))
try: Config.find_element(Config.profilePic).value_of_css_property("background-image").index("google")
except ValueError as e: self.verificationErrors.append(e)
示例6: test
# 需要导入模块: from Utils import Config [as 别名]
# 或者: from Utils.Config import wait_for_element_visibility [as 别名]
def test(self):
InitCase.init_case(menu="ALL", taskOption="subtasks")
self.verificationErrors = []
Config.find_element(Config.subtasks_check).click()
Config.wait_for_element_visibility(Config.subtasks_markDone)
Config.find_element(Config.subtasks_markDone).click()
#Check badge
try: self.assertEqual("0", Config.find_element(Config.task_badgeByIconName, "subtasks").get_attribute("data-badge"))
except AssertionError as e: self.verificationErrors.append(str(e))
#Check no subtasks present
try: self.assertFalse(Config.is_element_present(Config.subtask))
except AssertionError as e: self.verificationErrors.append(str(e))
self.assertEqual([], self.verificationErrors)
示例7: test
# 需要导入模块: from Utils import Config [as 别名]
# 或者: from Utils.Config import wait_for_element_visibility [as 别名]
def test(self):
InitCase.init_case(menu="ALL")
self.verificationErrors = []
ClearAllTasks.clear_all_tasks()
Config.find_element(Config.openSettings).click()
Config.wait_for_element(Config.settings_CompletedTasks)
Config.find_element(Config.settings_CompletedTasks).click()
Config.wait_for_element(Config.completedTask)
Config.find_element(Config.completedTasks_Delete).click()
Config.wait_for_element_visibility(Config.completedTask, visible=False)
Config.find_element(Config.overlay).click()
Config.wait_for_element_visibility(Config.overlay, visible=False)
self.assertEqual([], self.verificationErrors)
示例8: change_user
# 需要导入模块: from Utils import Config [as 别名]
# 或者: from Utils.Config import wait_for_element_visibility [as 别名]
def change_user(email=None):
if not Config.find_element(Config.signIn_alreadyMember).is_displayed():
if not Config.is_element_present(Config.settingsPane):
Config.find_element(Config.openSettings).click()
Config.find_element(Config.settings_profile).click()
Config.find_element(Config.profile_signOut).click()
Config.wait_for_element_visibility(Config.signIn_alreadyMember)
if email != None:
Config.find_element(Config.signIn_alreadyMember).click()
Config.wait_for_element_visibility(Config.signIn_inputEmail)
Config.find_element(Config.signIn_inputEmail).clear()
Config.find_element(Config.signIn_inputEmail).send_keys(email)
Config.find_element(Config.signIn_inputPass).clear()
Config.find_element(Config.signIn_inputPass).send_keys("123456")
Config.find_element(Config.signIn_button).click()
Config.wait_for_element(Config.main_AllTasks)
else:
s = Signup.SignUp("test")
email = s.test()
return email