本文整理汇总了Python中Utils.Config.find_element方法的典型用法代码示例。如果您正苦于以下问题:Python Config.find_element方法的具体用法?Python Config.find_element怎么用?Python Config.find_element使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Utils.Config
的用法示例。
在下文中一共展示了Config.find_element方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test
# 需要导入模块: from Utils import Config [as 别名]
# 或者: from Utils.Config import find_element [as 别名]
def test(self):
self.verificationErrors = []
Config.find_element(Config.openSettings).click()
time.sleep(1)
user = Config.find_element(Config.settings_email).text
InitCase.init_case(menu="ALL", view="date")
sender = Config.get_sender()
receiver = Config.get_receiver()
sections = ["Tomorrow", "Upcoming", "Someday"]
for i in range(3):
sec = random.choice(sections)
ActionChains(Config.get_driver()).drag_and_drop(Config.find_element(Config.task), Config.find_element(Config.list_sectionByName, sec)).perform()
sections.remove(sec)
Config.sync()
if user == receiver: user = sender
else: user = receiver
ChangeUser.change_user(user)
InitCase.init_case(menu="ALL", view="date")
try: self.assertTrue(Config.is_element_present(Config.taskBySectionName, sec))
except AssertionError as e: self.verificationErrors.append(str(e))
self.assertEqual([], self.verificationErrors)
示例2: test
# 需要导入模块: from Utils import Config [as 别名]
# 或者: from Utils.Config import find_element [as 别名]
def test(self):
InitCase.init_case(menu="MAIN")
self.verificationErrors = []
listID = NewList.listID
list = Config.find_element(Config.main_listByID, listID)
allTasks = Config.find_element(Config.main_AllTasks)
#~Drag and Drop~
ActionChains(Config.get_driver()).click_and_hold(list).perform()
time.sleep(0.5)
ActionChains(Config.get_driver()).move_to_element_with_offset(allTasks, 238, 0).perform()
time.sleep(0.5)
ActionChains(Config.get_driver()).release().perform()
time.sleep(1)
style = list.get_attribute("style")
left = style.find("left: ") + 6
position = ""
for i in range(3):
position = position + style[left]
left = left + 1
try: self.assertEqual("238", position)
except AssertionError as e: self.verificationErrors.append(str(e))
self.assertEqual([], self.verificationErrors)
示例3: select_day
# 需要导入模块: from Utils import Config [as 别名]
# 或者: from Utils.Config import find_element [as 别名]
def select_day(self, today):
Config.find_element(Config.cal_selectedDay).get_attribute("data-full")
today = today.split("-")
today = datetime.date(int(today[0]), int(today[1]) + 1, int(today[2]))
x = datetime.timedelta(2)
xDate = today + x
return str(xDate.year) + "-" + str(xDate.month - 1) + "-" + str(xDate.day)
示例4: test
# 需要导入模块: from Utils import Config [as 别名]
# 或者: from Utils.Config import find_element [as 别名]
def test(self):
driver = Config.get_driver()
self.verificationErrors = []
listID = Config.find_element(Config.main_listByName, "POS").get_attribute("id")
taskIDs = InitCase.init_case(menu=listID, view="clean", taskNo=5)
for i in range(3):
n = Config.find_element(Config.taskTitleID, random.choice(taskIDs))
ActionChains(driver).drag_and_drop_by_offset(n, 0, 90).perform()
newOrder = Config.find_elements(Config.task)
newOrderIDs = []
for t in newOrder:
newOrderIDs.append(t.get_attribute("data-task-id"))
mainWindow = driver.current_window_handle
driver.execute_script("$(window.open())")
window2 = driver.window_handles
window2.remove(mainWindow)
driver.switch_to_window(window2)
driver.get(Config.get_base_url())
InitCase.init_case(menu="ALL", view="clean", taskNo=5)
platform2Order = Config.find_elements(Config.task)
for t in range(len(platform2Order)):
try: self.assertEqual(platform2Order[t].get_attribute("data-task-id"), newOrderIDs[t])
except AssertionError as e: self.verificationErrors.append(str(e))
driver.close()
driver.switch_to_window(mainWindow)
示例5: change_to_premium
# 需要导入模块: from Utils import Config [as 别名]
# 或者: from Utils.Config import find_element [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)
示例6: test
# 需要导入模块: from Utils import Config [as 别名]
# 或者: from Utils.Config import find_element [as 别名]
def test(self):
taskID = InitCase.init_case(menu="ALL", view="priority", taskOption="open")
self.verificationErrors = []
Config.wait_for_element(Config.task_PrioritySelector)
Config.find_element(Config.task_PrioritySelector).click()
time.sleep(2)
Config.find_element(Config.task_closeButton).click()
Config.wait_for_element(Config.task_closeButton, present=False)
try: self.assertEqual(Config.find_element(Config.taskBySectionName, "High").get_attribute("data-task-id"),taskID)
except AssertionError as e: self.verificationErrors.append(str(e))
self.assertEqual([], self.verificationErrors)
示例7: test
# 需要导入模块: from Utils import Config [as 别名]
# 或者: from Utils.Config import find_element [as 别名]
def test(self):
InitCase.init_case(menu="ALL", taskOption="open")
self.verificationErrors = []
Config.wait_for_element(Config.task_PrioritySelector)
Config.find_element(Config.task_PrioritySelector).click()
time.sleep(2)
Config.find_element(Config.task_closeButton).click()
Config.wait_for_element(Config.task_closeButton, present=False)
try: self.assertTrue(Config.is_element_present(Config.taskPriority))
except AssertionError as e: self.verificationErrors.append(str(e))
self.assertEqual([], self.verificationErrors)
示例8: test
# 需要导入模块: from Utils import Config [as 别名]
# 或者: from Utils.Config import find_element [as 别名]
def test(self):
InitCase.init_case(menu="ALL", taskOption="subtasks")
self.verificationErrors = []
Config.find_element(Config.subtasks_title).click()
Config.find_element(Config.subtasks_title).clear()
Config.find_element(Config.subtasks_title).send_keys("edited")
Config.find_element(Config.task_badgeByIconName, "subtasks").click()
try: self.assertEqual("edited", Config.find_element(Config.subtasks_title).text)
except AssertionError as e: self.verificationErrors.append(str(e))
示例9: test
# 需要导入模块: from Utils import Config [as 别名]
# 或者: from Utils.Config import find_element [as 别名]
def test(self):
InitCase.init_case(menu="ALL", taskOption="files")
self.verificationErrors = []
Config.find_element(Config.files_delete).click()
Config.find_element(Config.files_deleteConfirm).click()
time.sleep(3)
try: self.assertFalse(Config.is_element_present(Config.fileByName, "audio.m4a"))
except AssertionError as e: self.verificationErrors.append(str(e))
#Check files badge = 0
try: self.assertEqual("0", Config.find_element(Config.task_badgeByIconName, "files").get_attribute("data-badge"))
except AssertionError as e: self.verificationErrors.append(str(e))
self.assertEqual([], self.verificationErrors)
示例10: test
# 需要导入模块: from Utils import Config [as 别名]
# 或者: from Utils.Config import find_element [as 别名]
def test(self):
InitCase.init_case(menu="ALL", taskOption="subtasks")
self.verificationErrors = []
Config.find_element(Config.subtasks_title).click()
time.sleep(1)
#Check badge
try: self.assertEqual("1", Config.find_element(Config.task_badgeByIconName, "subtasks").get_attribute("data-badge"))
except AssertionError as e: self.verificationErrors.append(str(e))
#Check task status
try: self.assertEqual("unchecked", Config.find_element(Config.subtask).get_attribute("data-status"))
except AssertionError as e: self.verificationErrors.append(str(e))
self.assertEqual([], self.verificationErrors)
示例11: test
# 需要导入模块: from Utils import Config [as 别名]
# 或者: from Utils.Config import find_element [as 别名]
def test(self):
self.verificationErrors = []
ChangeUser.change_user("[email protected]")
time.sleep(5)
try: self.assertFalse(Config.is_element_present(Config.signUp_start))
except AssertionError as e: self.verificationErrors.append(e)
Config.wait_for_element(Config.main_hayush)
try: self.assertEqual(Config.find_element(Config.main_hayush).text, "HI AUTLOGIN")
except AssertionError as e: self.verificationErrors.append(e)
Config.find_element(Config.openSettings).click()
time.sleep(1)
try: self.assertEqual(Config.find_element(Config.settings_email).text, "[email protected]")
except AssertionError as e: self.verificationErrors.append(e)
示例12: test
# 需要导入模块: from Utils import Config [as 别名]
# 或者: from Utils.Config import find_element [as 别名]
def test(self):
InitCase.init_case(menu="ALL", taskOption="subtasks")
self.verificationErrors = []
ActionChains(Config.get_driver()).move_to_element(Config.find_element(Config.subtask)).perform()
time.sleep(1)
Config.find_element(Config.subtasks_check).click()
time.sleep(1)
#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 task status
try: self.assertEqual("checked", Config.find_element(Config.subtask).get_attribute("data-status"))
except AssertionError as e: self.verificationErrors.append(str(e))
self.assertEqual([], self.verificationErrors)
示例13: test
# 需要导入模块: from Utils import Config [as 别名]
# 或者: from Utils.Config import find_element [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)
示例14: test
# 需要导入模块: from Utils import Config [as 别名]
# 或者: from Utils.Config import find_element [as 别名]
def test(self):
self.verificationErrors = []
Config.find_element(Config.openSettings).click()
time.sleep(1)
self.user = Config.find_element(Config.settings_email).text
listID = Config.find_element(Config.main_listByName, "Shared").get_attribute("id")
InitCase.init_case(menu=listID, taskNo=1)
CreateLoadedTask.create_loaded_task()
Config.sync()
ChangeUser.change_user(self.other_user())
self.user = self.other_user()
InitCase.init_case(menu="ALL", taskOption="subtasks")
try: self.assertEqual("subtask", Config.find_element(Config.subtasks_title).text)
except AssertionError as e: self.verificationErrors.append(str(e))
InitCase.task_options("note")
try: self.assertTrue(len(Config.find_element(Config.note).text) != 0)
except AssertionError as e: self.verificationErrors.append(str(e))
InitCase.task_options("files")
try: self.assertEqual("2015-03-29.png", Config.find_element(Config.files_name).text)
except AssertionError as e: self.verificationErrors.append(str(e))
try: self.assertTrue(Config.is_element_present(Config.files_thumbnailByType, "image"))
except AssertionError as e: self.verificationErrors.append(str(e))
InitCase.close_task()
try: self.assertTrue(Config.is_element_present(Config.taskPriority))
except AssertionError as e: self.verificationErrors.append(str(e))
self.assertEqual([], self.verificationErrors)
示例15: test
# 需要导入模块: from Utils import Config [as 别名]
# 或者: from Utils.Config import find_element [as 别名]
def test(self):
InitCase.init_case(menu="ALL", taskOption="files")
self.verificationErrors = []
Config.find_element(Config.files_addFromComputer).send_keys("C:\\Users\\Eidan Wasser\\PycharmProjects\\Suite1\\Files\\vid.mp4")
Config.wait_for_element(Config.files_progressBar, present=False)
try: self.assertEqual("vid.mp4", Config.find_element(Config.files_name).text)
except AssertionError as e: self.verificationErrors.append(str(e))
try: self.assertTrue(Config.is_element_present(Config.files_thumbnailByType, "video"))
except AssertionError as e: self.verificationErrors.append(str(e))
#Check files badge = 1
try: self.assertEqual("1", Config.find_element(Config.task_badgeByIconName, "files").get_attribute("data-badge"))
except AssertionError as e: self.verificationErrors.append(str(e))
self.assertEqual([], self.verificationErrors)