def test_signup_failure_common_password(self): self.selenium.get(self.live_server_url) page = HomePage(self.selenium) page = submit_teacher_signup_form(page, password="******") assert page.has_teacher_signup_failed( "Password not strong enough, consider using at least 8 characters, upper and lower case letters, and numbers" )
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) 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', })
def test_edit_details_non_admin(self): email_1, password_1 = signup_teacher_directly() email_2, password_2 = signup_teacher_directly() name, postcode = create_organisation_directly(email_1) klass_1, class_name_1, access_code_1 = create_class_directly(email_1) create_school_student_directly(access_code_1) join_teacher_to_organisation(email_2, name, postcode) klass_2, class_name_2, access_code_2 = create_class_directly(email_2) create_school_student_directly(access_code_2) selenium.get(self.live_server_url) page = HomePage(selenium).go_to_login_page().login(email_2, password_2) page = page.change_teacher_details({ 'title': 'Mr', 'first_name': 'Florian', 'last_name': 'Aucomte', 'current_password': '******', }) assert self.is_dashboard_page(page) assert is_teacher_details_updated_message_showing(selenium) assert page.check_account_details({ 'title': 'Mr', 'first_name': 'Florian', 'last_name': 'Aucomte', })
def test_edit_details_non_admin(self): email_1, _ = signup_teacher_directly() email_2, password_2 = signup_teacher_directly() name, postcode = create_organisation_directly(email_1) _, _, access_code_1 = create_class_directly(email_1) create_school_student_directly(access_code_1) join_teacher_to_organisation(email_2, name, postcode) _, _, access_code_2 = create_class_directly(email_2) create_school_student_directly(access_code_2) self.selenium.get(self.live_server_url) page = HomePage(self.selenium).go_to_login_page().login(email_2, password_2) page = page.change_teacher_details( { "title": "Mr", "first_name": "Florian", "last_name": "Aucomte", "current_password": "******", } ) assert self.is_dashboard_page(page) assert is_teacher_details_updated_message_showing(self.selenium) assert page.check_account_details( {"title": "Mr", "first_name": "Florian", "last_name": "Aucomte"} )
def test_login_failure(self): selenium.get(self.live_server_url) page = HomePage(selenium) page = page.go_to_teach_page() page = page.login_failure('*****@*****.**', 'Incorrect password') assert page.has_login_failed() assert self.is_teach_page(page)
def test_login_failure(self): selenium.get(self.live_server_url) page = HomePage(selenium) page = page.go_to_login_page() page = page.login_failure('*****@*****.**', 'Incorrect password') assert page.has_login_failed()
def test_contact_fail(self): selenium.get(self.live_server_url) page = HomePage(selenium) page = page.go_to_help_and_support_page() page = page.send_empty_message() assert page.was_form_empty("contact_form")
def test_contact(self): selenium.get(self.live_server_url) page = HomePage(selenium) page = page.go_to_help_and_support_page() page = page.send_message() assert is_contact_message_sent_message_showing(selenium)
def test_accented_message(self): self.selenium.get(self.live_server_url) page = HomePage(self.selenium) page = page.go_to_help_and_support_page() page.send_accented_message() assert is_contact_message_sent_message_showing(self.selenium)
def test_login_success(self): email, password = signup_teacher_directly() create_organisation_directly(email) _, _, access_code = create_class_directly(email) create_school_student_directly(access_code) self.selenium.get(self.live_server_url) page = HomePage(self.selenium) page = page.go_to_login_page() page = page.login(email, password) assert self.is_dashboard_page(page)
def test_login_failure(self): self.selenium.get(self.live_server_url) page = HomePage(self.selenium) page = page.go_to_login_page() page = page.login_failure( "*****@*****.**", "Incorrect password" ) assert page.has_login_failed( "form-login-teacher", "Incorrect email address or password" )
def test_signup_duplicate_failure(self): self.selenium.get(self.live_server_url) page = HomePage(self.selenium) page, email, _ = signup_teacher(page) assert is_email_verified_message_showing(self.selenium) self.selenium.get(self.live_server_url) page = HomePage(self.selenium) page, _, _ = signup_duplicate_teacher_fail(page, email) assert page.__class__.__name__ == "LoginPage"
def test_login_success(self): selenium.get(self.live_server_url) page = HomePage(selenium) page, email, password = signup_teacher(page) page = page.login(email, password) assert self.is_teacher_dashboard(page) page = page.go_to_account_page() assert page.check_account_details({ 'title': 'Mr', 'first_name': 'Test', 'last_name': 'Teacher', })
def test_view_resources(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) page = HomePage(selenium) page = page.go_to_login_page() page = page.login(email, password) assert self.is_dashboard_page(page) page = page.go_to_resources_page().go_to_materials_page() assert self.is_materials_page(page) page = page.click_pdf_link() assert self.is_pdf_viewer_page(page) page = page.click_resources_button_link().go_to_materials_page() assert self.is_materials_page(page) keystages = ['ks1', 'lks2', 'uks2', 'ks3'] for ks in keystages: page = page.click_keystage_link(ks) assert self.is_materials_page(page)
def get_to_forgotten_password_page(self): self.selenium.get(self.live_server_url) page = ( HomePage(self.selenium) .go_to_login_page() .go_to_indep_forgotten_password_page() ) return page
def test_change_password(self): email, password = signup_teacher_directly() selenium.get(self.live_server_url) page = HomePage(selenium).go_to_teach_page().login(email, password) page = page.go_to_account_page() new_password = '******' page = page.change_teacher_details({ 'password': new_password, 'confirm_password': new_password, 'current_password': password, }) assert self.is_teacher_dashboard(page) assert is_teacher_details_updated_message_showing(selenium) page = page.logout().go_to_teach_page().login(email, new_password) assert self.is_teacher_dashboard(page)
def test_preview_user_cannot_create_empty_game(self): email, password = signup_teacher_directly_as_preview_user() create_organisation_directly(email, True) klass, name, access_code = create_class_directly(email) create_school_student_directly(access_code) self.selenium.get(self.live_server_url) page = HomePage(self.selenium).go_to_login_page().login(email, password) page = page.go_to_aimmo_home_page() page.click_create_new_game_button() page.input_new_game_name("") page.click_create_game_button() self.assertEqual( page.get_input_game_name_placeholder(), "Give your new game a name..." )
def test_edit_details(self): email, password = signup_teacher_directly() selenium.get(self.live_server_url) page = HomePage(selenium).go_to_teach_page().login(email, password) page = page.go_to_account_page() page = page.change_teacher_details({ 'title': 'Mrs', 'first_name': 'Paulina', 'last_name': 'Koch', 'current_password': '******', }) assert self.is_teacher_dashboard(page) assert is_teacher_details_updated_message_showing(selenium) page = page.go_to_account_page() assert page.check_account_details({ 'title': 'Mrs', 'first_name': 'Paulina', 'last_name': 'Koch', })
def test_change_email(self): email, password = signup_teacher_directly() create_organisation_directly(email) _, _, access_code = create_class_directly(email) create_school_student_directly(access_code) self.selenium.get(self.live_server_url) page = HomePage(self.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(self.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"} )
def test_preview_user_can_create_game(self): email, password = signup_teacher_directly_as_preview_user() create_organisation_directly(email, True) klass, name, access_code = create_class_directly(email) create_school_student_directly(access_code) self.selenium.get(self.live_server_url) page = HomePage(self.selenium).go_to_login_page().login(email, password) page = page.go_to_aimmo_home_page() page.click_create_new_game_button() page.input_new_game_name("Test Game") page.click_create_game_button() self.assertIn("/aimmo/play/1/", self.selenium.driver.current_url)
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) 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 test_edit_details(self): email, password = signup_teacher_directly() create_organisation_directly(email) _, _, access_code = create_class_directly(email) create_school_student_directly(access_code) self.selenium.get(self.live_server_url) page = HomePage(self.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(self.selenium) assert page.check_account_details( {"title": "Mrs", "first_name": "Paulina", "last_name": "Koch"} )
def test_reset_password(self): email, password = signup_teacher_directly() page = self.get_to_forgotten_password_page() page.reset_email_submit(email) self.wait_for_email() page = email_utils.follow_reset_email_link(selenium, mail.outbox[0]) new_password = '******' page.reset_password(new_password) selenium.get(self.live_server_url) page = HomePage(selenium).go_to_teach_page().login(email, new_password) assert self.is_teacher_dashboard(page)
def test_reset_password(self): email, _ = signup_teacher_directly() create_organisation_directly(email) _, _, access_code = create_class_directly(email) create_school_student_directly(access_code) page = self.get_to_forgotten_password_page() page.reset_email_submit(email) self.wait_for_email() page = email_utils.follow_reset_email_link(self.selenium, mail.outbox[0]) new_password = "******" page.teacher_reset_password(new_password) self.selenium.get(self.live_server_url) page = HomePage(self.selenium).go_to_login_page().login(email, new_password) assert self.is_dashboard_page(page)
def test_view_resources(self): email, password = signup_teacher_directly() create_organisation_directly(email) _, _, access_code = create_class_directly(email) create_school_student_directly(access_code) self.selenium.get(self.live_server_url) page = HomePage(self.selenium) page = page.go_to_login_page() page = page.login(email, password) assert self.is_dashboard_page(page) page = page.go_to_resources_page().go_to_materials_page() assert self.is_materials_page(page) page = page.click_pdf_link() assert self.is_pdf_viewer_page(page) page = page.click_resources_button_link().go_to_materials_page() assert self.is_materials_page(page)
def test_change_email(self): email, password = signup_teacher_directly() selenium.get(self.live_server_url) page = HomePage(selenium).go_to_teach_page().login(email, password) page = page.go_to_account_page() new_email = '*****@*****.**' page = page.change_email(new_email, password) assert page.__class__.__name__ == 'EmailVerificationNeededPage' assert is_teacher_email_updated_message_showing(selenium) page = email_utils.follow_change_email_link_to_teach( page, mail.outbox[0]) mail.outbox = [] page = page.login(new_email, password) page = page.go_to_account_page() assert page.check_account_details({ 'title': 'Mr', 'first_name': 'Test', 'last_name': 'Teacher', })
def test_change_email(self): email, password = signup_teacher_directly() selenium.get(self.live_server_url) page = HomePage(selenium).go_to_teach_page().login(email, password) page = page.go_to_account_page() new_email = '*****@*****.**' page = page.change_email(new_email, password) assert page.__class__.__name__ == 'EmailVerificationNeededPage' assert is_teacher_email_updated_message_showing(selenium) page = email_utils.follow_change_email_link_to_teach(page, mail.outbox[0]) mail.outbox = [] page = page.login(new_email, password) page = page.go_to_account_page() assert page.check_account_details({ 'title': 'Mr', 'first_name': 'Test', 'last_name': 'Teacher', })
def test_signup_login_success(self): self.selenium.get(self.live_server_url) page = HomePage(self.selenium) page, email, password = signup_teacher(page) page = page.login_no_school(email, password) assert self.is_onboarding_page(page)
def get_to_forgotten_password_page(self): selenium.get(self.live_server_url) page = HomePage(selenium) \ .go_to_teach_page()\ .go_to_forgotten_password_page() return page
def test_signup(self): selenium.get(self.live_server_url) page = HomePage(selenium) page, _, _ = signup_teacher(page) assert is_email_verified_message_showing(selenium)