Skip to content

Commit 1c749f9

Browse files
committed
remove main text expectations from programmes page
1 parent 659a6bd commit 1c749f9

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

mavis/test/pages/consent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ def parent_written_positive(
425425
def update_triage_outcome_positive(self):
426426
self.click_safe_to_vaccinate()
427427
self.click_save_triage()
428-
expect(self.page.get_by_role("main")).to_contain_text("Triage outcome updated")
428+
self.expect_text_in_alert("Triage outcome updated")
429429

430430
def parent_phone_positive(
431431
self, parent: Parent, consent_option: ConsentOption = ConsentOption.INJECTION

mavis/test/pages/programmes.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,9 @@ def click_use_duplicate(self):
122122
def click_resolve_duplicate(self):
123123
self.resolve_duplicate_button.click()
124124

125+
def expect_alert_text(self, text: str):
126+
expect(self.page.get_by_role("alert")).to_contain_text(text)
127+
125128
@step("Click on Download vaccination report")
126129
def click_download_report(self):
127130
self.download_report_button.click()
@@ -170,9 +173,3 @@ def _download_and_verify_report_headers(self, expected_headers: str):
170173
assert False, (
171174
f"The following expected field(s) were not found in the report: {_e_not_a}. Report contains extra field(s), which were not expected: {_a_not_e}."
172175
)
173-
174-
def expect_text(self, text: str):
175-
expect(self.page.get_by_role("main")).to_contain_text(text)
176-
177-
def expect_to_not_see_text(self, text: str):
178-
expect(self.page.get_by_role("main")).not_to_contain_text(text)

tests/test_programmes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ def test_rav_edit_dose_to_not_given(
278278
programmes_page.click_they_refused_it()
279279
programmes_page.click_continue()
280280
programmes_page.click_save_changes()
281-
programmes_page.expect_to_not_see_text("Sorry, there’s a problem with the service")
281+
programmes_page.expect_alert_text("Vaccination outcome recorded for HPV")
282282

283283

284284
@pytest.mark.rav

0 commit comments

Comments
 (0)