def test(self):
        d = datetime.datetime.now()
        ChangeUser.change_to_premium()
        taskID = InitCase.init_case(menu="ALL", taskOption="open", taskNo=1)
        self.verificationErrors = []

        Config.find_element(Config.task_recurrence).click()
        Config.find_element(Config.recurrenceByType, "MONTH").click()
        Config.find_element(Config.recurrence_monthlyDayOfWeek).click()
        Config.find_element(Config.recurrence_ok).click()
        Config.find_element(Config.task_closeButton).click()
        time.sleep(1)
        Config.find_element(Config.taskCheck).click()
        Config.wait_for_element(Config.taskBySectionName, "Upcoming")

        taskList = Config.find_elements(Config.task)
        taskList.remove(Config.find_element(Config.taskByID, taskID))

        try: self.assertTrue(Config.is_element_present(Config.taskBySectionName, "Upcoming"))
        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))

        Config.find_element(Config.taskTitleBySectionName, "Upcoming").click()

        try: self.assertEqual("Once a month, on the " + self.month_by_day(d), Config.find_element(Config.task_recurrenceLabel).text)
        except AssertionError as e: self.verificationErrors.append(str(e))

        try: Config.find_element(Config.task_TimeSelector).text.index(self.next_month_by_day(d))
        except ValueError as e: self.verificationErrors.append(str(e))

        self.assertEqual([], self.verificationErrors)
    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)
    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)
Beispiel #4
0
    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("*****@*****.**")
            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)
Beispiel #5
0
    def test(self):
        d = datetime.datetime.now()
        dy = d.year + 1
        y = datetime.datetime(dy, d.month, d.day).strftime("%A %m.%d").replace("0","")

        taskID = InitCase.init_case(menu="ALL", taskOption="open", taskNo=1)
        self.verificationErrors = []

        Config.find_element(Config.task_recurrence).click()
        Config.find_element(Config.recurrenceByType, "YEAR").click()
        Config.find_element(Config.recurrence_ok).click()
        Config.find_element(Config.task_closeButton).click()
        time.sleep(1)
        Config.find_element(Config.taskCheck).click()
        Config.wait_for_element(Config.taskBySectionName, "Upcoming")
        taskList = Config.find_elements(Config.task)
        taskList.remove(Config.find_element(Config.taskByID, taskID))

        try: self.assertTrue(Config.is_element_present(Config.taskBySectionName, "Upcoming"))
        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))

        Config.find_element(Config.taskTitleBySectionName, "Upcoming").click()

        try: self.assertEqual("Once a year", Config.find_element(Config.task_recurrenceLabel).text)
        except AssertionError as e: self.verificationErrors.append(str(e))

        try: Config.find_element(Config.task_TimeSelector).text.index(y)
        except IndexError as e: self.verificationErrors.append(str(e))

        self.assertEqual([], self.verificationErrors)
    def test(self):
        d = datetime.datetime.now()
        wx = d.strftime("%a").upper()
        days = ["SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"]
        selectedDays = []
        for i in range(3):
            x = random.choice(days)
            selectedDays.append(x)
            days.remove(x)

        ChangeUser.change_to_premium()
        taskID = InitCase.init_case(menu="ALL", taskOption="open", taskNo=1)
        self.verificationErrors = []

        Config.find_element(Config.task_recurrence).click()
        Config.find_element(Config.recurrenceByType, "WEEK").click()

        for day in selectedDays:
            Config.find_element(Config.recurrence_weekdayByName, day).click()

        selectedRep = []
        for sel in Config.find_elements(Config.recurrence_selectedDays):
            selectedRep.append(sel.get_attribute("data-id"))

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

        for p in range(len(selectedRep)):
            wday = selectedRep[p]

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

            Config.find_element(Config.taskCheckByStatus, "unchecked").click()

            for i in range(20):
                try:
                    if len(Config.find_elements(Config.taskBySectionName, "Upcoming\" or @data-category=\"Tomorrow")) == p+1: break
                except: pass
                time.sleep(1)
            else: raise NoSuchElementException

            try: self.assertTrue(Config.is_element_present(Config.taskBySectionName, "Upcoming\" or @data-category=\"Tomorrow"))
            except AssertionError as e: self.verificationErrors.append(str(e))

            try: self.assertTrue(Config.find_element(Config.taskRecurringByStatus, "unchecked").is_displayed())
            except AssertionError as e: self.verificationErrors.append(str(e))

            Config.find_element(Config.taskTitleByStatus, "unchecked").click()

            try: Config.find_element(Config.task_recurrenceLabel).text.index(wday.capitalize())
            except ValueError as e: self.verificationErrors.append(str(e))

            try: Config.find_element(Config.task_TimeSelector).text.index(self.next_weekday(selectedRep, p))
            except ValueError as e: self.verificationErrors.append(str(e))

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

        self.assertEqual([], self.verificationErrors)
