コード例 #1
0
    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
0
    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
0
ファイル: DateView.py プロジェクト: eidan76/Web-Automation1
 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
0
    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
0
ファイル: ChangeUser.py プロジェクト: eidan76/Web-Automation1
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("*****@*****.**")
        else: change_user()

    else:
        Config.find_element(Config.overlay).click()
        Config.wait_for_element_visibility(Config.overlay, visible=False)
コード例 #6
0
    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
0
    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
0
ファイル: Edit.py プロジェクト: eidan76/Web-Automation1
    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
0
    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
0
ファイル: Unswipe.py プロジェクト: eidan76/Web-Automation1
    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
0
ファイル: SignIn.py プロジェクト: eidan76/Web-Automation1
    def test(self):
        self.verificationErrors = []
        ChangeUser.change_user("*****@*****.**")

        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, "*****@*****.**")
        except AssertionError as e: self.verificationErrors.append(e)
コード例 #12
0
ファイル: Swipe.py プロジェクト: eidan76/Web-Automation1
    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
0
ファイル: Delete.py プロジェクト: eidan76/Web-Automation1
    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
0
    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
0
ファイル: AddVideo.py プロジェクト: eidan76/Web-Automation1
    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)
コード例 #16
0
    def test(self):
        taskID = InitCase.init_case(menu="ALL", view="priority")
        self.verificationErrors = []

        ActionChains(Config.get_driver()).drag_and_drop(Config.find_element(Config.taskByID, taskID), Config.find_element(Config.list_sectionByName, "Normal")).perform()

        try: self.assertFalse(Config.is_element_present(Config.taskPriority))
        except AssertionError as e: self.verificationErrors.append(str(e))

        self.assertEqual([], self.verificationErrors)
コード例 #17
0
ファイル: CreateTask.py プロジェクト: eidan76/Web-Automation1
    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)
コード例 #18
0
ファイル: Add.py プロジェクト: eidan76/Web-Automation1
    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))
コード例 #19
0
ファイル: ChangeList.py プロジェクト: eidan76/Web-Automation1
    def test(self):
        InitCase.init_case(menu="ALL", taskOption="open")
        self.verificationErrors = []

        Config.find_element(Config.task_FolderSelector).click()
        x = Config.find_element(Config.task_ListSelectorItem).text
        Config.find_element(Config.task_ListSelectorItem).click()

        try: self.assertEqual(x, Config.find_element(Config.task_FolderSelector).text)
        except AssertionError as e: self.verificationErrors.append(str(e))

        Config.find_element(Config.task_closeButton).click()

        self.assertEqual([], self.verificationErrors)
コード例 #20
0
    def test(self):
        taskID = InitCase.init_case(menu="ALL", view="date", taskOption="open")
        self.verificationErrors = []


        Config.find_element(Config.task_TimeSelector).click()

        #Find what it the selected day in the date selector and select the date 2 days from then
        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
        selectDay = str(xDate.year) + "-" + str(xDate.month - 1) + "-" + str(xDate.day)

        Config.find_element(Config.cal_dayByDate, selectDay).click()
        Config.find_element(Config.cal_OK).click()

        Config.find_element(Config.task_closeButton).click()
        try: self.assertEqual(taskID, Config.find_element(Config.taskBySectionName, "Upcoming").get_attribute("data-task-id"))
        except AssertionError as e: self.verificationErrors.append(str(e))
        self.assertEqual([], self.verificationErrors)
コード例 #21
0
ファイル: MainGrid.py プロジェクト: eidan76/Web-Automation1
    def test(self):
        driver = Config.get_driver()
        InitCase.init_case(menu="MAIN")
        self.verificationErrors = []

        lists = Config.find_elements(Config.main_list)
        for l in lists:
            if l.get_attribute("id") in ["pre_all_tasks", "new"]: lists.remove(l)
        listsToAdd = range(4-len(lists))
        for lst in listsToAdd:
            Config.find_element(Config.main_newList).click()
            Config.find_element(Config.listTitleEdit).send_keys(str(lst))
            Config.find_element(Config.listTitleEdit).send_keys(Keys.ENTER)
            lists.append(Config.find_element(Config.main_listByName, str(lst)))

        allTasks = Config.find_element(Config.main_AllTasks)

        for i in range(3):
            ActionChains(Config.get_driver()).click_and_hold(random.choice(lists)).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)

        listPositions = {}
        for li in lists:
            listPositions[li.get_attribute("id")] = self.get_position(li)

        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="MAIN")
        window2Lists = Config.find_elements(Config.main_list)
        for ls in window2Lists:
            if ls.get_attribute("id") in ["pre_all_tasks", "new"]: window2Lists.remove(ls)

        for lt in window2Lists:
            try: self.assertEqual(self.get_position(lt), listPositions[lt.get_attribute("id")])
            except AssertionError as e: self.verificationErrors.append(e)
        driver.close()
        driver.switch_to_window(mainWindow)

        self.assertEqual([], self.verificationErrors)
コード例 #22
0
    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, "Shared").get_attribute("id")
        InitCase.init_case(menu=listID)
        self.verificationErrors = []

        Config.find_element(Config.taskCheck).click()
        time.sleep(1)
        try: self.assertEqual("checked", Config.find_element(Config.task).get_attribute("data-status"))
        except AssertionError as e: self.verificationErrors.append(str(e))
        Config.sync()

        ChangeUser.change_user(self.other_user())
        self.user = self.other_user()

        Config.find_element(Config.main_listByName, "Shared").click()
        try: self.assertEqual(Config.find_element(Config.task).get_attribute("data-status"), "checked")
        except AssertionError as e: self.verificationErrors.append(str(e))

        self.assertEqual([], self.verificationErrors)
