예제 #1
0
    def REQ013(self):
        self.trace("REQ013")

        # Remove the user if already there
        if usernameExistsInDB(self.context, POC_USER):
            removeUser(self.context, POC_USER)

        # Create the user via the command line interface
        command = "python -m komodors.enrollment -f createUser -e %s" % self.context["env"].name
        p = subprocess.Popen(command.split(), stdout=subprocess.PIPE, stderr=subprocess.PIPE)
        out, err = p.communicate()

        # Check user is in system and role is correct
        self.verifyUserOnWeb()
예제 #2
0
    def REQ015(self):
        self.trace('REQ015')
        
        # Remove the test station assigned user
        if usernameExistsInDB(self.context, POC_USER):
            removeUser(self.context, POC_USER)

        try:
            page = self.brwsr.navigateToLogin()
            page = page.login(SYSTEM_USER, SYSTEMUSER_PASSWORD)
            assert type(page) == komodors.pocweb.pages.listUsers.ListUsersPage, 'user list page appears'
            
            page = page.clickEnrollUser()
            self.verifyEqual(type(page), komodors.pocweb.pages.enrollUser.EnrollUserPage, msg='enroll page appears')                
            self.verifyEqual(None, page.setAdminCheckbox(True), msg='check admin')
            self.verifyEqual(None, page.setAdminCheckbox(False), msg='uncheck admin')
            self.verifyEqual(None, page.setDisableUserCheckbox(True), msg='check disable user')
            self.verifyEqual(None, page.setDisableUserCheckbox(False), msg='uncheck disable user')
            self.verifyEqual(None, page.setName(POC_USER), msg='set name')
            self.verifyEqual(None, page.setServiceCenterTechCheckbox(True), msg='check service center user')
            self.verifyEqual(None, page.setServiceCenterTechCheckbox(False), msg='uncheck service center user')
            self.verifyEqual(None, page.setSystemCheckbox(True), msg='check system user')
            self.verifyEqual(None, page.setSystemCheckbox(False), msg='uncheck system user')

            # Set default permissions
            page.setServiceCenterTechCheckbox(True)
            page.setAdminCheckbox(True)
            
            page = page.clickAddButton()
            self.verifyEqual(type(page), komodors.pocweb.pages.listUsers.ListUsersPage, msg='enrollment successful')            
            page = page.clickEnrollUser()
            self.verifyEqual(type(page), komodors.pocweb.pages.enrollUser.EnrollUserPage, msg='enroll page appears')            
            page = page.clickListUsers()
            self.verifyEqual(type(page), komodors.pocweb.pages.listUsers.ListUsersPage, msg='list user page appears')            
            page = page.clickLogout()
            self.verifyEqual(type(page), komodors.pocweb.pages.login.LoginPage, msg='click logout successful')
            
        finally:
            # Recreate the user that was deleted if the test case failed
            self.dataFactory.createUser(self.brwsr)
예제 #3
0
    def REQ008(self):

        self.trace("REQ008")

        # Remove the user if already there
        if usernameExistsInDB(self.context, POC_USER):
            removeUser(self.context, POC_USER)

        # Create the user
        pocuser = self.dataFactory.createUser(self.brwsr)

        # Check user object attrs are correct
        self.verifyTrue(isinstance(pocuser, POCUserEntity), msg="user entity")
        self.verifyEqual(pocuser.username, POC_USER, msg="username")
        self.verifyEqual(pocuser.password, POCUSER_PASSWORD, msg="password")
        self.verifyEqual(pocuser.role, ROLE_SERVICE_CENTER_TECH, msg="role")

        # Check user is in system and role is correct
        self.verifyUserOnWeb()

        # Attempt create the user, when it already exists in the system
        del pocuser
        pocuser = self.dataFactory.createUser(self.brwsr)
        self.verifyTrue(isinstance(pocuser, POCUserEntity), msg="user entity")