Beispiel #7
0
    def test(self):
        d = datetime.datetime.now()
        X = random.choice(range(1,10))
        Y = random.choice(range(1,4))

        ChangeUser.change_to_premium()
        taskID = InitCase.init_case(menu="ALL", taskOption="open", taskNo=1)
        self.verificationErrors = []

        Config.find_element(Config.task_recurrence).click()
        Config.find_element(Config.recurrenceByType, "DAY").click()

        for t in range(X): Config.find_element(Config.recurrence_everyXPlus).click()
        Config.find_element(Config.recurrence_endsAfter).click()
        for q in range(Y): Config.find_element(Config.recurrence_endsAfterYPlus).click()

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

        for h in range(Y):
            d = d + datetime.timedelta(X+1)
            dText = d.strftime("%A %m.%d").replace("0","")

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

            Config.find_element(Config.taskCheckByStatus, "unchecked").click()

            for i in range(20):
                try:
                    if len(Config.find_elements(Config.taskBySectionName, "Upcoming")) == h+1: break
                except: pass
                time.sleep(1)
            else: raise NoSuchElementException

            try: self.assertTrue(Config.is_element_present(Config.taskBySectionName, "Upcoming"))
            except AssertionError as e: self.verificationErrors.append(str(e))

            try: self.assertTrue(Config.find_element(Config.taskRecurringByStatus, "unchecked").is_displayed())
            except AssertionError as e: self.verificationErrors.append(str(e))

            Config.find_element(Config.taskTitleByStatus, "unchecked").click()

            try: self.assertEqual(Config.find_element(Config.task_recurrenceLabel).text, "Every " + str(X+1) + " days, Ends after " + str(Y+1) + " times")
            except AssertionError as e: self.verificationErrors.append(str(e))

            try: Config.find_element(Config.task_TimeSelector).text.index(dText)
            except ValueError as e: self.verificationErrors.append(str(e))

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

        Config.find_element(Config.taskCheckByStatus, "unchecked").click()
        time.sleep(3)

        try: self.assertEqual(len(Config.find_elements(Config.task)), Y+1)
        except AssertionError as e: self.verificationErrors.append(str(e))

        self.assertEqual([], self.verificationErrors)
    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)
    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)
    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)
Beispiel #11
0
    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)
Beispiel #12
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="date", 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()

        Config.find_element(Config.taskTitleID, random.choice(taskIDs)).click()
        Config.wait_for_element(Config.task_TimeSelector)
        Config.find_element(Config.task_TimeSelector).click()

        selectDay = self.select_day(Config.find_element(Config.cal_selectedDay).get_attribute("data-full"))
        Config.find_element(Config.cal_dayByDate, selectDay).click()
        Config.find_element(Config.cal_OK).click()

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

        ActionChains(driver).drag_and_drop(Config.find_element(Config.taskTitleBySectionName, "Today"), Config.find_element(Config.list_sectionByName, "Upcoming")).perform()

        InitCase.select_view("clean")
        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=listID, 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)
Beispiel #13
0
    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("*****@*****.**")
            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)
Beispiel #14
0
    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)
Beispiel #15
0
    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))
Beispiel #16
0
    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)
    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)
Beispiel #18
0
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
Beispiel #19
0
    def test(self):
        self.verificationErrors = []
        date = str(time.time())
        Config.wait_for_element(Config.signUp_emailButton)

        Config.find_element(Config.signUp_emailButton).click()
        Config.wait_for_element(Config.signUp_inputName)
        Config.find_element(Config.signUp_inputName).clear()
        Config.find_element(Config.signUp_inputName).send_keys(date)
        Config.find_element(Config.signUp_inputEmail).clear()
        Config.find_element(Config.signUp_inputEmail).send_keys(date, "@any.do")
        Config.find_element(Config.signUp_inputPass).clear()
        Config.find_element(Config.signUp_inputPass).send_keys("123456")
        Config.find_element(Config.signUp_RegisterButton).click()
        time.sleep(1)

        self.assertEqual("", Config.find_element(Config.signUp_ErrorMessage).text)
        Config.wait_for_element(Config.signUp_start)
        Config.find_element(Config.signUp_start).click()

        try: self.assertEqual("HI " + date, Config.find_element(Config.main_hayush).text)
        except AssertionError as e: self.verificationErrors.append(str(e))

        #return user email
        return date + "@any.do"

        # after test case is complete, all the 'verify' commands that have failed are raised
        self.assertEqual([], self.verificationErrors)
    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)
