本文整理汇总了Python中Utils.InitCase.init_case方法的典型用法代码示例。如果您正苦于以下问题:Python InitCase.init_case方法的具体用法?Python InitCase.init_case怎么用?Python InitCase.init_case使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Utils.InitCase
的用法示例。
在下文中一共展示了InitCase.init_case方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test
# 需要导入模块: from Utils import InitCase [as 别名]
# 或者: from Utils.InitCase import init_case [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)
示例2: test
# 需要导入模块: from Utils import InitCase [as 别名]
# 或者: from Utils.InitCase import init_case [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)
示例3: test
# 需要导入模块: from Utils import InitCase [as 别名]
# 或者: from Utils.InitCase import init_case [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)
示例4: test
# 需要导入模块: from Utils import InitCase [as 别名]
# 或者: from Utils.InitCase import init_case [as 别名]
def test(self):
self.verificationErrors = []
Config.find_element(Config.openSettings).click()
time.sleep(1)
self.user = Config.find_element(Config.settings_email).text
InitCase.init_case(menu="ALL", view="date", taskOption="share")
Config.find_element(Config.sharing_commentInput).clear()
Config.find_element(Config.sharing_commentInput).send_keys("comment test")
Config.find_element(Config.sharing_addCommentButton).click()
Config.sync()
ChangeUser.change_user(self.other_user())
self.user = self.other_user()
InitCase.init_case(menu="ALL", taskOption="share")
try: self.assertEqual(Config.find_element(Config.sharing_commentAuthor).text + "@any.do", self.other_user())
except AssertionError as e: self.verificationErrors.append(e)
try: self.assertEqual(Config.find_element(Config.sharing_commentText).text, "comment test")
except AssertionError as e: self.verificationErrors.append(e)
self.assertEqual([], self.verificationErrors)
示例5: test
# 需要导入模块: from Utils import InitCase [as 别名]
# 或者: from Utils.InitCase import init_case [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)
示例6: test
# 需要导入模块: from Utils import InitCase [as 别名]
# 或者: from Utils.InitCase import init_case [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_CompletedTasks)
Config.find_element(Config.settings_CompletedTasks).click()
Config.wait_for_element(Config.completedTask)
Config.find_element(Config.completedTasks_Restore).click()
for i in range(5):
try:
if "No Completed tasks yet" == Config.find_element(Config.completedTasks_BackgroundText).text: break
except: pass
time.sleep(1)
else: self.fail("time out")
Config.find_element(Config.overlay).click()
Config.sync()
Config.wait_for_element(Config.taskTitle)
try: self.assertEqual("edited", Config.find_element(Config.taskTitle).text)
except AssertionError as e: self.verificationErrors.append(str(e))
try: self.assertEqual("unchecked", Config.find_element(Config.task).get_attribute("data-status"))
except AssertionError as e: self.verificationErrors.append(str(e))
self.assertEqual([], self.verificationErrors)
示例7: test
# 需要导入模块: from Utils import InitCase [as 别名]
# 或者: from Utils.InitCase import init_case [as 别名]
def test(self):
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, "PERSONAL ERRANDS").get_attribute("id")
SharedListID = Config.find_element(Config.main_listByName, "Shared").get_attribute("id")
InitCase.init_case(menu=listID, taskNo=1, taskOption="open")
self.verificationErrors = []
Config.find_element(Config.task_FolderSelector).click()
Config.find_element(Config.task_ListSelectorItemByID, SharedListID).click()
Config.find_element(Config.confirmDialog_OK).click()
Config.find_element(Config.task_closeButton).click()
Config.sync()
ChangeUser.change_user(self.other_user())
self.user = self.other_user()
Config.find_element(Config.main_listByName, "Shared").click()
try: self.assertTrue(Config.is_element_present(Config.task))
except AssertionError as e: self.verificationErrors.append(str(e))
self.assertEqual([], self.verificationErrors)
示例8: test
# 需要导入模块: from Utils import InitCase [as 别名]
# 或者: from Utils.InitCase import init_case [as 别名]
def test(self):
InitCase.init_case(menu="ALL", taskNo=0)
self.verificationErrors = []
taskID = CreateTaskF.create_a_task("Someday", "Someday")
Config.find_element(Config.taskTitle).click()
Config.find_element(Config.task_recurrence).click()
Config.find_element(Config.recurrenceByType, "DAY").click()
Config.find_element(Config.recurrence_ok).click()
Config.find_element(Config.task_closeButton).click()
time.sleep(1)
try: self.assertTrue(Config.is_element_present(Config.taskBySectionName, "Today"))
except AssertionError as e: self.verificationErrors.append(str(e))
Config.find_element(Config.taskCheck).click()
Config.wait_for_element(Config.taskBySectionName, "Tomorrow")
taskList = Config.find_elements(Config.task)
taskList.remove(Config.find_element(Config.taskByID, taskID))
try: self.assertTrue(Config.is_element_present(Config.taskBySectionName, "Tomorrow"))
except AssertionError as e: self.verificationErrors.append(str(e))
try: self.assertTrue(Config.find_element(Config.taskRecurringByID, taskList[0].get_attribute("data-task-id")).is_displayed())
except AssertionError as e: self.verificationErrors.append(str(e))
self.assertEqual([], self.verificationErrors)
示例9: test
# 需要导入模块: from Utils import InitCase [as 别名]
# 或者: from Utils.InitCase import init_case [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)
示例10: test
# 需要导入模块: from Utils import InitCase [as 别名]
# 或者: from Utils.InitCase import init_case [as 别名]
def test(self):
InitCase.init_case(menu="ALL", view="priority", taskNo=0)
self.verificationErrors = []
CreateTaskF.create_a_task("priHigh", "High")
try: self.assertTrue(Config.is_element_present(Config.taskPriority))
except AssertionError as e: self.verificationErrors.append(str(e))
self.assertEqual([], self.verificationErrors)
示例11: test
# 需要导入模块: from Utils import InitCase [as 别名]
# 或者: from Utils.InitCase import init_case [as 别名]
def test(self):
InitCase.init_case(menu="ALL", taskNo=0)
self.verificationErrors = []
try: self.assertFalse(Config.is_element_present(Config.task))
except AssertionError as e: self.verificationErrors.append(str(e))
self.assertEqual([], self.verificationErrors)
示例12: test
# 需要导入模块: from Utils import InitCase [as 别名]
# 或者: from Utils.InitCase import init_case [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))
示例13: test
# 需要导入模块: from Utils import InitCase [as 别名]
# 或者: from Utils.InitCase import init_case [as 别名]
def test(self):
InitCase.init_case(menu="ALL", view="date", taskNo=0)
self.verificationErrors = []
global taskID
taskID = CreateTaskF.create_a_task("test", "Today")
try: self.assertEqual("test", Config.find_element(Config.taskTitleID, taskID).text)
except AssertionError as e: self.verificationErrors.append(str(e))
# after test case is complete, all the 'verify' commands that have failed are raised
self.assertEqual([], self.verificationErrors)
示例14: test
# 需要导入模块: from Utils import InitCase [as 别名]
# 或者: from Utils.InitCase import init_case [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)
示例15: test
# 需要导入模块: from Utils import InitCase [as 别名]
# 或者: from Utils.InitCase import init_case [as 别名]
def test(self):
InitCase.init_case(menu="ALL", taskOption="subtasks")
self.verificationErrors = []
Config.find_element(Config.subtasks_newTitle).clear()
Config.find_element(Config.subtasks_newTitle).send_keys("subtask")
Config.find_element(Config.subtasks_plusButton).click()
#Check subtasks badge = 1
try: self.assertEqual("1", Config.find_element(Config.task_badgeByIconName, "subtasks").get_attribute("data-badge"))
except AssertionError as e: self.verificationErrors.append(str(e))
try: self.assertEqual("subtask", Config.find_element(Config.subtasks_title).text)
except AssertionError as e: self.verificationErrors.append(str(e))