Skip to content

Commit 57734f1

Browse files
committed
increase wait time and verify everything is checked
1 parent cbcc50d commit 57734f1

File tree

2 files changed

+38
-1
lines changed

2 files changed

+38
-1
lines changed

mavis/test/pages/sessions/sessions_patient_page.py

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ def confirm_pre_screening_checks(
220220
expect(locator).to_be_visible()
221221

222222
# need to wait for checkbox to load properly
223-
time.sleep(1)
223+
time.sleep(3)
224224

225225
expect(self.pre_screening_checkbox).to_be_editable()
226226
self.pre_screening_checkbox.check()
@@ -282,13 +282,43 @@ def set_up_vaccination(
282282
self.select_ready_for_vaccination(vaccination_record.consent_option)
283283
if vaccination_record.consent_option is ConsentOption.INJECTION:
284284
self.select_delivery_site(vaccination_record.delivery_site)
285+
286+
self.verify_all_required_radios_and_checkboxes_selected(vaccination_record)
287+
285288
self.click_continue_button()
286289

287290
if len(notes) > MAVIS_NOTE_LENGTH_LIMIT:
288291
expect(self.notes_length_error).to_be_visible()
289292
self.pre_screening_notes.fill("Prescreening notes")
290293
self.click_continue_button()
291294

295+
@step("Verify all required radios/checkboxes are selected")
296+
def verify_all_required_radios_and_checkboxes_selected(
297+
self, vaccination_record: VaccinationRecord
298+
) -> None:
299+
child = vaccination_record.child
300+
301+
expect(self.pre_screening_checkbox).to_be_checked()
302+
303+
expect(
304+
self.page.get_by_role(
305+
"group",
306+
name=f"Has {child.first_name} confirmed their identity?",
307+
).get_by_label("Yes")
308+
).to_be_checked()
309+
310+
if vaccination_record.consent_option is ConsentOption.INJECTION:
311+
expect(self.ready_for_injection_radio).to_be_checked()
312+
else:
313+
expect(self.ready_for_nasal_spray_radio).to_be_checked()
314+
315+
if vaccination_record.consent_option is ConsentOption.INJECTION:
316+
expect(
317+
self.page.get_by_role(
318+
"radio", name=str(vaccination_record.delivery_site)
319+
)
320+
).to_be_checked()
321+
292322
@step("Click on Session activity and notes tab")
293323
def click_session_activity_and_notes(self) -> None:
294324
self._select_tab("Session activity and notes")

mavis/test/pages/sessions/sessions_vaccination_wizard_page.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ def __init__(self, page: Page) -> None:
2828
page.locator("div").filter(has_text="There is a problemEnter").nth(3)
2929
)
3030
self.continue_button = self.page.get_by_role("button", name="Continue")
31+
self.select_batch_heading = self.page.get_by_role(
32+
"heading", name="Which batch did you use?"
33+
)
3134

3235
@step("Click on Confirm")
3336
def click_confirm_button(self) -> None:
@@ -52,6 +55,10 @@ def choose_batch(self, batch_name: str) -> None:
5255

5356
self.page.wait_for_load_state()
5457

58+
expect(
59+
self.page.get_by_role("heading", name="Which batch did you use?")
60+
).to_be_visible()
61+
5562
reload_until_element_is_visible(
5663
self.page,
5764
batch_radio,

0 commit comments

Comments
 (0)