def test_search_by_huid_successful(self):
        """
        This searches for an existing ID and asserts the search results page is
        loaded after search
        """

        user_list_page = UserListPageObject(self.driver)
        search_page = FindUserPageObject(self.driver)
        results_page = ResultsListPageObject(self.driver)
        test_user = self.test_settings["test_users"]["1"]

        # ensure person isn't in course before attempting to search
        self.api.remove_user(self.test_settings["test_course"]["cid"], test_user["user_id"], test_user["role_id"])

        user_list_page.add_user()
        search_page.find_user(test_user["user_id"])
        self.assertTrue(results_page.is_loaded())
Exemple #2
0
    def test_search_by_huid_successful(self):
        """
        This searches for an existing ID and asserts the search results page is
        loaded after search
        """

        user_list_page = UserListPageObject(self.driver)
        search_page = FindUserPageObject(self.driver)
        results_page = ResultsListPageObject(self.driver)
        test_user = self.test_settings['test_users']['1']

        # ensure person isn't in course before attempting to search
        self.api.remove_user(self.test_settings['test_course']['cid'],
                             test_user['user_id'], test_user['role_id'])

        user_list_page.add_user()
        search_page.find_user(test_user['user_id'])
        self.assertTrue(results_page.is_loaded())
Exemple #3
0
    def test_adding_users_by_roles(self, test_case_id, test_user_id,
                                   test_univ_id, role, role_id, canvas_role,
                                   success_msg_ind, remove_list_ind,
                                   error_msg_ind, add_remove_indicator):

        if add_remove_indicator != 'add':
            return

        test_univ_id = self.normalize_xlrd_number(test_univ_id, '{0:08d}')
        test_user_id = self.normalize_xlrd_number(test_user_id, '{0:08d}')
        role_id = self.normalize_xlrd_number(role_id)

        self.start_message(test_user_id, test_univ_id, role, role_id)

        # Note: ICOMMONS_REST_API_HOST environment needs to match the LTI tool
        # environment (because of shared cache interactions)

        # ensure person is not in course before attempting to add using API;
        # remove ALL roles/enrollments for the test user in this course
        # to ensure no incidental data causes conflict when we try to add
        self.api.remove_user(self.test_settings['test_course']['cid'],
                             test_univ_id)

        user_list_page = UserListPageObject(self.driver)
        search_page = FindUserPageObject(self.driver)
        results_page = ResultsListPageObject(self.driver)

        # from Main/User list page: click links to add people to course
        user_list_page.add_user()
        # from Search page: find a user and submit form
        search_page.find_user(test_user_id)
        # verify that we are now on the results page from search
        self.assertTrue(
            results_page.is_loaded(),
            "Problem finding user %s: results page not loaded" % test_user_id)

        results_page.add_id_to_course(test_univ_id, role)

        self.assertTrue(
            results_page.user_confirmation_visible(),
            'User %s with role %s could not be added to the '
            'course; another conflicting role may exist for '
            'the user already.' % (test_univ_id, role_id))

        results_page.return_to_manage_people()
        self.assertTrue(
            user_list_page.user_present_with_role(test_univ_id, role_id))

        # ensure person is removed from course as cleanup
        self.api.remove_user(self.test_settings['test_course']['cid'],
                             test_univ_id, role_id)
    def test_adding_users_by_roles(self, test_case_id,
                                   test_user_id,
                                   test_univ_id,
                                   role,
                                   role_id,
                                   canvas_role,
                                   success_msg_ind,
                                   remove_list_ind,
                                   error_msg_ind,
                                   add_remove_indicator):

        if add_remove_indicator != 'add':
            return

        test_univ_id = self.normalize_xlrd_number(test_univ_id, '{0:08d}')
        test_user_id = self.normalize_xlrd_number(test_user_id, '{0:08d}')
        role_id = self.normalize_xlrd_number(role_id)

        self.start_message(test_user_id, test_univ_id, role, role_id)

        # Note: ICOMMONS_REST_API_HOST environment needs to match the LTI tool
        # environment (because of shared cache interactions)

        # ensure person is not in course before attempting to add using API;
        # remove ALL roles/enrollments for the test user in this course
        # to ensure no incidental data causes conflict when we try to add
        self.api.remove_user(
            self.test_settings['test_course']['cid'], test_univ_id)

        user_list_page = UserListPageObject(self.driver)
        search_page = FindUserPageObject(self.driver)
        results_page = ResultsListPageObject(self.driver)

        # from Main/User list page: click links to add people to course
        user_list_page.add_user()
        # from Search page: find a user and submit form
        search_page.find_user(test_user_id)
        # verify that we are now on the results page from search
        self.assertTrue(results_page.is_loaded(),
                        "Problem finding user %s: results page not loaded"
                        % test_user_id)

        results_page.add_id_to_course(test_univ_id, role)

        self.assertTrue(results_page.user_confirmation_visible(),
                        'User %s with role %s could not be added to the '
                        'course; another conflicting role may exist for '
                        'the user already.' % (test_univ_id, role_id))

        results_page.return_to_manage_people()
        self.assertTrue(
            user_list_page.user_present_with_role(test_univ_id, role_id))

        # ensure person is removed from course as cleanup
        self.api.remove_user(
            self.test_settings['test_course']['cid'], test_univ_id, role_id)