Exemple #1
0
def test_suspend_user(fixture_webdriver):
    element = UsersPageElements(fixture_webdriver)

    UsersPageActions(fixture_webdriver).open_edit_user_page()
    EditUsersPageActions(fixture_webdriver).suspend_user()

    assert element.admin_email() in element.first_user_in_list().get_attribute(
        "textContent"), "First email in the list should be [email protected]"
Exemple #2
0
def test_delete_user_cancel(fixture_webdriver):
    element = UsersPageElements(fixture_webdriver)
    UsersPageActions(fixture_webdriver).open_edit_user_page()
    EditUsersPageActions(fixture_webdriver).cancel_deleting_user()

    assert element.admin_email() in \
           fixture_webdriver.find_element_by_xpath('//*[@id="users-region"]/table/tbody/tr[2]/td[1]').get_attribute(
               "textContent"), "Second email in the list should be [email protected]"

    UsersPageActions(fixture_webdriver).confirm_user_deleting()
Exemple #3
0
def test_change_username(fixture_webdriver):
    element = UsersPageElements(fixture_webdriver)

    UsersPageActions(fixture_webdriver).open_edit_user_page()
    EditUsersPageActions(fixture_webdriver).change_username('Arename')

    time.sleep(2)
    assert 'Arename' in \
           element.first_user_in_list().get_attribute(
               "textContent"), "First username in the list should be Arename"
    UsersPageActions(fixture_webdriver).confirm_user_deleting()
def test_delete_user(fixture_webdriver):
    action = UsersPageActions(fixture_webdriver)
    admin_email = UsersPageElements(fixture_webdriver).admin_email()
    fake = Faker()
    email = fake.first_name() + UsersPageElements(
        fixture_webdriver).sonik_pass_domen()

    action.open_users_page()
    action.fill_new_user_form("john", "doe", email, "+38", "0671112223")
    fixture_webdriver.refresh()
    time.sleep(2)
    action.confirm_user_deleting()

    assert admin_email in \
           fixture_webdriver.find_element_by_xpath('//*[@id="users-region"]/table/tbody/tr/td[1]').get_attribute(
               "textContent")
Exemple #5
0
    def change_email_priority(self):
        element = EditUsersPageElements(self.driver)
        email = "bla" + UsersPageElements(self.driver).sonik_pass_domen()
        add_button = element.add_email_button()
        username = element.username_input()
        label = WebDriverSelect(element.email_label())
        value = 1

        add_button.click()
        email_input = element.second_email_input()

        email_input.click()
        email_input.send_keys(email)
        username.click()

        for x in range(5):
            label.select_by_value(str(value))
            selected_option = label.first_selected_option.text
            if value == 0:
                assert selected_option == 'Primary', "Selected option should be Primary"

            elif value == 1:
                assert selected_option == 'Secondary', "Selected option should be Secondary"

            elif value == 2:
                assert selected_option == 'Work', "Selected option should be Work"

            elif value == 3:
                assert selected_option == 'Personal', "Selected option should be Personal"

            elif value == 4:
                assert selected_option == 'Other', "Selected option should be Other"

            value += 1
Exemple #6
0
    def change_email(self, name):
        email = EditUsersPageElements(self.driver).email_input()
        email_name = name + UsersPageElements(self.driver).sonik_pass_domen()
        email.click()
        email.clear()
        email.send_keys(email_name)

        EditUsersPageElements(self.driver).username_input().click()
        time.sleep(1)
    def open_edit_user_page(self):
        domen = UsersPageElements(self.driver).sonik_pass_domen()
        fake = Faker()
        email = fake.first_name() + domen

        UsersPageActions(self.driver).open_users_page()
        UsersPageActions(self.driver).fill_new_user_form("john", "doe", email, "+38", "0671112223")
        time.sleep(5)
        self.driver.find_element_by_xpath('//*[@id="users-region"]/table/tbody/tr[2]/td[2]/a/i').click()
        time.sleep(5)
Exemple #8
0
def test_change_email(fixture_webdriver):
    action = EditUsersPageActions(fixture_webdriver)

    UsersPageActions(fixture_webdriver).open_edit_user_page()
    action.change_email('change')

    assert 'change' + UsersPageElements(fixture_webdriver).sonik_pass_domen() in (
        EditUsersPageElements(fixture_webdriver).email_input()).get_attribute('value'), "The email value is wrong"

    action.delete_user()
