Skip to content

Commit 97104f8

Browse files
Feature/bcss 22022 surveillanceregressiontests scenario 9 (#161)
<!-- markdownlint-disable-next-line first-line-heading --> ## Description <!-- Describe your changes in detail. --> Completing scenario 9 from SurveillanceRegressionTests. Altering the click method to do less checks to reduce the number of 403 errors. Fixing spelling mistakes in method names. ## Context <!-- Why is this change required? What problem does it solve? --> Completing scenario 9 from SurveillanceRegressionTests. Altering the click method to do less checks to reduce the number of 403 errors. Fixing spelling mistakes in method names. ## Type of changes <!-- What types of changes does your code introduce? Put an `x` in all the boxes that apply. --> - [x] Refactoring (non-breaking change) - [x] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would change existing functionality) - [ ] Bug fix (non-breaking change which fixes an issue) ## Checklist <!-- Go over all the following points, and put an `x` in all the boxes that apply. --> - [x] I am familiar with the [contributing guidelines](https://github.com/nhs-england-tools/playwright-python-blueprint/blob/main/CONTRIBUTING.md) - [x] I have followed the code style of the project - [x] I have added tests to cover my changes (where appropriate) - [x] I have updated the documentation accordingly - [ ] This PR is a result of pair or mob programming --- ## Sensitive Information Declaration To ensure the utmost confidentiality and protect your and others privacy, we kindly ask you to NOT including [PII (Personal Identifiable Information) / PID (Personal Identifiable Data)](https://digital.nhs.uk/data-and-information/keeping-data-safe-and-benefitting-the-public) or any other sensitive data in this PR (Pull Request) and the codebase changes. We will remove any PR that do contain any sensitive information. We really appreciate your cooperation in this matter. - [x] I confirm that neither PII/PID nor sensitive data are included in this PR and the codebase changes.
1 parent a453f22 commit 97104f8

File tree

6 files changed

+476
-12
lines changed

6 files changed

+476
-12
lines changed

pages/base_page.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -219,10 +219,7 @@ def click(self, locator: Locator) -> None:
219219
alerts_table.wait_for(state="visible")
220220

221221
try:
222-
self.page.wait_for_load_state("load")
223222
self.page.wait_for_load_state("domcontentloaded")
224-
self.page.wait_for_load_state("networkidle")
225-
locator.wait_for(state="attached")
226223
locator.wait_for(state="visible")
227224
locator.click()
228225

pages/screening_subject_search/advance_episode_page.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ def __init__(self, page: Page):
3131
)
3232
self.calendar_button = self.page.get_by_role("button", name="Calendar")
3333
self.test_type_dropdown = self.page.locator("[id^='UI_EXT_TEST_TYPE_']")
34+
self.intended_extent_dropdown = self.page.locator(
35+
"[id^='UI_INTENDED_EXTENT_TYPE_']"
36+
)
3437
self.advance_checkbox_label = self.page.get_by_label(
3538
"There are some events available which should only be used in exceptional circumstances. If you wish to see them, check this box"
3639
)
@@ -178,6 +181,10 @@ def select_test_type_dropdown_option(self, text: str) -> None:
178181
"""Select the test type from the dropdown."""
179182
self.test_type_dropdown.select_option(label=text)
180183

184+
def select_intended_extent_dropdown_option(self, text: str) -> None:
185+
"""Select the intended extent from the dropdown."""
186+
self.intended_extent_dropdown.select_option(label=text)
187+
181188
def click_invite_for_diagnostic_test_button(self) -> None:
182189
"""Click the 'Invite for Diagnostic Test' button."""
183190
self.safe_accept_dialog(self.invite_for_diagnostic_test_button)

