Exemple #1
0
    def test_add_user_2(self, name):
        """@test: Create different types of users then add user
        by using the organization name.

        @feature: Organizations associate user.

        @assert: User is added to organization.

        """

        strategy, value = common_locators["entity_deselect"]
        org_name = generate_string("alpha", 8)
        password = generate_string("alpha", 8)
        email = generate_email_address()
        search_key = "login"
        with Session(self.browser) as session:
            make_org(session, org_name=org_name)
            self.assertIsNotNone(self.org.search(org_name))
            make_user(session, username=name, first_name=name,
                      last_name=name, email=email,
                      password1=password, password2=password)
            self.assertIsNotNone(self.user.search(name, search_key))
            self.org.wait_for_ajax()
            self.org.update(org_name, new_users=[name])
            self.org.search(org_name).click()
            session.nav.wait_until_element(
                tab_locators["context.tab_users"]).click()
            element = session.nav.wait_until_element((strategy,
                                                      value % name))
            self.assertIsNotNone(element)
Exemple #2
0
    def test_add_user_2(self, user):
        """
        @feature: Organizations
        @test: Create different types of users then add user
        by using the organization name
        @assert: User is added to organization
        @BZ: 1076562
        """

        strategy = common_locators["entity_deselect"][0]
        value = common_locators["entity_deselect"][1]
        org_name = generate_string("alpha", 8)
        password = generate_string("alpha", 8)
        email = generate_email_address()
        search_key = "login"
        self.login.login(self.katello_user, self.katello_passwd)
        self.navigator.go_to_org()
        self.org.create(org_name)
        self.navigator.go_to_org()
        self.assertIsNotNone(self.org.search(org_name))
        self.navigator.go_to_users()
        self.user.create(user, email, password, password)
        self.assertIsNotNone(self.user.search(user, search_key))
        self.navigator.go_to_org()
        self.org.update(org_name, new_users=[user])
        self.org.search(org_name).click()
        self.org.wait_until_element(tab_locators["orgs.tab_users"]).click()
        element = self.org.wait_until_element((strategy,
                                               value % user))
        self.assertTrue(element)
Exemple #3
0
    def test_remove_user_3(self, user_name):
        """
        @feature: Organizations
        @test: Create admin users then add user and remove it
        by using the organization name
        @assert: The user is added then removed from the organization
        @BZ: 1076562
        """

        strategy = common_locators["entity_select"][0]
        value = common_locators["entity_select"][1]
        strategy1 = common_locators["entity_deselect"][0]
        value1 = common_locators["entity_deselect"][1]
        org_name = generate_string("alpha", 8)
        password = generate_string("alpha", 8)
        email = generate_email_address()
        search_key = "login"
        self.login.login(self.katello_user, self.katello_passwd)
        self.navigator.go_to_users()
        self.user.create(user_name, email, password, password)
        self.assertIsNotNone(self.user.search(user_name, search_key))
        self.navigator.go_to_org()
        self.org.create(org_name, users=[user_name], edit=True)
        self.org.search(org_name).click()
        self.org.wait_until_element(tab_locators["orgs.tab_users"]).click()
        element = self.org.wait_until_element((strategy1, value1 % user_name))
        # Item is listed in 'Selected Items' list and not 'All Items' list.
        self.assertTrue(element)
        self.navigator.go_to_org()
        self.org.update(org_name, users=[user_name], new_users=None)
        self.org.search(org_name).click()
        self.org.wait_until_element(tab_locators["orgs.tab_users"]).click()
        element = self.org.wait_until_element((strategy, value % user_name))
        # Item is listed in 'All Items' list and not 'Selected Items' list.
        self.assertTrue(element)
