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
4 changes: 2 additions & 2 deletions mavis/test/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
nurse,
nurse_consent_wizard_page,
onboarding,
online_consent_page,
online_consent_wizard_page,
organisation,
prescriber,
programme_children_page,
Expand Down Expand Up @@ -127,7 +127,7 @@
"nurse",
"nurse_consent_wizard_page",
"onboarding",
"online_consent_page",
"online_consent_wizard_page",
"organisation",
"prescriber",
"programme_children_page",
Expand Down
4 changes: 2 additions & 2 deletions mavis/test/fixtures/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
log_out_page,
match_consent_response_page,
nurse_consent_wizard_page,
online_consent_page,
online_consent_wizard_page,
programme_children_page,
programme_overview_page,
programme_sessions_page,
Expand Down Expand Up @@ -132,7 +132,7 @@
"nurse",
"nurse_consent_wizard_page",
"onboarding",
"online_consent_page",
"online_consent_wizard_page",
"organisation",
"prescriber",
"programme_children_page",
Expand Down
6 changes: 3 additions & 3 deletions mavis/test/fixtures/pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
LogOutPage,
MatchConsentResponsePage,
NurseConsentWizardPage,
OnlineConsentPage,
OnlineConsentWizardPage,
ProgrammeChildrenPage,
ProgrammeOverviewPage,
ProgrammeSessionsPage,
Expand Down Expand Up @@ -158,8 +158,8 @@ def match_consent_response_page(page: Page) -> MatchConsentResponsePage:


@pytest.fixture
def online_consent_page(page: Page) -> OnlineConsentPage:
return OnlineConsentPage(page)
def online_consent_wizard_page(page: Page) -> OnlineConsentWizardPage:
return OnlineConsentWizardPage(page)


@pytest.fixture
Expand Down
4 changes: 2 additions & 2 deletions mavis/test/pages/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from .import_records import ImportRecordsWizardPage, ImportsPage
from .log_in import LogInPage, LogOutPage
from .nurse_consent import GillickCompetencePage, NurseConsentWizardPage
from .online_consent import OnlineConsentPage
from .online_consent import OnlineConsentWizardPage
from .programmes import (
ProgrammeChildrenPage,
ProgrammeOverviewPage,
Expand Down Expand Up @@ -68,7 +68,7 @@
"LogOutPage",
"MatchConsentResponsePage",
"NurseConsentWizardPage",
"OnlineConsentPage",
"OnlineConsentWizardPage",
"ProgrammeChildrenPage",
"ProgrammeOverviewPage",
"ProgrammeSessionsPage",
Expand Down
2 changes: 1 addition & 1 deletion mavis/test/pages/online_consent.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
)


class OnlineConsentPage:
class OnlineConsentWizardPage:
def __init__(self, page: Page) -> None:
self.page = page

