Skip to content

Commit 62e6399

Browse files
Revert "Removed hard coded values from test screening practitioner appointments"
This reverts commit fb901e0.
1 parent ea04c6a commit 62e6399

File tree

3 files changed

+15
-34
lines changed

3 files changed

+15
-34
lines changed

pages/colonoscopy_assessment_appointments_page.py

Lines changed: 0 additions & 12 deletions
This file was deleted.

pages/screening_practitioner_appointments.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,6 @@ def __init__(self, page: Page):
99
self.log_in_page = self.page.get_by_role("button", name="Log in")
1010
self.view_appointments_page = self.page.get_by_role("link", name="View appointments")
1111
self.patients_that_require_page = self.page.get_by_role("link", name="Patients that Require")
12-
# Greyed out links (not clickable due to user role permissions)
13-
self.patients_that_require_colonoscopy_assessment_appointments_bowel_scope_link = self.page.get_by_text("Patients that Require Colonoscopy Assessment Appointments - Bowel Scope")
14-
self.patients_that_require_surveillance_appointment_link = page.get_by_text("Patients that Require Surveillance Appointments")
15-
self.patients_that_require_post = page.get_by_text("Patients that Require Post-")
16-
self.set_availability_link = page.get_by_text("Set Availability")
1712

1813
def go_to_log_in_page(self)->None:
1914
self.click(self.log_in_page)
@@ -22,4 +17,4 @@ def go_to_view_appointments_page(self)->None:
2217
self.click(self.view_appointments_page)
2318

2419
def go_to_patients_that_require_page(self)->None:
25-
self.click(self.patients_that_require_page)
20+
self.click(self.view_appointments_page)
Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
import pytest
22
from playwright.sync_api import Page, expect
3+
from utils.click_helper import click
34
from pages.base_page import BasePage
4-
from pages.screening_practitioner_appointments import ScreeningPractitionerAppointmentsPage
5-
from pages.bowel_scope_appointments_page import BowelScopeAppointments
6-
from pages.colonoscopy_assessment_appointments_page import ColonoscopyAssessmentAppointments
75
from utils.user_tools import UserTools
86

97

@@ -27,21 +25,21 @@ def test_screening_practitioner_appointments_page_navigation(page: Page) -> None
2725
and clickable (where the user has required permissions).
2826
"""
2927
# Verify View appointments page opens as expected
30-
ScreeningPractitionerAppointmentsPage(page).go_to_view_appointments_page()
31-
BowelScopeAppointments(page).verify_page_title()
32-
BowelScopeAppointments(page).click_back_button()
28+
click(page, page.get_by_role("link", name="View appointments"))
29+
expect(page.locator("#ntshPageTitle")).to_contain_text("Appointment Calendar")
30+
click(page, page.get_by_role("link", name="Back"))
3331

3432
# Verify Patients that Require Colonoscopy Assessment Appointments page opens as expected
35-
ScreeningPractitionerAppointmentsPage(page).go_to_patients_that_require_page()
36-
ColonoscopyAssessmentAppointments(page).verify_page_header()
33+
click(page, page.get_by_role("link", name="Patients that Require"))
34+
expect(page.locator("#page-title")).to_contain_text("Patients that Require Colonoscopy Assessment Appointments")
35+
click(page, page.get_by_role("link", name="Back"))
3736

38-
ColonoscopyAssessmentAppointments(page).click_back_button()
39-
40-
expect(ScreeningPractitionerAppointmentsPage(page).patients_that_require_colonoscopy_assessment_appointments_bowel_scope_link).to_be_visible()
41-
expect(ScreeningPractitionerAppointmentsPage(page).patients_that_require_surveillance_appointment_link).to_be_visible()
42-
expect(ScreeningPractitionerAppointmentsPage(page).patients_that_require_post).to_be_visible()
43-
expect(ScreeningPractitionerAppointmentsPage(page).set_availability_link).to_be_visible()
37+
# Verify below links are visible (not clickable due to user role permissions)
38+
expect(page.get_by_text("Patients that Require Colonoscopy Assessment Appointments - Bowel Scope")).to_be_visible()
39+
expect(page.get_by_text("Patients that Require Surveillance Appointments")).to_be_visible()
40+
expect(page.get_by_text("Patients that Require Post-")).to_be_visible()
41+
expect(page.get_by_text("Set Availability")).to_be_visible()
4442

4543
# Return to main menu
46-
ScreeningPractitionerAppointmentsPage(page).click_main_menu_link()
47-
ScreeningPractitionerAppointmentsPage(page).main_menu_header_is_displayed()
44+
click(page, page.get_by_role("link", name="Main Menu"))
45+
expect(page.locator("#ntshPageTitle")).to_contain_text("Main Menu")

0 commit comments

Comments
 (0)