Exemple #4
0
    def test_add_user_2(self, user):
        """
        @feature: Organizations
        @test: Create different types of users then add user
        by using the organization name
        @assert: User is added to organization
        @BZ: 1076562
        """

        strategy = common_locators["entity_deselect"][0]
        value = common_locators["entity_deselect"][1]
        org_name = generate_string("alpha", 8)
        password = generate_string("alpha", 8)
        email = generate_email_address()
        search_key = "login"
        self.login.login(self.katello_user, self.katello_passwd)
        self.navigator.go_to_org()
        self.org.create(org_name)
        self.navigator.go_to_org()
        self.assertIsNotNone(self.org.search(org_name))
        self.navigator.go_to_users()
        self.user.create(user, email, password, password)
        self.assertIsNotNone(self.user.search(user, search_key))
        self.navigator.go_to_org()
        self.org.update(org_name, new_users=[user])
        self.org.search(org_name).click()
        self.org.wait_until_element(tab_locators["orgs.tab_users"]).click()
        element = self.org.wait_until_element((strategy, value % user))
        self.assertTrue(element)
Exemple #5
0
    def create_user(self, name=None, password=None,
                    email=None, firstname=None,
                    lastname=None,
                    locale=None, roles=None,
                    organizations=None,
                    locations=None, authorized_by="INTERNAL",
                    password2=None):
        """Function to create a new User"""

        name = name or generate_string("alpha", 8)
        password = password or generate_string("alpha", 8)
        if not password2:
            password2 = password
        email = email or generate_email_address()
        first_name = firstname or generate_string("alpha", 10)
        last_name = lastname or generate_string("alpha", 8)
        self.navigator.go_to_users()
        self.user.create(username=name, email=email,
                         password1=password,
                         password2=password2,
                         first_name=first_name,
                         last_name=last_name,
                         roles=roles,
                         locations=locations,
                         organizations=organizations,
                         locale=locale,
                         authorized_by=authorized_by,
                         edit=True)
Exemple #6
0
 def test_remove_user_3(self, testdata):
     """
     @test: Create admin users then add user and remove it
     by using the organization name.
     @feature: Organizations dis-associate user.
     @assert: The user is added then removed from the organization
     """
     user_name = testdata['name']
     strategy, value = common_locators["entity_select"]
     strategy1, value1 = common_locators["entity_deselect"]
     org_name = generate_string("alpha", 8)
     password = generate_string("alpha", 8)
     email = generate_email_address()
     search_key = "login"
     with Session(self.browser) as session:
         make_user(session, username=user_name, email=email,
                   password1=password, password2=password)
         self.assertIsNotNone(self.user.search(user_name, search_key))
         make_org(session, org_name=org_name, users=[user_name], edit=True)
         self.org.search(org_name).click()
         session.nav.wait_until_element(
             tab_locators["context.tab_users"]).click()
         element = session.nav.wait_until_element((strategy1,
                                                   value1 % user_name))
         # Item is listed in 'Selected Items' list and not 'All Items' list.
         self.assertIsNotNone(element)
         self.org.update(org_name, users=[user_name], new_users=None)
         self.org.search(org_name).click()
         session.nav.wait_until_element(
             tab_locators["context.tab_users"]).click()
         element = session.nav.wait_until_element((strategy,
                                                   value % user_name))
         # Item is listed in 'All Items' list and not 'Selected Items' list.
         self.assertIsNotNone(element)
Exemple #7
0
    def test_add_user_1(self, testdata):
        """@test: Create user then add user
        by using the location name

        @feature: Locations

        @assert: User is added to location

        """
        user = testdata['name']
        strategy, value = common_locators["entity_deselect"]
        loc_name = generate_string("alpha", 8)
        password = generate_string("alpha", 8)
        email = generate_email_address()
        search_key = "login"
        with Session(self.browser) as session:
            make_loc(session, name=loc_name)
            self.assertIsNotNone(self.location.search(loc_name))
            make_user(session, username=user, first_name=user,
                      last_name=user, email=email,
                      password1=password, password2=password)
            self.assertIsNotNone(self.user.search(user, search_key))
            self.location.update(loc_name, new_users=[user])
            self.location.search(loc_name).click()
            session.nav.wait_until_element(
                tab_locators["context.tab_users"]).click()
            element = session.nav.wait_until_element((strategy,
                                                      value % user))
            self.assertIsNotNone(element)
