Skip to content

Commit e1f99b5

Browse files
authored
Merge pull request #1019 from NHSDigital/follow-up-parent-journey
Add follow-up request question to parent journey
2 parents 92006f6 + d906179 commit e1f99b5

File tree

2 files changed

+27
-4
lines changed

2 files changed

+27
-4
lines changed

mavis/test/pages/online_consent_wizard_page.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,14 @@ def __init__(self, page: Page) -> None:
116116
name="My child can have either type of vaccine",
117117
)
118118
self.no_consent_radio = self.page.get_by_role("radio", name="No")
119+
self.follow_up_question_yes_radio = self.page.get_by_role(
120+
"radio",
121+
name="Yes, I would like someone to contact me",
122+
)
123+
self.follow_up_question_no_radio = self.page.get_by_role(
124+
"radio",
125+
name="No",
126+
)
119127

120128
@step("Click Continue")
121129
def click_continue(self) -> None:
@@ -318,6 +326,13 @@ def select_consent_not_given_reason(
318326

319327
self.click_continue()
320328

329+
def answer_follow_up_question(self, *, yes_to_follow_up_request: bool) -> None:
330+
if yes_to_follow_up_request:
331+
self.follow_up_question_yes_radio.check()
332+
else:
333+
self.follow_up_question_no_radio.check()
334+
self.click_continue()
335+
321336
def expect_confirmation_text(self, text: str) -> None:
322337
confirmation = self.page.locator(".nhsuk-panel.nhsuk-panel--confirmation")
323338
expect(confirmation).to_contain_text(text)

tests/test_online_consent_doubles.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,18 @@ def test_consent_refused_for_doubles_vaccination(
7777
[False, True],
7878
ids=lambda v: f"yes_to_health_questions: {v}",
7979
)
80+
@pytest.mark.parametrize(
81+
"yes_to_follow_up_request",
82+
[False, True],
83+
ids=lambda v: f"yes_to_follow_up_request: {v}",
84+
)
8085
def test_consent_given_for_doubles_vaccination(
8186
start_consent_with_session_scheduled,
8287
page,
8388
schools,
8489
programmes,
8590
yes_to_health_questions,
91+
yes_to_follow_up_request,
8692
children,
8793
):
8894
"""
@@ -94,7 +100,8 @@ def test_consent_given_for_doubles_vaccination(
94100
3. Fill in address details.
95101
4. Answer the required number of health questions, optionally marking one as 'yes'.
96102
5. If not both vaccines, select a reason for not giving consent to the other.
97-
6. Submit the consent form.
103+
6. Answer question about wanting a follow-up discussion for the refused vaccine.
104+
7. Submit the consent form.
98105
Verification:
99106
- Confirmation message is shown for the correct child, vaccines,
100107
and health question status.
@@ -119,13 +126,14 @@ def test_consent_given_for_doubles_vaccination(
119126
OnlineConsentWizardPage(page).select_consent_not_given_reason(
120127
ConsentRefusalReason.PERSONAL_CHOICE,
121128
)
129+
OnlineConsentWizardPage(page).answer_follow_up_question(
130+
yes_to_follow_up_request=yes_to_follow_up_request
131+
)
122132

123133
OnlineConsentWizardPage(page).click_confirm()
124134

125135
OnlineConsentWizardPage(page).check_final_consent_message(
126-
child,
127-
programmes=programmes,
128-
yes_to_health_questions=yes_to_health_questions,
136+
child, programmes=programmes, yes_to_health_questions=yes_to_health_questions
129137
)
130138

131139

0 commit comments

Comments
 (0)