Example #1
0
    def test_deny_join(self):
        email_1, password_1 = signup_teacher_directly()
        email_2, password_2 = signup_teacher_directly()
        name, postcode = create_organisation_directly(email_1)
        _, class_name, access_code = create_class_directly(email_1)
        create_school_student_directly(access_code)

        selenium.get(self.live_server_url + "/portal/redesign/home")
        page = HomePage(selenium) \
            .go_to_login_page() \
            .login_no_school(email_2, password_2) \
            .join_organisation(name)

        assert page.__class__.__name__ == 'OnboardingRevokeRequestPage'

        page = page \
            .logout() \
            .go_to_login_page() \
            .login(email_1, password_1)

        assert page.has_join_request(email_2)
        page = page.deny_join_request()

        assert not page.has_join_request(email_2)

        page = page \
            .logout() \
            .go_to_login_page() \
            .login_no_school(email_2, password_2)

        assert page.__class__.__name__ == 'OnboardingOrganisationPage'
Example #2
0
    def test_create_clash(self):
        email_1, password_1 = signup_teacher_directly()
        email_2, password_2 = signup_teacher_directly()
        name, postcode = create_organisation_directly(email_1)

        selenium.get(self.live_server_url + "/portal/redesign/home")
        page = HomePage(selenium)\
            .go_to_login_page()\
            .login_no_school(email_2, password_2)\
            .create_organisation_failure(name, password_2, postcode)

        assert page.has_creation_failed()
Example #3
0
    def test_join(self):
        email_1, password_1 = signup_teacher_directly()
        email_2, password_2 = signup_teacher_directly()
        name, postcode = create_organisation_directly(email_1)

        selenium.get(self.live_server_url + "/portal/redesign/home")
        page = HomePage(selenium)\
            .go_to_login_page()\
            .login_no_school(email_2, password_2)\
            .join_organisation(name)

        assert page.__class__.__name__ == 'OnboardingRevokeRequestPage'
Example #4
0
    def test_edit_details(self):
        email, password = signup_teacher_directly()
        school_name, postcode = create_organisation_directly(email)
        _, class_name, access_code = create_class_directly(email)
        student_name, password, student = create_school_student_directly(
            access_code)

        selenium.get(self.live_server_url + "/portal/redesign/home")
        page = HomePage(selenium) \
            .go_to_login_page() \
            .login(email, password)

        assert page.check_organisation_details({
            'name': school_name,
            'postcode': postcode
        })

        new_name = 'new ' + school_name
        new_postcode = 'OX2 6LE'

        page.change_organisation_details({
            'name': new_name,
            'postcode': new_postcode
        })
        assert page.check_organisation_details({
            'name': new_name,
            'postcode': new_postcode
        })
    def test_change_email(self):
        email, password = signup_teacher_directly()
        create_organisation_directly(email)
        klass, name, access_code = create_class_directly(email)
        create_school_student_directly(access_code)

        selenium.get(self.live_server_url + "/portal/redesign/home")
        page = HomePage(selenium).go_to_login_page().login(email, password)

        new_email = '*****@*****.**'
        page = page.change_email('Test', 'Teacher', new_email, password)
        assert page.__class__.__name__ == 'EmailVerificationNeededPage'
        assert is_teacher_email_updated_message_showing(selenium)

        page = email_utils.follow_change_email_link_to_dashboard(
            page, mail.outbox[0])
        mail.outbox = []

        page = page.login(new_email, password)

        assert page.check_account_details({
            'title': 'Mr',
            'first_name': 'Test',
            'last_name': 'Teacher',
        })
Example #6
0
    def test_create_empty(self):
        email, password = signup_teacher_directly()

        selenium.get(self.live_server_url + "/portal/redesign/home")
        page = HomePage(selenium).go_to_login_page().login_no_school(
            email, password)

        page = page.create_organisation_empty()
        assert page.was_form_empty('form-create-organisation')
Example #7
0
    def test_create(self):
        email, password = signup_teacher_directly()

        selenium.get(self.live_server_url + "/portal/redesign/home")
        page = HomePage(selenium).go_to_login_page().login_no_school(
            email, password)

        page, name, postcode = create_organisation(page, password)
        assert is_organisation_created_message_showing(selenium, name)
