def add_modes_and_view_discussion_mgmt_page(self, modes): """ Adds enrollment modes to the course, and then goes to the discussion tab on the instructor dashboard. """ add_enrollment_course_modes(self.browser, self.course_id, modes) self.view_discussion_management_page()
def add_modes_and_view_discussion_mgmt_page(self, modes): """ Adds enrollment modes to the course, and then goes to the discussion tab on the instructor dashboard. """ add_enrollment_course_modes(self.browser, self.course_id, modes) self.view_discussion_management_page()
def setUp(self, is_staff=True): super(EndToEndCohortedCoursewareTest, self).setUp(is_staff=is_staff) self.staff_user = self.user self.content_group_a = "Content Group A" + XSS_INJECTION self.content_group_b = "Content Group B" + XSS_INJECTION # Creates the Course modes needed to test enrollment tracks add_enrollment_course_modes(self.browser, self.course_id, ["audit", "verified"]) # Create a student who will be in "Cohort A" self.cohort_a_student_username = "******" self.cohort_a_student_email = "*****@*****.**" AutoAuthPage( self.browser, username=self.cohort_a_student_username, email=self.cohort_a_student_email, no_login=True ).visit() # Create a student who will be in "Cohort B" self.cohort_b_student_username = "******" self.cohort_b_student_email = "*****@*****.**" AutoAuthPage( self.browser, username=self.cohort_b_student_username, email=self.cohort_b_student_email, no_login=True ).visit() # Create a Verified Student self.cohort_verified_student_username = "******" self.cohort_verified_student_email = "*****@*****.**" AutoAuthPage( self.browser, username=self.cohort_verified_student_username, email=self.cohort_verified_student_email, no_login=True ).visit() # Create audit student self.cohort_audit_student_username = "******" self.cohort_audit_student_email = "*****@*****.**" AutoAuthPage( self.browser, username=self.cohort_audit_student_username, email=self.cohort_audit_student_email, no_login=True ).visit() # Create a student who will end up in the default cohort group self.cohort_default_student_username = "******" self.cohort_default_student_email = "*****@*****.**" AutoAuthPage( self.browser, username=self.cohort_default_student_username, email=self.cohort_default_student_email, no_login=True ).visit() # Start logged in as the staff user. AutoAuthPage( self.browser, username=self.staff_user["username"], email=self.staff_user["email"] ).visit()
def setUp(self, is_staff=True): super(EndToEndCohortedCoursewareTest, self).setUp(is_staff=is_staff) self.staff_user = self.user self.content_group_a = "Content Group A" + XSS_INJECTION self.content_group_b = "Content Group B" + XSS_INJECTION # Creates the Course modes needed to test enrollment tracks add_enrollment_course_modes(self.browser, self.course_id, ["audit", "verified"]) # Create a student who will be in "Cohort A" self.cohort_a_student_username = "******" self.cohort_a_student_email = "*****@*****.**" StudioAutoAuthPage( self.browser, username=self.cohort_a_student_username, email=self.cohort_a_student_email, no_login=True ).visit() # Create a student who will be in "Cohort B" self.cohort_b_student_username = "******" self.cohort_b_student_email = "*****@*****.**" StudioAutoAuthPage( self.browser, username=self.cohort_b_student_username, email=self.cohort_b_student_email, no_login=True ).visit() # Create a Verified Student self.cohort_verified_student_username = "******" self.cohort_verified_student_email = "*****@*****.**" StudioAutoAuthPage( self.browser, username=self.cohort_verified_student_username, email=self.cohort_verified_student_email, no_login=True ).visit() # Create audit student self.cohort_audit_student_username = "******" self.cohort_audit_student_email = "*****@*****.**" StudioAutoAuthPage( self.browser, username=self.cohort_audit_student_username, email=self.cohort_audit_student_email, no_login=True ).visit() # Create a student who will end up in the default cohort group self.cohort_default_student_username = "******" self.cohort_default_student_email = "*****@*****.**" StudioAutoAuthPage( self.browser, username=self.cohort_default_student_username, email=self.cohort_default_student_email, no_login=True ).visit() # Start logged in as the staff user. StudioAutoAuthPage( self.browser, username=self.staff_user["username"], email=self.staff_user["email"] ).visit()
def test_one_course_mode(self): """ The purpose of this test is to ensure that when there is 1 or fewer course modes the enrollment track section is not shown. """ add_enrollment_course_modes(self.browser, self.course_id, ['audit']) group_configurations_page = GroupConfigurationsPage( self.browser, self.course_info['org'], self.course_info['number'], self.course_info['run']) group_configurations_page.visit() self.assertFalse( group_configurations_page.enrollment_track_section_present) groups = group_configurations_page.get_enrollment_groups() self.assertEqual(len(groups), 0)
def test_one_course_mode(self): """ The purpose of this test is to ensure that when there is 1 or fewer course modes the enrollment track section is not shown. """ add_enrollment_course_modes(self.browser, self.course_id, ['audit']) group_configurations_page = GroupConfigurationsPage( self.browser, self.course_info['org'], self.course_info['number'], self.course_info['run'] ) group_configurations_page.visit() self.assertFalse(group_configurations_page.enrollment_track_section_present) groups = group_configurations_page.get_enrollment_groups() self.assertEqual(len(groups), 0)
def test_disabling_cohorts_while_selected(self): """ Test that disabling cohorts does not hide the discussion tab when there is more than one enrollment track. Also that the division scheme for cohorts is visible iff it was selected. (even without reloading the page). """ add_enrollment_course_modes(self.browser, self.course_id, ['audit', 'verified']) # Verify that the tab is visible, the cohort scheme is selected by default for divided discussions self.disable_cohorting(self.course_fixture) # Go to Discussions tab and ensure that the correct scheme options are visible self.view_discussion_management_page() self.assertTrue( self.discussion_management_page.division_scheme_visible( self.discussion_management_page.COHORT_SCHEME))
def test_disabling_cohorts_while_selected(self): """ Test that disabling cohorts does not hide the discussion tab when there is more than one enrollment track. Also that the division scheme for cohorts is visible iff it was selected. (even without reloading the page). """ add_enrollment_course_modes(self.browser, self.course_id, ['audit', 'verified']) # Verify that the tab is visible, the cohort scheme is selected by default for divided discussions self.disable_cohorting(self.course_fixture) # Go to Discussions tab and ensure that the correct scheme options are visible self.view_discussion_management_page() self.assertTrue( self.discussion_management_page.division_scheme_visible( self.discussion_management_page.COHORT_SCHEME ) )
def test_all_course_modes_present(self): """ This test is meant to ensure that all the course modes show up as groups on the Group configuration page within the Enrollment Tracks section. It also checks to make sure that the edit buttons are not available. """ add_enrollment_course_modes(self.browser, self.course_id, ['audit', 'verified']) group_configurations_page = GroupConfigurationsPage( self.browser, self.course_info['org'], self.course_info['number'], self.course_info['run'] ) group_configurations_page.visit() self.assertTrue(group_configurations_page.enrollment_track_section_present) # Make sure the edit buttons are not available. self.assertFalse(group_configurations_page.enrollment_track_edit_present) groups = group_configurations_page.get_enrollment_groups() for g in [self.audit_track, self.verified_track]: self.assertTrue(g in groups)
def test_all_course_modes_present(self): """ This test is meant to ensure that all the course modes show up as groups on the Group configuration page within the Enrollment Tracks section. It also checks to make sure that the edit buttons are not available. """ add_enrollment_course_modes(self.browser, self.course_id, ['audit', 'verified']) group_configurations_page = GroupConfigurationsPage( self.browser, self.course_info['org'], self.course_info['number'], self.course_info['run'] ) group_configurations_page.visit() self.assertTrue(group_configurations_page.enrollment_track_section_present) # Make sure the edit buttons are not available. self.assertFalse(group_configurations_page.enrollment_track_edit_present) groups = group_configurations_page.get_enrollment_groups() for g in [self.audit_track, self.verified_track]: self.assertTrue(g in groups)
def test_disabling_cohorts_while_not_selected(self): """ Test that disabling cohorts does not hide the discussion tab when there is more than one enrollment track. Also that the division scheme for cohorts is not visible when cohorts are disabled and another scheme is selected for division. (even without reloading the page). """ add_enrollment_course_modes(self.browser, self.course_id, ['audit', 'verified']) # Verify that the tab is visible self.view_discussion_management_page() self.discussion_management_page.select_division_scheme( self.discussion_management_page.ENROLLMENT_TRACK_SCHEME) self.verify_save_confirmation_message(self.scheme_key) self.disable_cohorting(self.course_fixture) # Go to Discussions tab and ensure that the correct scheme options are visible self.view_discussion_management_page() self.assertFalse( self.discussion_management_page.division_scheme_visible( self.discussion_management_page.COHORT_SCHEME))
def test_disabling_cohorts_while_not_selected(self): """ Test that disabling cohorts does not hide the discussion tab when there is more than one enrollment track. Also that the division scheme for cohorts is not visible when cohorts are disabled and another scheme is selected for division. (even without reloading the page). """ add_enrollment_course_modes(self.browser, self.course_id, ['audit', 'verified']) # Verify that the tab is visible self.view_discussion_management_page() self.discussion_management_page.select_division_scheme(self.discussion_management_page.ENROLLMENT_TRACK_SCHEME) self.verify_save_confirmation_message(self.scheme_key) self.disable_cohorting(self.course_fixture) # Go to Discussions tab and ensure that the correct scheme options are visible self.view_discussion_management_page() self.assertFalse( self.discussion_management_page.division_scheme_visible( self.discussion_management_page.COHORT_SCHEME ) )