def test(self):
        InitCase.init_case(menu="ALL", taskNo=0)
        self.verificationErrors = []

        Config.find_element(Config.openSettings).click()

        Config.wait_for_element(Config.settings_preferences)
        Config.find_element(Config.settings_preferences).click()
        Config.wait_for_element(Config.preferences_defaultList)
        Config.find_element(Config.preferences_defaultList).click()

        Config.wait_for_element(Config.defaultList_changeDefault)
        newDefaultName = Config.find_element(Config.defaultList_changeDefault).text
        Config.find_element(Config.defaultList_changeDefault).click()

        Config.find_element(Config.overlay).click()
        Config.wait_for_element_visibility(Config.overlay, visible=False)

        CreateTaskF.create_a_task("def")

        Config.find_element(Config.taskTitle).click()
        Config.wait_for_element(Config.task_FolderSelector)

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

        self.assertEqual([], self.verificationErrors)
예제 #2
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)
예제 #3
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.signIn_alreadyMember).click()
        Config.wait_for_element(Config.signIn_googlePlus)
        Config.find_element(Config.signIn_googlePlus).click()

        time.sleep(6)
        try: self.assertFalse(Config.is_element_present(Config.signUp_skipWhatsNew))
        except AssertionError as e: self.verificationErrors.append(str(e))

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

        try: Config.find_element(Config.profilePic).value_of_css_property("background-image").index("google")
        except ValueError as e: self.verificationErrors.append(e)
예제 #4
0
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)
예제 #5
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)
예제 #6
0
    def test(self):
        InitCase.init_case(menu="ALL", taskOption="subtasks")
        self.verificationErrors = []

        Config.find_element(Config.subtasks_check).click()
        Config.wait_for_element_visibility(Config.subtasks_markDone)
        Config.find_element(Config.subtasks_markDone).click()

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

        #Check no subtasks present
        try: self.assertFalse(Config.is_element_present(Config.subtask))
        except AssertionError as e: self.verificationErrors.append(str(e))

        self.assertEqual([], self.verificationErrors)
예제 #7
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)
예제 #8
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