Exemple #8
0
 def __init__(self, generate=False):
     if generate:
         self.login = unicode(generate_name(6))
         self.password = unicode(generate_name(8))
         self.mail = unicode(generate_email_address())
         self.firstname = unicode(generate_name(6))
         self.lastname = unicode(generate_name(6))
         self.admin = False
         self.auth_source_id = 1
Exemple #9
0
 def test_create_user(self):
     "Create a new User"
     name = generate_name(6)
     password = generate_name(8)
     email = generate_email_address()
     self.login.login(self.katello_user, self.katello_passwd)  # login
     self.navigator.go_to_users()
     self.user.create(name, email, password, password)
     self.assertIsNotNone(self.user.search(name)) #confirm the User appears in the UI
    def test_create_user(self):
        """
        Create a new User
        """

        name = generate_name(6)
        password = generate_name(8)
        email = generate_email_address()
        search_key = "login"
        self.login.login(self.katello_user, self.katello_passwd)
        self.create_user(name, password, email, search_key)
Exemple #11
0
 def test_delete_user(self):
     "Create and Delete a User"
     name = generate_name(6)
     password = generate_name(8)
     email = generate_email_address()
     self.login.login(self.katello_user, self.katello_passwd)  # login
     self.navigator.go_to_users()
     self.user.create(name, email, password, password)
     self.assertIsNotNone(self.user.search(name)) #confirm the User appears in the UI
     self.user.delete(name, really=True)
     self.assertTrue(self.user.wait_until_element(locators["notif.success"]))
Exemple #12
0
    def create_user(self, name=None, password=None,
                    email=None, search_key=None):
        """
        Function to create a new User
        """

        name = name or generate_name(8)
        password = password or generate_name(8)
        email = email or generate_email_address()
        self.navigator.go_to_users()
        self.user.create(name, email, password, password)
        self.assertIsNotNone(self.user.search(name, search_key))
Exemple #13
0
    def test_create_user(self):
        """
        @Feature: User - Create
        @Test: Create a new user
        @Assert: User is created
        """

        name = generate_name(6)
        password = generate_name(8)
        email = generate_email_address()
        search_key = "login"
        self.login.login(self.katello_user, self.katello_passwd)
        self.create_user(name, password, email, search_key)
    def test_delete_user(self):
        """
        Create and Delete a User
        """

        name = generate_name(6)
        password = generate_name(8)
        email = generate_email_address()
        search_key = "login"
        self.login.login(self.katello_user, self.katello_passwd)  # login
        self.create_user(name, password, email, search_key)
        self.user.delete(name, search_key, really=True)
        self.assertTrue(self.user.wait_until_element(common_locators
                                                     ["notif.success"]))
Exemple #15
0
 def test_update_password(self):
     "Creates a User and updates the password"
     name = generate_name(6)
     password = generate_name(8)
     new_password = generate_name(8)
     email = generate_email_address()
     self.login.login(self.katello_user, self.katello_passwd)  # login
     self.navigator.go_to_users()
     self.user.create(name, email, password, password)
     self.assertIsNotNone(self.user.search(name)) #confirm the User appears in the UI
     self.user.update(name, password = new_password)
     self.login.logout()
     self.login.login(name, new_password)
     self.assertTrue(self.login.is_logged()) #confirm user can login with new password
    def test_create_usergroup(self):
        """
        Creates new usergroup
        """

        user_name = generate_name(6)
        group_name = generate_name(6)
        password = generate_name(8)
        email = generate_email_address()
        search_key = "login"
        self.login.login(self.katello_user, self.katello_passwd)
        self.navigator.go_to_users()
        self.user.create(user_name, email, password, password)
        self.assertIsNotNone(self.user.search(user_name, search_key))
        self.create_usergroup(group_name, [user_name])
    def test_update_password(self):
        """
        Creates a User and updates the password
        """

        name = generate_name(6)
        password = generate_name(8)
        new_password = generate_name(8)
        email = generate_email_address()
        search_key = "login"
        self.login.login(self.katello_user, self.katello_passwd)  # login
        self.create_user(name, password, email, search_key)
        self.user.update(search_key, name, None, None, new_password)
        self.login.logout()
        self.login.login(name, new_password)
        self.assertTrue(self.login.is_logged())
    def test_update_role(self):
        """
        Creates a User and updates the password
        """

        name = generate_name(6)
        password = generate_name(8)
        email = generate_email_address()
        role = generate_name(6)
        search_key = "login"
        self.login.login(self.katello_user, self.katello_passwd)  # login
        self.navigator.go_to_roles()
        self.role.create(role)
        self.assertIsNotNone(self, self.role.search(role))
        self.create_user(name, password, email, search_key)
        self.user.update(search_key, name, new_roles=[role])
