Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 2 additions & 9 deletions mavis/test/pages/sessions.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@ def verify_search(self) -> None:
self.page.get_by_text("No children matching search criteria found"),
).to_be_visible()

def search_child(self, child: Child) -> None:
def search_and_click_child(self, child: Child) -> None:
self.search_for(str(child))
child_locator = self.page.get_by_role("link", name=str(child))
reload_until_element_is_visible(self.page, child_locator)
child_locator.click()

def search_child_that_should_not_exist(self, child: Child) -> None:
def search_for_child_that_should_not_exist(self, child: Child) -> None:
self.search_for(str(child))
child_locator = self.page.get_by_role("link", name=str(child))
expect(child_locator).not_to_be_visible()
Expand All @@ -79,13 +79,6 @@ def click_advanced_filters(self) -> None:
def check_archived_records_checkbox(self) -> None:
self.archived_records_checkbox.check()

@step("Click on child {1}")
def click_child(self, child: Child) -> None:
with self.page.expect_navigation():
self.page.get_by_role("heading", name=str(child)).get_by_role(
"link",
).first.click()

@step("Check box for year {1}")
def check_year_checkbox(self, year: int) -> None:
if year == 0:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_e2e_doubles.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def test_recording_doubles_vaccination_e2e(
sessions_overview_page.click_register_tab()
sessions_register_page.register_child_as_attending(str(child))
sessions_register_page.click_record_vaccinations_tab()
sessions_record_vaccinations_page.search_child(child)
sessions_record_vaccinations_page.search_and_click_child(child)

vaccination_record = VaccinationRecord(
child, Programme.MENACWY, menquadfi_batch_name
Expand Down
2 changes: 1 addition & 1 deletion tests/test_e2e_flu.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def test_recording_flu_vaccination_e2e(
sessions_overview_page.click_register_tab()
sessions_register_page.register_child_as_attending(str(child))
sessions_register_page.click_record_vaccinations_tab()
sessions_record_vaccinations_page.search_child(child)
sessions_record_vaccinations_page.search_and_click_child(child)

vaccination_record = VaccinationRecord(
child, Programme.FLU, batch_name, consent_option
Expand Down
2 changes: 1 addition & 1 deletion tests/test_e2e_hpv.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def test_recording_hpv_vaccination_e2e(
sessions_overview_page.click_register_tab()
sessions_register_page.register_child_as_attending(str(child))
sessions_register_page.click_record_vaccinations_tab()
sessions_record_vaccinations_page.search_child(child)
sessions_record_vaccinations_page.search_and_click_child(child)

vaccination_record = VaccinationRecord(child, Programme.HPV, gardasil_9_batch_name)
sessions_patient_page.set_up_vaccination(vaccination_record)
Expand Down
12 changes: 6 additions & 6 deletions tests/test_e2e_mmr.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def test_recording_mmr_vaccination_e2e_with_triage(
# Triage step added for MMR
sessions_search_page.click_session_for_programme_group(schools[0], Programme.MMR)
sessions_overview_page.click_triage_tab()
sessions_triage_page.search_child(child)
sessions_triage_page.search_and_click_child(child)
sessions_patient_page.click_programme_tab(Programme.MMR)
sessions_patient_page.triage_mmr_patient(ConsentOption.MMR_EITHER)
dashboard_page.navigate()
Expand All @@ -93,7 +93,7 @@ def test_recording_mmr_vaccination_e2e_with_triage(
sessions_overview_page.click_register_tab()
sessions_register_page.register_child_as_attending(str(child))
sessions_register_page.click_record_vaccinations_tab()
sessions_record_vaccinations_page.search_child(child)
sessions_record_vaccinations_page.search_and_click_child(child)

vaccination_record = VaccinationRecord(child, Programme.MMR, mmr_batch_name)
sessions_patient_page.set_up_vaccination(vaccination_record)
Expand Down Expand Up @@ -170,7 +170,7 @@ def test_verify_child_cannot_be_vaccinated_twice_for_mmr_on_same_day(
sessions_overview_page.click_register_tab()
sessions_register_page.register_child_as_attending(str(child))
sessions_register_page.click_record_vaccinations_tab()
sessions_record_vaccinations_page.search_child(child)
sessions_record_vaccinations_page.search_and_click_child(child)

vaccination_record = VaccinationRecord(child, Programme.MMR, mmr_batch_name)
sessions_patient_page.set_up_vaccination(vaccination_record)
Expand All @@ -181,7 +181,7 @@ def test_verify_child_cannot_be_vaccinated_twice_for_mmr_on_same_day(
dashboard_page.click_sessions()
sessions_search_page.click_session_for_programme_group(schools[0], Programme.MMR)
sessions_overview_page.click_record_vaccinations_tab()
sessions_record_vaccinations_page.search_child_that_should_not_exist(child)
sessions_record_vaccinations_page.search_for_child_that_should_not_exist(child)

dashboard_page.navigate()
log_in_page.log_out()
Expand Down Expand Up @@ -258,7 +258,7 @@ def test_recording_mmr_vaccination_e2e_with_imported_dose_one(
# Triage step added for MMR
sessions_search_page.click_session_for_programme_group(schools[0], Programme.MMR)
sessions_overview_page.click_triage_tab()
sessions_triage_page.search_child(child)
sessions_triage_page.search_and_click_child(child)
sessions_patient_page.click_programme_tab(Programme.MMR)
sessions_patient_page.triage_mmr_patient(ConsentOption.MMR_EITHER)
dashboard_page.navigate()
Expand All @@ -269,7 +269,7 @@ def test_recording_mmr_vaccination_e2e_with_imported_dose_one(
sessions_overview_page.click_register_tab()
sessions_register_page.register_child_as_attending(str(child))
sessions_register_page.click_record_vaccinations_tab()
sessions_record_vaccinations_page.search_child(child)
sessions_record_vaccinations_page.search_and_click_child(child)

vaccination_record = VaccinationRecord(child, Programme.MMR, mmr_batch_name)
sessions_patient_page.set_up_vaccination(vaccination_record)
Expand Down
28 changes: 14 additions & 14 deletions tests/test_nurse_consent.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def test_gillick_competence(

sessions_search_page.click_session_for_programme_group(school, Programme.HPV)
sessions_overview_page.click_consent_tab()
sessions_consent_page.click_child(child)
sessions_consent_page.search_and_click_child(child)
sessions_patient_page.click_programme_tab(Programme.HPV)
sessions_patient_page.click_assess_gillick_competence()

Expand Down Expand Up @@ -112,7 +112,7 @@ def test_gillick_competence_notes(

sessions_search_page.click_session_for_programme_group(school, Programme.HPV)
sessions_overview_page.click_consent_tab()
sessions_consent_page.click_child(child)
sessions_consent_page.search_and_click_child(child)
sessions_patient_page.click_programme_tab(Programme.HPV)
sessions_patient_page.click_assess_gillick_competence()

Expand Down Expand Up @@ -164,7 +164,7 @@ def test_invalid_consent(
sessions_search_page.click_session_for_programme_group(school, Programme.HPV)
sessions_overview_page.click_consent_tab()
sessions_consent_page.select_no_response()
sessions_consent_page.click_child(child)
sessions_consent_page.search_and_click_child(child)
sessions_patient_page.click_programme_tab(Programme.HPV)
sessions_patient_page.click_record_a_new_consent_response()

Expand All @@ -174,15 +174,15 @@ def test_invalid_consent(

sessions_consent_page.select_no_response()

sessions_consent_page.click_child(child)
sessions_consent_page.search_and_click_child(child)
sessions_patient_page.click_programme_tab(Programme.HPV)
sessions_patient_page.click_record_a_new_consent_response()
nurse_consent_wizard_page.select_parent(child.parents[1])
nurse_consent_wizard_page.select_consent_method(ConsentMethod.IN_PERSON)
nurse_consent_wizard_page.record_parent_refuse_consent()

sessions_consent_page.select_consent_refused()
sessions_consent_page.click_child(child)
sessions_consent_page.search_and_click_child(child)
sessions_patient_page.click_programme_tab(Programme.HPV)
sessions_patient_page.invalidate_parent_refusal(child.parents[1])
sessions_patient_page.click_session_activity_and_notes()
Expand Down Expand Up @@ -231,7 +231,7 @@ def test_parent_provides_consent_twice(
sessions_overview_page.click_consent_tab()
sessions_consent_page.select_no_response()

sessions_consent_page.click_child(child)
sessions_consent_page.search_and_click_child(child)
sessions_patient_page.click_programme_tab(Programme.HPV)
sessions_patient_page.click_record_a_new_consent_response()
nurse_consent_wizard_page.select_parent(child.parents[0])
Expand All @@ -241,7 +241,7 @@ def test_parent_provides_consent_twice(
)
sessions_consent_page.select_consent_given_filters_for_programme(Programme.HPV)

sessions_consent_page.click_child(child)
sessions_consent_page.search_and_click_child(child)
sessions_patient_page.click_programme_tab(Programme.HPV)
sessions_patient_page.click_record_a_new_consent_response()
nurse_consent_wizard_page.select_parent(child.parents[0])
Expand All @@ -250,7 +250,7 @@ def test_parent_provides_consent_twice(

sessions_consent_page.select_consent_refused()

sessions_consent_page.click_child(child)
sessions_consent_page.search_and_click_child(child)
sessions_patient_page.click_programme_tab(Programme.HPV)
sessions_vaccination_wizard_page.expect_consent_refused_text(child.parents[0])
sessions_patient_page.click_session_activity_and_notes()
Expand Down Expand Up @@ -299,7 +299,7 @@ def test_conflicting_consent_with_gillick_consent(
sessions_search_page.click_session_for_programme_group(school, Programme.HPV)
sessions_overview_page.click_consent_tab()
sessions_consent_page.select_no_response()
sessions_consent_page.click_child(child)
sessions_consent_page.search_and_click_child(child)
sessions_patient_page.click_programme_tab(Programme.HPV)
sessions_patient_page.click_record_a_new_consent_response()

Expand All @@ -308,7 +308,7 @@ def test_conflicting_consent_with_gillick_consent(
nurse_consent_wizard_page.record_parent_positive_consent()

sessions_consent_page.select_consent_given_filters_for_programme(Programme.HPV)
sessions_consent_page.click_child(child)
sessions_consent_page.search_and_click_child(child)
sessions_patient_page.click_programme_tab(Programme.HPV)
sessions_patient_page.click_record_a_new_consent_response()

Expand All @@ -318,7 +318,7 @@ def test_conflicting_consent_with_gillick_consent(

sessions_consent_page.select_conflicting_consent()

sessions_consent_page.click_child(child)
sessions_consent_page.search_and_click_child(child)
sessions_patient_page.click_programme_tab(Programme.HPV)
sessions_patient_page.expect_consent_status(Programme.HPV, "Conflicting consent")
sessions_patient_page.expect_conflicting_consent_text()
Expand All @@ -331,7 +331,7 @@ def test_conflicting_consent_with_gillick_consent(
nurse_consent_wizard_page.expect_text_in_alert(f"Consent recorded for {child!s}")

sessions_consent_page.select_consent_given_filters_for_programme(Programme.HPV)
sessions_consent_page.click_child(child)
sessions_consent_page.search_and_click_child(child)
sessions_patient_page.click_programme_tab(Programme.HPV)
sessions_patient_page.expect_consent_status(Programme.HPV, "Consent given")
sessions_patient_page.click_session_activity_and_notes()
Expand Down Expand Up @@ -367,7 +367,7 @@ def test_accessibility(
sessions_overview_page.click_consent_tab()
sessions_consent_page.select_no_response()

sessions_consent_page.click_child(child)
sessions_consent_page.search_and_click_child(child)
sessions_patient_page.click_programme_tab(Programme.HPV)
sessions_patient_page.click_record_a_new_consent_response()
accessibility_helper.check_accessibility()
Expand Down Expand Up @@ -401,7 +401,7 @@ def test_accessibility(
sessions_register_page.click_record_vaccinations_tab()
accessibility_helper.check_accessibility()

sessions_record_vaccinations_page.click_child(child)
sessions_record_vaccinations_page.search_and_click_child(child)
accessibility_helper.check_accessibility()

sessions_patient_page.confirm_pre_screening_checks(Programme.HPV)
Expand Down
4 changes: 2 additions & 2 deletions tests/test_psd.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def test_delivering_vaccination_after_psd(
sessions_edit_page.click_save_changes()

sessions_overview_page.click_consent_tab()
sessions_consent_page.search_child(child)
sessions_consent_page.search_and_click_child(child)
sessions_patient_page.click_programme_tab(Programme.FLU)
sessions_patient_page.click_record_a_new_consent_response()
nurse_consent_wizard_page.select_parent(child.parents[0])
Expand All @@ -144,7 +144,7 @@ def test_delivering_vaccination_after_psd(
sessions_overview_page.click_register_tab()
sessions_register_page.register_child_as_attending(str(child))
sessions_register_page.click_record_vaccinations_tab()
sessions_record_vaccinations_page.search_child(child)
sessions_record_vaccinations_page.search_and_click_child(child)

vaccination_record = VaccinationRecord(
child, Programme.FLU, fluenz_batch_name, ConsentOption.NASAL_SPRAY_OR_INJECTION
Expand Down
4 changes: 2 additions & 2 deletions tests/test_reset.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def test_pre_screening_questions_prefilled_for_multiple_vaccinations(
sessions_overview_page.click_register_tab()
sessions_register_page.register_child_as_attending(str(child))
sessions_register_page.click_consent_tab()
sessions_consent_page.search_child(child)
sessions_consent_page.search_and_click_child(child)
programmes = (
[Programme.MENACWY, Programme.TD_IPV]
if programme_group == "doubles"
Expand Down Expand Up @@ -128,7 +128,7 @@ def test_pre_screening_questions_prefilled_for_multiple_vaccinations(
target_length=MAVIS_NOTE_LENGTH_LIMIT + 1,
generate_spaced_words=True,
)
sessions_consent_page.search_child(child)
sessions_consent_page.search_and_click_child(child)
sessions_patient_page.set_up_vaccination(vaccination_record, notes=notes)
sessions_vaccination_wizard_page.record_vaccination(
vaccination_record, notes=notes
Expand Down
20 changes: 10 additions & 10 deletions tests/test_sessions.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def test_consent_filters(
"""
child = children[Programme.HPV][0]
sessions_overview_page.review_child_with_no_response()
sessions_consent_page.click_child(child)
sessions_consent_page.search_and_click_child(child)
sessions_patient_page.click_record_a_new_consent_response()

nurse_consent_wizard_page.select_parent(child.parents[0])
Expand Down Expand Up @@ -232,7 +232,7 @@ def test_session_activity_notes_order(
note_2 = "Note 2"

sessions_overview_page.click_consent_tab()
sessions_consent_page.search_child(child)
sessions_consent_page.search_and_click_child(child)
sessions_patient_page.click_session_activity_and_notes()
sessions_patient_session_activity_page.add_note(note_1)
sessions_patient_session_activity_page.add_note(note_2)
Expand All @@ -242,7 +242,7 @@ def test_session_activity_notes_order(
sessions_overview_page.click_consent_tab()
sessions_consent_page.search_for(str(child))
sessions_consent_page.check_note_appears_in_search(child, note_2)
sessions_consent_page.click_child(child)
sessions_consent_page.search_and_click_child(child)
sessions_patient_page.click_session_activity_and_notes()
sessions_patient_session_activity_page.check_notes_appear_in_order([note_2, note_1])

Expand Down Expand Up @@ -272,7 +272,7 @@ def test_triage_consent_given_and_triage_outcome(
school = schools[Programme.HPV][0]

sessions_overview_page.click_consent_tab()
sessions_consent_page.click_child(child)
sessions_consent_page.search_and_click_child(child)
sessions_patient_page.click_programme_tab(Programme.HPV)
sessions_patient_page.click_record_a_new_consent_response()

Expand All @@ -288,7 +288,7 @@ def test_triage_consent_given_and_triage_outcome(
sessions_search_page.click_session_for_programme_group(school, Programme.HPV)

sessions_overview_page.click_register_tab()
sessions_consent_page.click_child(child)
sessions_consent_page.search_and_click_child(child)
sessions_patient_page.click_programme_tab(Programme.HPV)
sessions_patient_page.click_update_triage_outcome()
sessions_patient_page.select_yes_safe_to_vaccinate()
Expand Down Expand Up @@ -318,7 +318,7 @@ def test_consent_refused_and_activity_log(
child = children[Programme.HPV][0]

sessions_overview_page.click_consent_tab()
sessions_consent_page.click_child(child)
sessions_consent_page.search_and_click_child(child)
sessions_patient_page.click_programme_tab(Programme.HPV)
sessions_patient_page.click_record_a_new_consent_response()

Expand All @@ -328,7 +328,7 @@ def test_consent_refused_and_activity_log(
nurse_consent_wizard_page.expect_text_in_alert(str(child))

sessions_consent_page.select_consent_refused()
sessions_consent_page.click_child(child)
sessions_consent_page.search_and_click_child(child)
sessions_patient_page.click_session_activity_and_notes()
sessions_patient_session_activity_page.check_session_activity_entry(
f"Consent refused by {child.parents[0].name_and_relationship}",
Expand Down Expand Up @@ -396,7 +396,7 @@ def test_verify_excel_export_and_clinic_invitation(
sessions_overview_page.click_register_tab()
sessions_register_page.register_child_as_attending(str(child))
sessions_register_page.click_record_vaccinations_tab()
sessions_record_vaccinations_page.search_child(child)
sessions_record_vaccinations_page.search_and_click_child(child)
vaccination_record = VaccinationRecord(child, Programme.HPV, batch_name)
sessions_patient_page.set_up_vaccination(vaccination_record)
sessions_vaccination_wizard_page.record_vaccination(
Expand Down Expand Up @@ -463,7 +463,7 @@ def test_editing_session_programmes(
sessions_edit_page.click_save_changes()
sessions_edit_page.expect_session_to_have_programmes([Programme.FLU, Programme.HPV])
sessions_overview_page.click_consent_tab()
sessions_consent_page.click_child(child)
sessions_consent_page.search_and_click_child(child)
sessions_patient_page.click_programme_tab(Programme.FLU)


Expand Down Expand Up @@ -522,7 +522,7 @@ def test_accessibility(
sessions_triage_page.click_register_tab()
accessibility_helper.check_accessibility()

sessions_register_page.click_child(child)
sessions_register_page.search_and_click_child(child)
accessibility_helper.check_accessibility()

sessions_patient_page.click_session_activity_and_notes()
Expand Down
Loading