Example #8
0
    def test_join_empty(self):
        email, password = signup_teacher_directly()

        selenium.get(self.live_server_url + "/portal/redesign/home")
        page = HomePage(selenium) \
            .go_to_login_page() \
            .login_no_school(email, password) \
            .join_empty_organisation()

        assert page.__class__.__name__ == 'OnboardingOrganisationPage'
 def test_login_success(self):
     email, password = signup_teacher_directly()
     create_organisation_directly(email)
     klass, name, access_code = create_class_directly(email)
     create_school_student_directly(access_code)
     selenium.get(self.live_server_url + "/portal/redesign/home")
     page = HomePage(selenium)
     page = page.go_to_login_page()
     page = page.login(email, password)
     assert self.is_dashboard_page(page)
Example #10
0
    def test_create_empty(self):
        email, password = signup_teacher_directly()
        create_organisation_directly(email)

        page = self.go_to_homepage() \
            .go_to_login_page() \
            .login_no_class(email, password) \
            .create_class_empty()

        assert page.was_form_empty('form-create-class')
    def test_create_empty(self):
        email, password = signup_teacher_directly()
        org_name, postcode = create_organisation_directly(email)
        _, class_name, access_code = create_class_directly(email)

        selenium.get(self.live_server_url + "/portal/redesign/home")
        page = HomePage(selenium).go_to_login_page().login_no_students(
            email, password).create_students_empty()

        assert page.was_form_empty('form-create-students')
Example #12
0
    def test_create(self):
        email, password = signup_teacher_directly()
        org_name, postcode = create_organisation_directly(email)
        _, class_name, access_code = create_class_directly(email)

        selenium.get(self.live_server_url + "/portal/redesign/home")
        page = HomePage(selenium).go_to_login_page().login_no_students(
            email, password)

        page, student_name = create_school_student(page)
        assert page.student_exists(student_name)
Example #13
0
    def test_create(self):
        email, password = signup_teacher_directly()
        create_organisation_directly(email)

        page = self.go_to_homepage() \
            .go_to_login_page() \
            .login_no_class(email, password)

        assert page.does_not_have_classes()

        page, class_name = create_class(page)
        assert is_class_created_message_showing(selenium, class_name)
Example #14
0
    def test_disable_2FA(self):
        email_1, password_1 = signup_teacher_directly()
        email_2, password_2 = signup_teacher_directly()
        name, postcode = create_organisation_directly(email_1)
        _, class_name, access_code = create_class_directly(email_1)
        create_school_student_directly(access_code)
        join_teacher_to_organisation(email_2, name, postcode)

        selenium.get(self.live_server_url + "/portal/redesign/home")
        page = HomePage(selenium) \
            .go_to_login_page() \
            .login(email_1, password_1)

        assert page.__class__.__name__ == 'TeachDashboardPage'

        page = page.click_make_admin_button().confirm_dialog()

        assert page.is_teacher_admin()

        page = page.click_make_non_admin_button()

        assert page.is_teacher_non_admin()
Example #15
0
    def test_create_dashboard(self):
        email, password = signup_teacher_directly()
        create_organisation_directly(email)
        klass, name, access_code = create_class_directly(email)
        create_school_student_directly(access_code)

        page = self.go_to_homepage() \
            .go_to_login_page() \
            .login(email, password)

        page, class_name = create_class(page)

        assert is_class_created_message_showing(selenium, class_name)