Exemple #9
0
    def delete_email(self):
        element = EditUsersPageElements(self.driver)

        email = "bla" + UsersPageElements(self.driver).sonik_pass_domen()
        add_button = element.add_email_button()
        username = element.username_input()

        add_button.click()

        email_input = self.driver.find_element_by_xpath('//*[@id="emails"]/div/span/form[2]/div[1]/input')
        email_input.click()
        email_input.send_keys(email)
        username.click()
        time.sleep(3)
        element.delete_email_button().click()
def test_page_elements(fixture_webdriver):
    general_action = GeneralActions(fixture_webdriver)
    mp_element = MainPageElements(fixture_webdriver)
    welcome_elements = WelcomePageElements(fixture_webdriver)
    LoginActions(fixture_webdriver).login_full_case(
        UsersPageElements(fixture_webdriver).admin_email())

    # check elements
    general_action.check_element_on_page(mp_element.logo())
    general_action.check_element_on_page(mp_element.hamburger_menu_button())

    general_action.check_element_on_page(welcome_elements.logout_button())
    general_action.check_element_on_page(welcome_elements.welcome_time())
    general_action.check_element_on_page(welcome_elements.content_block())
    general_action.check_element_on_page(welcome_elements.dashboard_button())
    general_action.check_element_on_page(welcome_elements.partner_button())
def test_check_elements(fixture_webdriver):
    users_element = UsersPageElements(fixture_webdriver)
    general_actions = GeneralActions(fixture_webdriver)

    UsersPageActions(fixture_webdriver).open_users_page()
    time.sleep(10)

    general_actions.check_url(
        MainPageElements(fixture_webdriver).url() + "#users")
    general_actions.check_element_on_page(users_element.users_title())
    general_actions.check_element_on_page(users_element.list_of_emails())
    general_actions.check_element_on_page(users_element.content_left())
    general_actions.check_element_on_page(users_element.content_right())
Exemple #12
0
    def add_email(self):
        a = 2
        for x in range(3):
            email = "bla" + str(a) + UsersPageElements(self.driver).sonik_pass_domen()
            add_button = EditUsersPageElements(self.driver).add_email_button()
            username = EditUsersPageElements(self.driver).username_input()

            add_button.click()

            email_input = self.driver.find_element_by_xpath(
                '//*[@id="emails"]/div/span/form[' + str(a) + ']/div[1]/input')
            email_input.click()
            email_input.send_keys(email)
            username.click()

            assert email in email_input.get_attribute('value')

            a += 1
            x += 1

            time.sleep(3)
 def cancel_user_deleting(self):
     UsersPageElements(self.driver).delete_first_user_button().click()
     UsersPageElements(self.driver).cancel_delete_button().click()
     time.sleep(2)
    def fill_new_user_form(self, firsname=None, lastname=None, email=None, country_code=None, phone=None):
        form_element = UsersPageElements(self.driver)

        GeneralActions(self.driver).click_on_button(form_element.new_user_button())
        form_element.firstname_input().send_keys(firsname)
        form_element.lastname_input().send_keys(lastname)
        form_element.email_input().send_keys(email)
        form_element.country_code_input().click()
        form_element.country_code_input().clear()
        form_element.country_code_input().send_keys(country_code)
        form_element.phone_number_input().send_keys(phone)

        GeneralActions(self.driver).click_on_button(form_element.submit_button())
        time.sleep(2)
 def open_users_page(self):
     LoginActions(self.driver).login_full_case(UsersPageElements(self.driver).admin_email())
     GeneralActions(self.driver).click_on_button(WelcomePageElements(self.driver).dashboard_button())
Exemple #16
0
 def delete_user(self):
     EditUsersPageElements(self.driver).delete_button().click()
     UsersPageElements(self.driver).confirm_delete_button().click()
     time.sleep(5)
Exemple #17
0
def test_login(fixture_webdriver):
    LoginActions(fixture_webdriver).login_full_case(
        UsersPageElements(fixture_webdriver).admin_email())
    GeneralActions(fixture_webdriver).check_url(
        MainPageElements(fixture_webdriver).url() + '#welcome')
Exemple #18
0
 def cancel_deleting_user(self):
     EditUsersPageElements(self.driver).delete_button().click()
     UsersPageElements(self.driver).cancel_delete_button().click()
     time.sleep(1)
     EditUsersPageElements(self.driver).back_button().click()