Ejemplo n.º 1
0
    def test_warning_message_for_creating_existing_team(self, driver):
        """
        These function lets us check the warning message if we try to create new team with same as existing team name.
        """
        wait = WebDriverWait(driver,
                             20,
                             poll_frequency=2,
                             ignored_exceptions=[
                                 ElementClickInterceptedException,
                                 ElementNotVisibleException,
                                 ElementNotInteractableException
                             ])
        create_team(driver, name="Demo team", desc="demo")

        WebDriverWait(driver, 20).until(
            EC.invisibility_of_element(
                (By.XPATH, "//div[@class='loading-background']")))
        warning_msg = wait.until(
            EC.element_to_be_clickable(
                (By.XPATH, wrng_msg_for_creating_existing_team))).text
        print("\n", warning_msg)
        assert warning_msg == "* Team with this name already exists."

        close_popup = wait.until(
            EC.element_to_be_clickable((By.XPATH, "//button[text()='×']")))
        close_popup.click()

        back = wait.until(EC.element_to_be_clickable((By.XPATH, back_btn)))
        back.click()
Ejemplo n.º 2
0
    def test_warning_msg_for_max_char_while_updating(self, driver):
        wait = WebDriverWait(driver, 20, poll_frequency=1, ignored_exceptions=[
            ElementClickInterceptedException, ElementNotVisibleException, ElementNotInteractableException])

        create_team(driver, name="Team C", desc="This is Team C")
        wait.until(EC.visibility_of_element_located((By.XPATH, success_msg_team_created)))
        wait.until(EC.invisibility_of_element_located((By.XPATH, success_msg_team_created)))

        stop_till_spinner_is_invisible(driver)
        search_team = wait.until(EC.element_to_be_clickable((By.XPATH, search_field)))
        search_team.clear()
        search_team.send_keys("Team C")
        search_team.send_keys(Keys.ENTER)

        action_dp = wait.until(EC.element_to_be_clickable((By.XPATH, teams_section_action_dropdown)))
        action_dp.click()

        select_update = wait.until(EC.element_to_be_clickable((By.XPATH, update)))
        select_update.click()

        stop_till_spinner_is_invisible(driver)
        change_the_team_name = wait.until(EC.element_to_be_clickable((By.XPATH, "//div[@class='col-sm-10']//input[@type='text']")))
        change_the_team_name.clear()
        change_the_team_name.send_keys("Team " * 50)

        warning_msg = wait.until(EC.presence_of_element_located((By.XPATH, warning_msg_for_max_char_in_name_field)))
        assert warning_msg.text == "* Ensure this field has no more than 50 characters."
        close_pop_up = wait.until(EC.element_to_be_clickable((By.XPATH, "//button[@class='close']")))
        close_pop_up.click()
        stop_till_spinner_is_invisible(driver)
        back = WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, "//button[text()='Back']")))
        back.click()
Ejemplo n.º 3
0
    def test_warning_msg_while_updating_old_team_name_to_existing_team_name(self, driver):
        wait = WebDriverWait(driver, 20, poll_frequency=1, ignored_exceptions=[
            ElementClickInterceptedException, ElementNotVisibleException, ElementNotInteractableException])
        # create Team
        create_team(driver, name="Team B", desc="This is Team B")
        wait.until(EC.visibility_of_element_located((By.XPATH, success_msg_team_created)))
        wait.until(EC.invisibility_of_element_located((By.XPATH, success_msg_team_created)))

        stop_till_spinner_is_invisible(driver)
        action_dp = wait.until(EC.element_to_be_clickable((By.XPATH, teams_section_action_dropdown)))
        action_dp.click()

        select_update = wait.until(EC.element_to_be_clickable((By.XPATH, update)))
        select_update.click()

        stop_till_spinner_is_invisible(driver)
        change_the_team_name = wait.until(EC.element_to_be_clickable((By.XPATH, "//div[@class='col-sm-10']//input[@type='text']")))
        change_the_team_name.clear()
        change_the_team_name.send_keys("Team A")

        submit = WebDriverWait(driver, 5).until(EC.element_to_be_clickable((By.XPATH, create_team_submit)))
        submit.click()

        stop_till_spinner_is_invisible(driver)
        warning_msg = wait.until(EC.presence_of_element_located((By.XPATH, "//p[contains(text(),'group with this name already exists.')]")))
        assert warning_msg.text == "* group with this name already exists."
        driver.refresh()