Exemple #19
0
    def test_create_usergroup(self):
        """
        @Feature: Usergroup - Positive Create
        @Test: Create new Usergroup
        @Assert: Usergroup is created
        """

        user_name = generate_name(6)
        group_name = generate_name(6)
        password = generate_name(8)
        email = generate_email_address()
        search_key = "login"
        self.login.login(self.katello_user, self.katello_passwd)
        self.navigator.go_to_users()
        self.user.create(user_name, email, password, password)
        self.assertIsNotNone(self.user.search(user_name, search_key))
        self.create_usergroup(group_name, [user_name])
    def test_update_usergroup(self):
        """
        Create new usergroup and update its name or users
        """

        name = generate_name(6)
        new_name = generate_name(4)
        user_name = generate_name(6)
        password = generate_name(8)
        email = generate_email_address()
        search_key = "login"
        self.login.login(self.katello_user, self.katello_passwd)
        self.navigator.go_to_users()
        self.user.create(user_name, email, password, password)
        self.assertIsNotNone(self.user.search(user_name, search_key))
        self.create_usergroup(name)
        self.usergroup.update(name, new_name, new_users=[user_name])
Exemple #21
0
    def test_create_usergroup(self):
        """
        @Feature: Usergroup - Positive Create
        @Test: Create new Usergroup
        @Assert: Usergroup is created
        """

        user_name = generate_string("alpha", 10)
        group_name = generate_string("alpha", 10)
        password = generate_string("alpha", 10)
        email = generate_email_address()
        search_key = "login"
        self.login.login(self.katello_user, self.katello_passwd)
        self.navigator.go_to_users()
        self.user.create(user_name, email, password, password)
        self.assertIsNotNone(self.user.search(user_name, search_key))
        self.create_usergroup(group_name, [user_name])
Exemple #22
0
    def test_update_password(self):
        """
        @Feature: User - Update
        @Test: Update password for a user
        @Assert: User password is updated
        """

        name = generate_name(6)
        password = generate_name(8)
        new_password = generate_name(8)
        email = generate_email_address()
        search_key = "login"
        self.login.login(self.katello_user, self.katello_passwd)  # login
        self.create_user(name, password, email, search_key)
        self.user.update(search_key, name, None, None, new_password)
        self.login.logout()
        self.login.login(name, new_password)
        self.assertTrue(self.login.is_logged())
Exemple #23
0
    def test_update_role(self):
        """
        @Feature: User - Update
        @Test: Update role for a user
        @Assert: User role is updated
        """

        name = generate_name(6)
        password = generate_name(8)
        email = generate_email_address()
        role = generate_name(6)
        search_key = "login"
        self.login.login(self.katello_user, self.katello_passwd)  # login
        self.navigator.go_to_roles()
        self.role.create(role)
        self.assertIsNotNone(self, self.role.search(role))
        self.create_user(name, password, email, search_key)
        self.user.update(search_key, name, new_roles=[role])