pages/screening_subject_search/subject_screening_summary_page.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def __init__(self, page: Page):
5959
self.first_fobt_episode_link = self.page.get_by_role(
6060
"link", name="FOBT Screening"
6161
).first
62-
self.first_surveillance_epsiode_link = self.page.get_by_role(
62+
self.first_surveillance_episode_link = self.page.get_by_role(
6363
"link", name="Surveillance"
6464
).first
6565
self.datasets_link = self.page.get_by_role("link", name="Datasets")
@@ -244,9 +244,9 @@ def click_first_fobt_episode_link(self) -> None:
244244
"""Click on the first FOBT episode link."""
245245
self.click(self.first_fobt_episode_link)
246246

247-
def click_first_surveillance_epsiode_link(self) -> None:
247+
def click_first_surveillance_episode_link(self) -> None:
248248
"""Click on the first Surveillance episode link."""
249-
self.click(self.first_surveillance_epsiode_link)
249+
self.click(self.first_surveillance_episode_link)
250250

251251
def click_datasets_link(self) -> None:
252252
"""Click on the 'Datasets' link."""

tests/regression/regression_tests/surveillance_regression_tests/test_surveillance_scenario_1.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ def test_scenario_1(page: Page, general_properties: dict) -> None:
280280

281281
# And I view the event history for the subject's latest episode
282282
SubjectScreeningSummaryPage(page).expand_episodes_list()
283-
SubjectScreeningSummaryPage(page).click_first_surveillance_epsiode_link()
283+
SubjectScreeningSummaryPage(page).click_first_surveillance_episode_link()
284284
# And I view the latest practitioner appointment in the subject's episode
285285
EpisodeEventsAndNotesPage(page).click_most_recent_view_appointment_link()
286286

@@ -437,7 +437,7 @@ def test_scenario_1(page: Page, general_properties: dict) -> None:
437437
screening_subject_page_searcher.navigate_to_subject_summary_page(page, nhs_no)
438438
# And I view the event history for the subject's latest episode
439439
SubjectScreeningSummaryPage(page).expand_episodes_list()
440-
SubjectScreeningSummaryPage(page).click_first_surveillance_epsiode_link()
440+
SubjectScreeningSummaryPage(page).click_first_surveillance_episode_link()
441441

442442
# And I view the latest practitioner appointment in the subject's episode
443443
EpisodeEventsAndNotesPage(page).click_most_recent_view_appointment_link()
@@ -480,7 +480,7 @@ def test_scenario_1(page: Page, general_properties: dict) -> None:
480480
screening_subject_page_searcher.navigate_to_subject_summary_page(page, nhs_no)
481481
# And I view the event history for the subject's latest episode
482482
SubjectScreeningSummaryPage(page).expand_episodes_list()
483-
SubjectScreeningSummaryPage(page).click_first_surveillance_epsiode_link()
483+
SubjectScreeningSummaryPage(page).click_first_surveillance_episode_link()
484484

485485
# And I view the latest practitioner appointment in the subject's episode
486486
EpisodeEventsAndNotesPage(page).click_most_recent_view_appointment_link()

tests/regression/regression_tests/surveillance_regression_tests/test_surveillance_scenario_2.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ def test_scenario_2(page: Page, general_properties: dict) -> None:
163163

164164
# And I view the event history for the subject's latest episode
165165
SubjectScreeningSummaryPage(page).expand_episodes_list()
166-
SubjectScreeningSummaryPage(page).click_first_surveillance_epsiode_link()
166+
SubjectScreeningSummaryPage(page).click_first_surveillance_episode_link()
167167

168168
# And I view the latest practitioner appointment in the subject's episode
169169
EpisodeEventsAndNotesPage(page).click_most_recent_view_appointment_link()
@@ -227,7 +227,7 @@ def test_scenario_2(page: Page, general_properties: dict) -> None:
227227

228228
# And I view the event history for the subject's latest episode
229229
SubjectScreeningSummaryPage(page).expand_episodes_list()
230-
SubjectScreeningSummaryPage(page).click_first_surveillance_epsiode_link()
230+
SubjectScreeningSummaryPage(page).click_first_surveillance_episode_link()
231231

232232
# And I view the latest practitioner appointment in the subject's episode
233233
EpisodeEventsAndNotesPage(page).click_most_recent_view_appointment_link()
@@ -404,7 +404,7 @@ def test_scenario_2(page: Page, general_properties: dict) -> None:
404404

405405
# And I view the event history for the subject's latest episode
406406
SubjectScreeningSummaryPage(page).expand_episodes_list()
407-
SubjectScreeningSummaryPage(page).click_first_surveillance_epsiode_link()
407+
SubjectScreeningSummaryPage(page).click_first_surveillance_episode_link()
408408

409409
# And I view the latest practitioner appointment in the subject's episode
410410
EpisodeEventsAndNotesPage(page).click_most_recent_view_appointment_link()

0 commit comments

Comments
 (0)