Beispiel #21
0
    def test(self):
        d = datetime.datetime.now()
        dw = d + datetime.timedelta(7)
        w = dw.strftime("%A %m.%d")
        n=""
        for i in range(len(w)):
            if w[i] != "0":
                n = n + w[i]

        taskID = InitCase.init_case(menu="ALL", taskOption="open", taskNo=1)
        self.verificationErrors = []

        Config.find_element(Config.task_recurrence).click()
        Config.find_element(Config.recurrenceByType, "WEEK").click()
        Config.find_element(Config.recurrence_ok).click()
        Config.find_element(Config.task_closeButton).click()
        time.sleep(1)
        Config.find_element(Config.taskCheck).click()
        Config.wait_for_element(Config.taskBySectionName, "Upcoming")

        taskList = Config.find_elements(Config.task)
        taskList.remove(Config.find_element(Config.taskByID, taskID))

        try: self.assertTrue(Config.is_element_present(Config.taskBySectionName, "Upcoming"))
        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))

        Config.find_element(Config.taskTitleBySectionName, "Upcoming").click()

        try: self.assertEqual("Once a week, on " + d.strftime("%A"), Config.find_element(Config.task_recurrenceLabel).text)
        except AssertionError as e: self.verificationErrors.append(str(e))

        try: Config.find_element(Config.task_TimeSelector).text.index(n)
        except IndexError as e: self.verificationErrors.append(str(e))

        self.assertEqual([], self.verificationErrors)
Beispiel #22
0
    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", taskNo=0)
        InitCase.init_case(menu="ALL", view="date", taskOption="share")
        Config.find_element(Config.sharing_inputEmail).clear()
        Config.find_element(Config.sharing_inputEmail).send_keys(self.other_user())
        Config.wait_for_element(Config.sharing_inputEmailDone)
        time.sleep(1)
        Config.find_element(Config.sharing_commitEmailButton).click()
        Config.wait_for_element(Config.sharing_sendInvites)
        Config.find_element(Config.sharing_sendInvites).click()
        Config.wait_for_element(Config.sharing_inviteOverlay, present=False)

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

        Config.wait_for_element(Config.sharingInvitation)

        try: self.assertEqual(Config.find_element(Config.sharingInvitation_title).text, "SHARED TASK")
        except AssertionError as e: self.verificationErrors.append(str(e))

        Config.find_element(Config.sharingInvitation_decline).click()
        Config.sync()
        InitCase.select_menu("ALL")

        try: self.assertFalse(Config.find_element(Config.taskShare).is_displayed())
        except AssertionError as e: self.verificationErrors.append(str(e))

        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_memberBadgeByEmail, self.other_user()).get_attribute("data-status"), "REJECTED")
        except AssertionError as e: self.verificationErrors.append(e)

        Config.find_element(Config.sharing_memberBadgeByEmail, self.other_user()).click()
        ActionChains(Config.get_driver()).move_to_element(Config.find_element(Config.sharing_memberPopup)).perform()

        try: self.assertEqual(Config.find_element(Config.sharing_badgeStatus).text, "Rejected Invitation")
        except AssertionError as e: self.verificationErrors.append(e)

        self.assertEqual([], self.verificationErrors)