Example #16
0
    def test_multiple_schools(self):
        # There was a bug where join requests to school 35 say would go to school 3,
        # 62 would go to 6, etc... this test checks for that

        n = 12

        emails, passwords, names, postcodes = self.initialise_data(n)

        for i in range(n):
            emails[i], passwords[i] = signup_teacher_directly()
            names[i], postcodes[i] = create_organisation_directly(emails[i])

        email, password = signup_teacher_directly()

        selenium.get(self.live_server_url + "/portal/redesign/home")
        page = HomePage(selenium)\
            .go_to_login_page()\
            .login_no_school(email, password)

        page = page.join_organisation(names[n - 1])
        assert page.__class__.__name__ == 'OnboardingRevokeRequestPage'
        assert page.check_organisation_name(names[n - 1], postcodes[n - 1])
    def test_login_failure(self):
        email, password = signup_teacher_directly()
        create_organisation_directly(email)
        _, class_name, access_code = create_class_directly(email)
        student_name, student_password, _ = create_school_student_directly(
            access_code)

        selenium.get(self.live_server_url + "/portal/redesign/home")
        page = HomePage(selenium)\
            .go_to_login_page()\
            .student_login_failure(student_name, access_code, 'some other password')

        assert page.has_student_login_failed()
    def test_create_duplicate(self):
        email, password = signup_teacher_directly()
        org_name, postcode = create_organisation_directly(email)
        _, class_name, access_code = create_class_directly(email)

        student_name = 'bob'

        selenium.get(self.live_server_url + "/portal/redesign/home")
        page = HomePage(selenium).go_to_login_page().login_no_students(
            email, password)

        page = page.type_student_name(student_name).type_student_name(
            student_name).create_students_failure()
        assert page.adding_students_failed()
        assert page.duplicate_students(student_name)
Example #19
0
    def test_edit_clash(self):
        email_1, password_1 = signup_teacher_directly()
        email_2, password_2 = signup_teacher_directly()
        school_name_1, postcode_1 = create_organisation_directly(email_1)
        create_organisation_directly(email_2)
        _, class_name_1, access_code_1 = create_class_directly(email_1)
        _, class_name_2, access_code_2 = create_class_directly(email_2)
        create_school_student_directly(access_code_1)
        create_school_student_directly(access_code_2)

        selenium.get(self.live_server_url + "/portal/redesign/home")
        page = HomePage(selenium).go_to_login_page().login(email_2, password_2)

        assert not page.check_organisation_details({
            'name': school_name_1,
            'postcode': postcode_1
        })

        page = page.change_organisation_details({
            'name': school_name_1,
            'postcode': postcode_1
        })

        assert page.has_edit_failed()
Example #20
0
    def test_kick(self):
        email_1, password_1 = signup_teacher_directly()
        name, postcode = create_organisation_directly(email_1)
        _, class_name, access_code = create_class_directly(email_1)
        create_school_student_directly(access_code)

        title, first_name, last_name, email_2, password_2 = generate_details()

        new_last_name = "New Teacher"

        selenium.get(self.live_server_url + "/portal/redesign/home")
        page = HomePage(selenium) \
            .go_to_signup_page() \
            .signup(title, first_name, new_last_name, email_2, password_2, password_2)

        assert page.__class__.__name__ == 'EmailVerificationNeededPage'

        page = email_utils.follow_verify_email_link_to_onboarding(
            page, mail.outbox[0])
        mail.outbox = []

        page = page.login_no_school(email_2,
                                    password_2).join_organisation(name)

        assert page.__class__.__name__ == 'OnboardingRevokeRequestPage'

        page = page \
            .logout() \
            .go_to_login_page() \
            .login(email_1, password_1)

        page = page.accept_join_request()

        assert page.is_teacher_in_school(new_last_name)

        page = page.click_kick_button().confirm_dialog()

        assert page.is_not_teacher_in_school(new_last_name)
    def test_edit_details(self):
        email, password = signup_teacher_directly()
        create_organisation_directly(email)
        klass, name, access_code = create_class_directly(email)
        create_school_student_directly(access_code)

        selenium.get(self.live_server_url + "/portal/redesign/home")
        page = HomePage(selenium).go_to_login_page().login(email, password)

        page = page.change_teacher_details({
            'title': 'Mrs',
            'first_name': 'Paulina',
            'last_name': 'Koch',
            'current_password': '******',
        })
        assert self.is_dashboard_page(page)
        assert is_teacher_details_updated_message_showing(selenium)

        assert page.check_account_details({
            'title': 'Mrs',
            'first_name': 'Paulina',
            'last_name': 'Koch',
        })
 def setUpTestData(cls):
     cls.email, cls.password = signup_teacher_directly()
     _, _, cls.class_access_code = create_class_directly(cls.email)