TNL-4412 user is not enrolled as a beta tester when account is unactivated.

This commit is contained in:
attiyaishaque
2017-04-18 20:03:11 +05:00
parent b06d5beddf
commit 4316731f70
7 changed files with 138 additions and 28 deletions

View File

@@ -213,6 +213,55 @@ class AutoEnrollmentWithCSVTest(BaseInstructorDashboardTest):
self.auto_enroll_section.a11y_audit.check_for_accessibility_errors()
class BatchBetaTestersTest(BaseInstructorDashboardTest):
"""
End-to-end tests for Batch beta testers functionality.
"""
def setUp(self):
super(BatchBetaTestersTest, self).setUp()
self.username = "test_{uuid}".format(uuid=self.unique_id[0:6])
self.email = "{user}@example.com".format(user=self.username)
AutoAuthPage(self.browser, username=self.username, email=self.email, is_active=False).visit()
self.course_fixture = CourseFixture(**self.course_info).install()
self.instructor_username = self.log_in_as_instructor()
instructor_dashboard_page = self.visit_instructor_dashboard()
self.batch_beta_tester_section = instructor_dashboard_page.select_membership().batch_beta_tester_addition()
self.inactive_user_message = 'These users could not be added as beta testers ' \
'because their accounts are not yet activated:'
def test_enroll_inactive_beta_tester(self):
"""
Scenario: On the Membership tab of the Instructor Dashboard, Batch Beta tester div is visible.
Given that I am on the Membership tab on the Instructor Dashboard
Then I enter the username and add it into beta testers.
Then I see the inactive user is not added in beta testers.
"""
self.batch_beta_tester_section.fill_batch_beta_tester_addition_text_box(self.username)
header_text, username = self.batch_beta_tester_section.get_notification_text()
self.assertIn(self.inactive_user_message, header_text[0])
self.assertEqual(self.username, username[0])
def test_enroll_active_and_inactive_beta_tester(self):
"""
Scenario: On the Membership tab of the Instructor Dashboard, Batch Beta tester div is visible.
Given that I am on the Membership tab on the Instructor Dashboard
Then I enter the active and inactive usernames and add it into beta testers.
Then I see the different messages related to active and inactive users.
"""
active_and_inactive_username = self.username + ',' + self.instructor_username[0]
self.batch_beta_tester_section.fill_batch_beta_tester_addition_text_box(active_and_inactive_username)
header_text, username = self.batch_beta_tester_section.get_notification_text()
# Verify that Inactive username and message.
self.assertIn(self.inactive_user_message, header_text[1])
self.assertEqual(self.username, username[1])
# Verify that active username and message.
self.assertIn('These users were successfully added as beta testers:', header_text[0])
self.assertEqual(self.instructor_username[0], username[0])
@attr(shard=10)
class ProctoredExamsTest(BaseInstructorDashboardTest):
"""