Expand Down
24 changes: 12 additions & 12 deletions tests/test_consent_responses.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def online_consent_url(schedule_session_and_get_consent_url, schools):
def give_online_consent(
page,
start_page,
online_consent_page,
online_consent_wizard_page,
online_consent_url,
children,
schools,
Expand All @@ -34,18 +34,18 @@ def give_online_consent(

page.goto(online_consent_url)
start_page.start()
online_consent_page.fill_details(child, child.parents[0], schools)
online_consent_page.agree_to_hpv_vaccination()
online_consent_page.fill_address_details(*child.address)
online_consent_page.answer_health_questions(4, yes_to_health_questions=False)
online_consent_page.click_confirm()
online_consent_wizard_page.fill_details(child, child.parents[0], schools)
online_consent_wizard_page.agree_to_hpv_vaccination()
online_consent_wizard_page.fill_address_details(*child.address)
online_consent_wizard_page.answer_health_questions(4, yes_to_health_questions=False)
online_consent_wizard_page.click_confirm()


@pytest.fixture
def give_online_consent_pds_child(
page,
start_page,
online_consent_page,
online_consent_wizard_page,
online_consent_url,
pds_child,
schools,
Expand All @@ -55,11 +55,11 @@ def give_online_consent_pds_child(

page.goto(online_consent_url)
start_page.start()
online_consent_page.fill_details(child, child.parents[0], schools)
online_consent_page.agree_to_hpv_vaccination()
online_consent_page.fill_address_details(*child.address)
online_consent_page.answer_health_questions(4, yes_to_health_questions=False)
online_consent_page.click_confirm()
online_consent_wizard_page.fill_details(child, child.parents[0], schools)
online_consent_wizard_page.agree_to_hpv_vaccination()
online_consent_wizard_page.fill_address_details(*child.address)
online_consent_wizard_page.answer_health_questions(4, yes_to_health_questions=False)
online_consent_wizard_page.click_confirm()


@pytest.fixture
Expand Down
18 changes: 9 additions & 9 deletions tests/test_e2e_doubles.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def setup_session_for_doubles(setup_session_and_batches_with_fixed_child):
def test_recording_doubles_vaccination_e2e(
doubles_consent_url,
setup_session_for_doubles,
online_consent_page,
online_consent_wizard_page,
sessions_search_page,
sessions_overview_page,
sessions_register_page,
Expand Down Expand Up @@ -57,26 +57,26 @@ def test_recording_doubles_vaccination_e2e(
revaxis_batch_name = setup_session_for_doubles[Vaccine.REVAXIS]

number_of_health_questions = (
online_consent_page.get_number_of_health_questions_for_programmes(
online_consent_wizard_page.get_number_of_health_questions_for_programmes(
[Programme.MENACWY, Programme.TD_IPV],
)
)

online_consent_page.go_to_url(doubles_consent_url)
online_consent_wizard_page.go_to_url(doubles_consent_url)
start_page.start()

online_consent_page.fill_details(child, child.parents[0], schools)
online_consent_page.agree_to_doubles_vaccinations(
online_consent_wizard_page.fill_details(child, child.parents[0], schools)
online_consent_wizard_page.agree_to_doubles_vaccinations(
Programme.MENACWY,
Programme.TD_IPV,
)
online_consent_page.fill_address_details(*child.address)
online_consent_page.answer_health_questions(
online_consent_wizard_page.fill_address_details(*child.address)
online_consent_wizard_page.answer_health_questions(
number_of_health_questions,
yes_to_health_questions=False,
)
online_consent_page.click_confirm()
online_consent_page.check_final_consent_message(
online_consent_wizard_page.click_confirm()
online_consent_wizard_page.check_final_consent_message(
child,
programmes=[Programme.MENACWY, Programme.TD_IPV],
yes_to_health_questions=False,
Expand Down
20 changes: 11 additions & 9 deletions tests/test_e2e_flu.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def setup_session_for_flu(setup_session_and_batches_with_fixed_child):
def test_recording_flu_vaccination_e2e(
flu_consent_url,
setup_session_for_flu,
online_consent_page,
online_consent_wizard_page,
sessions_search_page,
sessions_overview_page,
sessions_register_page,
Expand Down Expand Up @@ -74,18 +74,20 @@ def test_recording_flu_vaccination_e2e(
else batch_names[Vaccine.FLUENZ]
)

online_consent_page.go_to_url(flu_consent_url)
online_consent_wizard_page.go_to_url(flu_consent_url)
start_page.start()

online_consent_page.fill_details(child, child.parents[0], schools)
online_consent_page.agree_to_flu_vaccination(consent_option=consent_option)
online_consent_page.fill_address_details(*child.address)
online_consent_page.answer_health_questions(
online_consent_page.get_number_of_health_questions_for_flu(consent_option),
online_consent_wizard_page.fill_details(child, child.parents[0], schools)
online_consent_wizard_page.agree_to_flu_vaccination(consent_option=consent_option)
online_consent_wizard_page.fill_address_details(*child.address)
online_consent_wizard_page.answer_health_questions(
online_consent_wizard_page.get_number_of_health_questions_for_flu(
consent_option
),
yes_to_health_questions=False,
)
online_consent_page.click_confirm()
online_consent_page.check_final_consent_message(
online_consent_wizard_page.click_confirm()
online_consent_wizard_page.check_final_consent_message(
child,
programmes=[Programme.FLU],
yes_to_health_questions=False,
Expand Down
16 changes: 8 additions & 8 deletions tests/test_e2e_hpv.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def setup_session_for_hpv(setup_session_and_batches_with_fixed_child):
def test_recording_hpv_vaccination_e2e(
hpv_consent_url,
setup_session_for_hpv,
online_consent_page,
online_consent_wizard_page,
sessions_search_page,
sessions_overview_page,
sessions_register_page,
Expand Down Expand Up @@ -53,18 +53,18 @@ def test_recording_hpv_vaccination_e2e(
gardasil_9_batch_name = setup_session_for_hpv[Vaccine.GARDASIL_9]
number_of_health_questions = len(Programme.health_questions(Programme.HPV))

online_consent_page.go_to_url(hpv_consent_url)
online_consent_wizard_page.go_to_url(hpv_consent_url)
start_page.start()

online_consent_page.fill_details(child, child.parents[0], schools)
online_consent_page.agree_to_hpv_vaccination()
online_consent_page.fill_address_details(*child.address)
online_consent_page.answer_health_questions(
online_consent_wizard_page.fill_details(child, child.parents[0], schools)
online_consent_wizard_page.agree_to_hpv_vaccination()
online_consent_wizard_page.fill_address_details(*child.address)
online_consent_wizard_page.answer_health_questions(
number_of_health_questions,
yes_to_health_questions=False,
)
online_consent_page.click_confirm()
online_consent_page.check_final_consent_message(
online_consent_wizard_page.click_confirm()
online_consent_wizard_page.check_final_consent_message(
child,
programmes=[Programme.HPV],
yes_to_health_questions=False,
Expand Down
50 changes: 26 additions & 24 deletions tests/test_e2e_mmr.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def setup_session_for_mmr(setup_session_and_batches_with_fixed_child):
def test_recording_mmr_vaccination_e2e_with_triage(
url_with_mmr_session_scheduled,
setup_session_for_mmr,
online_consent_page,
online_consent_wizard_page,
sessions_search_page,
sessions_overview_page,
sessions_register_page,
Expand Down Expand Up @@ -57,18 +57,18 @@ def test_recording_mmr_vaccination_e2e_with_triage(
Programme.health_questions(Programme.MMR, ConsentOption.MMR_EITHER)
)

online_consent_page.go_to_url(url_with_mmr_session_scheduled)
online_consent_wizard_page.go_to_url(url_with_mmr_session_scheduled)
start_page.start()

online_consent_page.fill_details(child, child.parents[0], schools)
online_consent_page.agree_to_mmr_vaccination(ConsentOption.MMR_EITHER)
online_consent_page.fill_address_details(*child.address)
online_consent_page.answer_health_questions(
online_consent_wizard_page.fill_details(child, child.parents[0], schools)
online_consent_wizard_page.agree_to_mmr_vaccination(ConsentOption.MMR_EITHER)
online_consent_wizard_page.fill_address_details(*child.address)
online_consent_wizard_page.answer_health_questions(
number_of_health_questions,
yes_to_health_questions=True,
)
online_consent_page.click_confirm()
online_consent_page.check_final_consent_message(
online_consent_wizard_page.click_confirm()
online_consent_wizard_page.check_final_consent_message(
child,
programmes=[Programme.MMR],
yes_to_health_questions=True,
Expand Down Expand Up @@ -106,7 +106,7 @@ def test_recording_mmr_vaccination_e2e_with_triage(
def test_verify_child_cannot_be_vaccinated_twice_for_mmr_on_same_day(
url_with_mmr_session_scheduled,
setup_session_for_mmr,
online_consent_page,
online_consent_wizard_page,
sessions_search_page,
sessions_overview_page,
sessions_register_page,
Expand Down Expand Up @@ -143,18 +143,20 @@ def test_verify_child_cannot_be_vaccinated_twice_for_mmr_on_same_day(
Programme.health_questions(Programme.MMR, ConsentOption.MMR_WITHOUT_GELATINE)
)

online_consent_page.go_to_url(url_with_mmr_session_scheduled)
online_consent_wizard_page.go_to_url(url_with_mmr_session_scheduled)
start_page.start()

online_consent_page.fill_details(child, child.parents[0], schools)
online_consent_page.agree_to_mmr_vaccination(ConsentOption.MMR_WITHOUT_GELATINE)
online_consent_page.fill_address_details(*child.address)
online_consent_page.answer_health_questions(
online_consent_wizard_page.fill_details(child, child.parents[0], schools)
online_consent_wizard_page.agree_to_mmr_vaccination(
ConsentOption.MMR_WITHOUT_GELATINE
)
online_consent_wizard_page.fill_address_details(*child.address)
online_consent_wizard_page.answer_health_questions(
number_of_health_questions,
yes_to_health_questions=False,
)
online_consent_page.click_confirm()
online_consent_page.check_final_consent_message(
online_consent_wizard_page.click_confirm()
online_consent_wizard_page.check_final_consent_message(
child,
programmes=[Programme.MMR],
yes_to_health_questions=False,
Expand Down Expand Up @@ -190,7 +192,7 @@ def test_verify_child_cannot_be_vaccinated_twice_for_mmr_on_same_day(
def test_recording_mmr_vaccination_e2e_with_imported_dose_one(
url_with_mmr_session_scheduled,
setup_session_for_mmr,
online_consent_page,
online_consent_wizard_page,
sessions_search_page,
sessions_overview_page,
sessions_register_page,
Expand Down Expand Up @@ -234,18 +236,18 @@ def test_recording_mmr_vaccination_e2e_with_imported_dose_one(
log_in_page.log_out()

# Proceed with consent and vaccination process
online_consent_page.go_to_url(url_with_mmr_session_scheduled)
online_consent_wizard_page.go_to_url(url_with_mmr_session_scheduled)
start_page.start()

online_consent_page.fill_details(child, child.parents[0], schools)
online_consent_page.agree_to_mmr_vaccination(ConsentOption.MMR_EITHER)
online_consent_page.fill_address_details(*child.address)
online_consent_page.answer_health_questions(
online_consent_wizard_page.fill_details(child, child.parents[0], schools)
online_consent_wizard_page.agree_to_mmr_vaccination(ConsentOption.MMR_EITHER)
online_consent_wizard_page.fill_address_details(*child.address)
online_consent_wizard_page.answer_health_questions(
number_of_health_questions,
yes_to_health_questions=True,
)
online_consent_page.click_confirm()
online_consent_page.check_final_consent_message(
online_consent_wizard_page.click_confirm()
online_consent_wizard_page.check_final_consent_message(
child,
programmes=[Programme.MMR],
yes_to_health_questions=True,
Expand Down
Loading