コード例 #23
0
    def test(self):
        taskID = InitCase.init_case(menu="ALL", view="date")
        self.verificationErrors = []

        ActionChains(Config.get_driver()).drag_and_drop(Config.find_element(Config.taskByID, taskID), Config.find_element(Config.list_sectionByName, "Someday")).perform()
        Config.find_element(Config.taskTitleID, taskID).click()

        try: Config.find_element(Config.task_TimeSelector).text.index("Someday")
        except AssertionError as e: self.verificationErrors.append(str(e))

        Config.find_element(Config.task_closeButton).click()

        self.assertEqual([], self.verificationErrors)
コード例 #24
0
ファイル: EditNote.py プロジェクト: eidan76/Web-Automation1
    def test(self):
        InitCase.init_case(taskOption="note")
        self.verificationErrors = []
        noteText = "edit edit edit edit"
        Config.find_element(Config.note).clear()
        Config.find_element(Config.note).send_keys(noteText)

        try: self.assertEqual(" ", Config.find_element(Config.task_badgeByIconName, "note").get_attribute("data-badge"))
        except AssertionError as e: self.verificationErrors.append(str(e))

        Config.find_element(Config.task_closeButton).click()
        Config.wait_for_element(Config.task_closeButton, present=False)
        InitCase.task_options("note")

        time.sleep(1)
        try: self.assertEqual(noteText, Config.find_element(Config.note).text)
        except AssertionError as e: self.verificationErrors.append(str(e))
コード例 #25
0
    def test(self):
        InitCase.init_case(menu="MAIN")
        self.verificationErrors = []
        listID = NewList.listID

        ActionChains(Config.get_driver()).move_to_element(Config.find_element(Config.main_listByID, listID)).perform()
        time.sleep(1)

        Config.find_element(Config.main_listOptionsID, listID).click()
        Config.find_element(Config.main_listDeleteID, listID).click()
        time.sleep(1)
        Config.find_element(Config.listDeleteConfirm).click()
        try: self.assertFalse(Config.is_element_present(Config.main_listByID, listID))
        except AssertionError as e: self.verificationErrors.append(str(e))
        self.assertEqual([], self.verificationErrors)
コード例 #26
0
    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)
コード例 #27
0
ファイル: NewList.py プロジェクト: eidan76/Web-Automation1
    def test(self):
        InitCase.init_case(menu="MAIN")
        self.verificationErrors = []

        listName = "x"
        Config.find_element(Config.main_newList).click()
        Config.find_element(Config.listTitleEdit).send_keys(listName)
        Config.find_element(Config.listTitleEdit).send_keys(Keys.ENTER)

        try: Config.is_element_present(Config.main_listByName, listName)
        except AssertionError as e: self.verificationErrors.append(str(e))

        global listID
        listID = Config.find_element(Config.main_listByName, listName).get_attribute("id")

        self.assertEqual([], self.verificationErrors)
コード例 #28
0
ファイル: EditTitle.py プロジェクト: eidan76/Web-Automation1
    def test(self):
        InitCase.init_case(menu="ALL", taskNo=1, taskOption="open")
        self.verificationErrors = []

        Config.wait_for_element(Config.task_editTitle)

        Config.find_element(Config.task_editTitle).clear()
        Config.find_element(Config.task_editTitle).send_keys("edited")
        time.sleep(1)

        Config.find_element(Config.task_closeButton).click()
        Config.wait_for_element(Config.task_closeButton, present=False)

        try: self.assertEqual("edited", Config.find_element(Config.taskTitle).text)
        except AssertionError as e: self.verificationErrors.append(str(e))

        self.assertEqual([], self.verificationErrors)
コード例 #29
0
    def test(self, listID = None):
        self.verificationErrors = []
        if listID is None:
            listID = NewList.listID
        InitCase.init_case(menu=listID, taskNo=None)

        Config.find_element(Config.menuButton).click()
        Config.find_element(Config.menu_deleteList).click()
        time.sleep(1)
        Config.find_element(Config.listDeleteConfirm).click()
        time.sleep(2)
        try: self.assertFalse(Config.is_element_present(Config.main_listByID, listID))
        except AssertionError as e: self.verificationErrors.append(str(e))
        self.assertEqual([], self.verificationErrors)
コード例 #30
0
ファイル: AddNote.py プロジェクト: eidan76/Web-Automation1
    def test(self):
        InitCase.init_case(menu="ALL", taskOption="note")
        self.verificationErrors = []
        noteText = "test test test test test test test test test test test test test test test test test test test test test test "
        Config.find_element(Config.note).send_keys(noteText)

        try: self.assertEqual(" ", Config.find_element(Config.task_badgeByIconName, "note").get_attribute("data-badge"))
        except AssertionError as e: self.verificationErrors.append(str(e))

        Config.find_element(Config.task_closeButton).click()
        InitCase.task_options("note")

        try: self.assertEqual(noteText, Config.find_element(Config.note).text)
        except AssertionError as e: self.verificationErrors.append(str(e))