Ejemplo n.º 4
0
    def test_warning_msg_when_same_team_is_created_with_existing_team_name(self, driver):
        wait = WebDriverWait(driver, 20, poll_frequency=1, ignored_exceptions=[
            ElementClickInterceptedException, ElementNotVisibleException, ElementNotInteractableException])
        # create Team
        create_team(driver, name="Team A", desc="This is Team A")
        wait.until(EC.visibility_of_element_located((By.XPATH, success_msg_team_created)))
        wait.until(EC.invisibility_of_element_located((By.XPATH, success_msg_team_created)))
        back = wait.until(EC.element_to_be_clickable((By.XPATH, "//button[text()='Back']")))
        back.click()

        stop_till_spinner_is_invisible(driver)
        create_team(driver, name="Team A", desc="This is Team A")
        # Test for Warning message
        warning_msg_when_existing_team_is_created = wait.until(EC.presence_of_element_located((By.XPATH, warning_msg_when_we_create_existing_team)))
        assert warning_msg_when_existing_team_is_created.text == "* Team with this name already exists."

        close_pop_up = wait.until(EC.element_to_be_clickable((By.XPATH, "//button[@class='close']")))
        close_pop_up.click()
        back = wait.until(EC.element_to_be_clickable((By.XPATH, "//button[text()='Back']")))
        back.click()
Ejemplo n.º 5
0
    def test_assign_normal_users_to_team(self, driver, teamname="Demo team"):
        """
        These function lets us assign the normal users to required team
        """
        wait = WebDriverWait(driver,
                             20,
                             poll_frequency=2,
                             ignored_exceptions=[
                                 ElementClickInterceptedException,
                                 ElementNotVisibleException,
                                 ElementNotInteractableException
                             ])

        create_team(driver, name=teamname, desc="demo")
        wait.until(
            EC.visibility_of_element_located(
                (By.XPATH, success_msg_team_created)))
        wait.until(
            EC.invisibility_of_element_located(
                (By.XPATH, success_msg_team_created)))
        back = wait.until(
            EC.element_to_be_clickable((By.XPATH, "//button[text()='Back']")))
        back.click()

        # go to Team section to assign normal users to required team
        WebDriverWait(driver, 20).until(
            EC.invisibility_of_element(
                (By.XPATH, "//div[@class='loading-background']")))
        teams = wait.until(EC.element_to_be_clickable(
            (By.XPATH, team_section)))
        teams.click()

        WebDriverWait(driver, 20).until(
            EC.invisibility_of_element(
                (By.XPATH, "//div[@class='loading-background']")))
        search = wait.until(
            EC.element_to_be_clickable((By.XPATH, search_field)))
        search.send_keys(teamname)

        WebDriverWait(driver, 20).until(
            EC.invisibility_of_element(
                (By.XPATH, "//div[@class='loading-background']")))
        action_dp = wait.until(
            EC.element_to_be_clickable(
                (By.XPATH, teams_section_action_dropdown)))
        action_dp.click()
        addusers = wait.until(EC.element_to_be_clickable(
            (By.XPATH, add_users)))
        addusers.click()

        # select users pop up
        WebDriverWait(driver, 20).until(
            EC.invisibility_of_element(
                (By.XPATH, "//div[@class='loading-background']")))
        select_users_dropdown = wait.until(
            EC.element_to_be_clickable((By.XPATH, select_users_dp)))
        select_users_dropdown.click()
        select_users_dropdown.send_keys('james')  # Add 1st Normal user
        select_users_dropdown.send_keys(Keys.ENTER)
        select_users_dropdown.click()
        select_users_dropdown.send_keys('Niki')  # Add 2nd Normal user
        select_users_dropdown.send_keys(Keys.ENTER)

        select_user_submit = wait.until(
            EC.element_to_be_clickable((By.XPATH, select_users_submit)))
        select_user_submit.click()
        time.sleep(2)
        WebDriverWait(driver, 20).until(
            EC.invisibility_of_element(
                (By.XPATH, "//div[@class='loading-background']")))
        count_of_users = wait.until(
            EC.element_to_be_clickable(
                (By.XPATH, "//tr[@class='el-table__row'][1]/td[3]//p"))).text
        assert count_of_users == '2'

        back = wait.until(EC.element_to_be_clickable((By.XPATH, back_btn)))
        back.click()