Beispiel #23
0
    def test(self):
        InitCase.init_case(menu="ALL", taskOption="files")
        driver = Config.get_driver()
        mainWindow = driver.current_window_handle
        self.verificationErrors = []

        Config.find_element(Config.files_dropbox).click()
        try:
            dropbox = driver.window_handles
            dropbox.remove(mainWindow)
            driver.switch_to_window(dropbox)

            Config.find_element([By.XPATH, "//input[@name='login_email']"]).clear()
            Config.find_element([By.XPATH, "//input[@name='login_email']"]).send_keys("*****@*****.**")
            Config.find_element([By.XPATH, "//input[@name='login_password']"]).clear()
            Config.find_element([By.XPATH, "//input[@name='login_password']"]).send_keys("itayoni")
            Config.find_element([By.CSS_SELECTOR, "button.login-button.button-primary"]).click()

            Config.wait_for_element([By.CSS_SELECTOR, "div.dropbox-personal"])
            Config.find_element([By.CSS_SELECTOR, "div.dropbox-personal"]).click()
            Config.wait_for_element([By.XPATH, "//ul[@id='browse-file-list-personal']/li[@data-fqpath=\"/Users\"]"])
            Config.find_element([By.XPATH, "//ul[@id='browse-file-list-personal']/li[@data-fqpath=\"/Users\"]"]).click()
            Config.wait_for_element([By.XPATH, "//ul[@id='browse-file-list-personal']/li[@data-fqpath=\"/Users/Selenium\"]"])
            Config.find_element([By.XPATH, "//ul[@id='browse-file-list-personal']/li[@data-fqpath=\"/Users/Selenium\"]"]).click()
            Config.wait_for_element([By.XPATH, "//ul[@id='browse-file-list-personal']/li[@data-fqpath=\"/Users/Selenium/pic.png\"]"])
            Config.find_element([By.XPATH, "//ul[@id='browse-file-list-personal']/li[@data-fqpath=\"/Users/Selenium/pic.png\"]"]).click()
            Config.find_element([By.ID, "select-btn"]).click()
        except:
            raise DropboxError
        finally:
            driver.switch_to.window(mainWindow)

        try: self.assertEqual("pic.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))

        #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)

        #delete the file
        Config.find_element(Config.files_delete).click()
        Config.find_element(Config.files_deleteConfirm).click()
        time.sleep(3)
Beispiel #24
0
    def test(self):
        InitCase.init_case(menu="ALL", view="date", taskNo=0)
        self.verificationErrors = []

        #Create task in tomorrow then change date to today from quick add
        Config.find_element(Config.list_addTaskToSectionByName, "Tomorrow").click()
        Config.wait_for_element(Config.task_editTitle)

        Config.find_element(Config.task_editTitle).clear()
        Config.find_element(Config.task_editTitle).send_keys("addToday")

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

        tomorrow = Config.find_element(Config.cal_selectedDay).get_attribute("data-full")
        tomorrow = tomorrow.split("-")
        tomorrow = datetime.date(int(tomorrow[0]), int(tomorrow[1]) + 1, int(tomorrow[2]))
        x = datetime.timedelta(1)
        xDate = tomorrow - x
        today = str(xDate.year) + "-" + str(xDate.month - 1) + "-" + str(xDate.day)

        try: Config.find_element(Config.cal_dayByDate, today).click()
        except NoSuchElementException:
            #move to previous month and try again
            Config.find_element(Config.cal_previousMonth).click()
            Config.find_element(Config.cal_dayByDate, today).click()

        Config.find_element(Config.cal_OK).click()

        time.sleep(1)
        Config.find_element(Config.taskCreate_PlusButton).click()
        time.sleep(1)
        taskName = Config.find_element(Config.taskTitleBySectionName, "Today").text

        try: self.assertEqual(taskName, "addToday")
        except AssertionError as e: self.verificationErrors.append(str(e))

        self.assertEqual([], self.verificationErrors)
    def test(self):
        self.verificationErrors = []
        Config.find_element(Config.openSettings).click()
        time.sleep(1)
        Config.set_sender(Config.find_element(Config.settings_email).text)
        sender = Config.get_sender()
        Config.set_receiver(ChangeUser.change_user())
        receiver = Config.get_receiver()
        ChangeUser.change_user(sender)

        InitCase.init_case(menu="ALL", view="date", taskOption="share")
        Config.find_element(Config.sharing_inputEmail).clear()
        Config.find_element(Config.sharing_inputEmail).send_keys(receiver)
        Config.wait_for_element(Config.sharing_inputEmailDone)
        time.sleep(1)
        Config.find_element(Config.sharing_commitEmailButton).click()
        Config.wait_for_element(Config.sharing_sendInvites)
        Config.find_element(Config.sharing_sendInvites).click()
        Config.wait_for_element(Config.sharing_inviteOverlay, present=False)

        try: self.assertEqual(Config.find_element(Config.sharing_memberBadgeByEmail, receiver).get_attribute("data-status"), "PENDING")
        except AssertionError as e: self.verificationErrors.append(e)

        Config.find_element(Config.sharing_memberBadgeByEmail, receiver).click()
        ActionChains(Config.get_driver()).move_to_element(Config.find_element(Config.sharing_memberPopup)).perform()

        try: self.assertEqual(Config.find_element(Config.sharing_badgeStatus).text, "Invitation sent (Pending)")
        except AssertionError as e:self.verificationErrors.append(e)

        try: self.assertEqual(Config.find_element(Config.sharing_badgeEmail).text, receiver.upper())
        except AssertionError as e: self.verificationErrors.append(e)

        try: self.assertEqual("1", Config.find_element(Config.task_badgeByIconName, "share").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)

        try: self.assertTrue(Config.is_element_present(Config.taskSharedAssignee))
        except AssertionError as e: self.verificationErrors.append(str(e))

        ChangeUser.change_user(receiver)

        Config.wait_for_element(Config.sharingInvitation)

        try: self.assertEqual(Config.find_element(Config.sharingInvitation_title).text, "SHARED TASK")
        except AssertionError as e: self.verificationErrors.append(str(e))

        Config.find_element(Config.sharingInvitation_accept).click()
        Config.sync()
        InitCase.init_case(menu="ALL", view="date")

        try: self.assertTrue(Config.find_element(Config.taskShare).is_displayed())
        except AssertionError as e: self.verificationErrors.append(str(e))

        ChangeUser.change_user(sender)
        InitCase.init_case(menu="ALL", taskOption="share")

        try: self.assertEqual(Config.find_element(Config.sharing_memberBadgeByEmail, receiver).get_attribute("data-status"), "ACCEPTED")
        except AssertionError as e: self.verificationErrors.append(e)

        self.assertEqual([], self.verificationErrors)
    def test(self):
        self.verificationErrors = []
        ChangeUser.change_to_premium()
        Config.find_element(Config.openSettings).click()
        time.sleep(1)
        Config.set_sender(Config.find_element(Config.settings_email).text)
        sender = Config.get_sender()
        Config.set_receiver(ChangeUser.change_user())
        receiver = Config.get_receiver()
        ChangeUser.change_user(sender)

        InitCase.init_case(menu="MAIN")
        while Config.is_element_present(Config.main_listByName, "Shared"):
            xl = DeleteFromOptions.DeleteFromOptions("test")
            xl.test(Config.find_element(Config.main_listByName, "Shared").get_attribute("id"))

        Config.find_element(Config.main_newList).click()
        Config.find_element(Config.listTitleEdit).send_keys("Shared")
        Config.find_element(Config.listTitleEdit).send_keys(Keys.ENTER)

        listID = Config.find_element(Config.main_listByName, "Shared").get_attribute("id")
        Config.find_element(Config.main_listByName, "Shared").click()

        Config.find_element(Config.list_addSharedMemberButton).click()
        Config.find_element(Config.sharing_inputEmail).clear()
        Config.find_element(Config.sharing_inputEmail).send_keys(receiver)
        Config.wait_for_element(Config.sharing_commitEmailButton)
        time.sleep(1)
        Config.find_element(Config.sharing_commitEmailButton).click()
        Config.wait_for_element(Config.sharing_sendInvites)
        Config.find_element(Config.sharing_sendInvites).click()
        Config.wait_for_element(Config.sharing_sendInvites, present=False)

        time.sleep(1)
        try: self.assertEqual(Config.find_element(Config.sharing_memberBadgeByEmail, receiver).get_attribute("data-status"), "PENDING")
        except AssertionError as e: self.verificationErrors.append(e)

        Config.find_element(Config.sharing_memberBadgeByEmail, receiver).click()
        ActionChains(Config.get_driver()).move_to_element(Config.find_element(Config.sharing_memberPopup)).perform()
        time.sleep(1)
        try: self.assertEqual(Config.find_element(Config.sharing_badgeStatus).text, "Invitation sent (Pending)")
        except AssertionError as e:self.verificationErrors.append(e)

        try: self.assertEqual(Config.find_element(Config.sharing_badgeEmail).text, receiver.upper())
        except AssertionError as e: self.verificationErrors.append(e)

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

        try: self.assertEqual(Config.find_element(Config.list_sharedMemberByEmail, receiver).get_attribute("data-status"), "PENDING")
        except AssertionError as e: self.verificationErrors.append(e)

        Config.find_element(Config.goToMainGrid).click()
        try: self.assertEqual(Config.find_element(Config.main_sharedListMembersByListID, listID).get_attribute("data-status"), "PENDING")
        except AssertionError as e: self.verificationErrors.append(e)

        ChangeUser.change_user(receiver)

        Config.wait_for_element(Config.sharingInvitation)

        try: self.assertEqual(Config.find_element(Config.sharingInvitation_title).text, "SHARED LIST")
        except AssertionError as e: self.verificationErrors.append(str(e))

        Config.find_element(Config.sharingInvitation_accept).click()
        Config.sync()
        InitCase.init_case(menu="MAIN")

        try: self.assertEqual(Config.find_element(Config.sharing_memberBadgeByEmail, sender).get_attribute("data-status"), "CREATOR")
        except AssertionError as e: self.verificationErrors.append(e)

        ChangeUser.change_user(sender)
        InitCase.init_case(menu="MAIN")

        try: self.assertEqual(Config.find_element(Config.sharing_memberBadgeByEmail, receiver).get_attribute("data-status"), "ACCEPTED")
        except AssertionError as e: self.verificationErrors.append(e)

        self.assertEqual([], self.verificationErrors)