Exemple #24
0
    def test_update_usergroup(self):
        """
        @Feature: Usergroup - Positive Update
        @Test: Update usergroup with name or users
        @Assert: Usergroup is updated
        """

        name = generate_name(6)
        new_name = generate_name(4)
        user_name = generate_name(6)
        password = generate_name(8)
        email = generate_email_address()
        search_key = "login"
        self.login.login(self.katello_user, self.katello_passwd)
        self.navigator.go_to_users()
        self.user.create(user_name, email, password, password)
        self.assertIsNotNone(self.user.search(user_name, search_key))
        self.create_usergroup(name)
        self.usergroup.update(name, new_name, new_users=[user_name])
Exemple #25
0
    def test_update_usergroup(self):
        """
        @Feature: Usergroup - Positive Update
        @Test: Update usergroup with name or users
        @Assert: Usergroup is updated
        """

        name = generate_string("alpha", 6)
        new_name = generate_string("alpha", 4)
        user_name = generate_string("alpha", 6)
        password = generate_string("alpha", 8)
        email = generate_email_address()
        search_key = "login"
        self.login.login(self.katello_user, self.katello_passwd)
        self.navigator.go_to_users()
        self.user.create(user_name, email, password, password)
        self.assertIsNotNone(self.user.search(user_name, search_key))
        self.create_usergroup(name)
        self.usergroup.update(name, new_name, new_users=[user_name])
        self.assertIsNotNone(self.usergroup.search(new_name))
Exemple #26
0
    def test_remove_user_3(self, user_name):
        """
        @feature: Organizations
        @test: Create admin users then add user and remove it
        by using the organization name
        @assert: The user is added then removed from the organization
        @BZ: 1076562
        """

        strategy = common_locators["entity_select"][0]
        value = common_locators["entity_select"][1]
        strategy1 = common_locators["entity_deselect"][0]
        value1 = common_locators["entity_deselect"][1]
        org_name = generate_string("alpha", 8)
        password = generate_string("alpha", 8)
        email = generate_email_address()
        search_key = "login"
        self.login.login(self.katello_user, self.katello_passwd)
        self.navigator.go_to_users()
        self.user.create(user_name, email, password, password)
        self.assertIsNotNone(self.user.search(user_name, search_key))
        self.navigator.go_to_org()
        self.org.create(org_name, users=[user_name], edit=True)
        self.org.search(org_name).click()
        self.org.wait_until_element(tab_locators["orgs.tab_users"]).click()
        element = self.org.wait_until_element((strategy1,
                                               value1 % user_name))
        # Item is listed in 'Selected Items' list and not 'All Items' list.
        self.assertTrue(element)
        self.navigator.go_to_org()
        self.org.update(org_name, users=[user_name], new_users=None)
        self.org.search(org_name).click()
        self.org.wait_until_element(tab_locators["orgs.tab_users"]).click()
        element = self.org.wait_until_element((strategy,
                                               value % user_name))
        # Item is listed in 'All Items' list and not 'Selected Items' list.
        self.assertTrue(element)
Exemple #27
0
def make_user(session, org=None, loc=None, force_context=False, **kwargs):
    """
    Creates a user
    """
    password = generate_string("alpha", 6)

    create_args = {
        "username": None,
        "email": generate_email_address(),
        "password1": password,
        "password2": password,
        "authorized_by": "INTERNAL",
        "locale": None,
        "first_name": generate_string("alpha", 6),
        "last_name": generate_string("alpha", 6),
        "roles": None,
        "locations": None,
        "organizations": None,
        "edit": False,
        "select": True,
    }
    page = session.nav.go_to_users
    core_factory(create_args, kwargs, session, page, org=org, loc=loc, force_context=force_context)
    User(session.browser).create(**create_args)
Exemple #28
0
 def generate(self):
     return generate_email_address(
         name_length=self.name_length,
         domain_length=self.domain_length)
Exemple #29
0
 def test_return_type(self):
     """Tests if generate email address returns a unicode string"""
     self.assertIsInstance(generate_email_address(), unicode)
Exemple #30
0
 def test_return_type(self):
     """Tests if generate email address returns a unicode string"""
     self.assertIsInstance(generate_email_address(), unicode)
Exemple #31
0
 def generate(self):
     return generate_email_address(name_length=self.name_length,
                                   domain_length=self.domain_length)