Skip to content

Commit 38459fd

Browse files
committed
Worked on review comments
1 parent 58cc2ca commit 38459fd

File tree

4 files changed

+6
-12
lines changed

4 files changed

+6
-12
lines changed

classes/repositories/subject_repository.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from ast import Str
21
import logging
32
from typing import Optional
43
from classes.subject.pi_subject import PISubject

pages/base_page.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ def __init__(self, page: Page):
5757
"#ntshPageTitle"
5858
)
5959
self.main_menu_header = self.page.locator("#ntshPageTitle")
60-
self.surveillance = self.page.get_by_text("Surveillance", exact=True)
6160

6261
def click_main_menu_link(self) -> None:
6362
"""Click the Base Page 'Main Menu' link if it is visible."""
@@ -125,10 +124,6 @@ def click_help_link(self) -> None:
125124
"""Click the Base Page 'Help' link."""
126125
self.click(self.help_link)
127126

128-
def click_surveillance_link(self) -> None:
129-
"""Click the Surveillance Page link."""
130-
self.click(self.surveillance)
131-
132127
def bowel_cancer_screening_system_header_is_displayed(self) -> None:
133128
"""Asserts that the Bowel Cancer Screening System header is displayed."""
134129
expect(self.bowel_cancer_screening_system_header).to_contain_text(

tests/regression/regression_tests/surveillance_regression_tests/test_surveillance_scenario_1.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from playwright.sync_api import Page
33
from sqlalchemy import false
44
from classes.repositories.subject_repository import SubjectRepository
5+
from classes.subject import subject
56
from conftest import general_properties
67
from pages.base_page import BasePage
78
from pages.screening_practitioner_appointments.appointment_detail_page import (
@@ -274,6 +275,7 @@ def test_scenario_1(page: Page, general_properties: dict) -> None:
274275
"latest event status": "X615 Surveillance Appointment Invitation Letter Printed",
275276
},
276277
)
278+
277279
# When I view the subject
278280
screening_subject_page_searcher.navigate_to_subject_summary_page(page, nhs_no)
279281

@@ -391,7 +393,6 @@ def test_scenario_1(page: Page, general_properties: dict) -> None:
391393
"surveillance due date reason": "Reopened episode",
392394
}
393395
subject_assertion(nhs_no, criteria)
394-
395396
# When I view the subject
396397
screening_subject_page_searcher.navigate_to_subject_summary_page(page, nhs_no)
397398

@@ -442,7 +443,8 @@ def test_scenario_1(page: Page, general_properties: dict) -> None:
442443
# And I view the latest practitioner appointment in the subject's episode
443444
EpisodeEventsAndNotesPage(page).click_most_recent_view_appointment_link()
444445

445-
# And the Screening Centre reschedules the surveillance practitioner appointment to "today"-recheck this
446+
# And the Screening Centre reschedules the surveillance practitioner appointment to "today"
447+
446448
AppointmentDetailPage(page).click_reschedule_radio()
447449
AppointmentDetailPage(page).click_calendar_button()
448450
CalendarPicker(page).v2_calendar_picker(datetime.today())
@@ -457,6 +459,7 @@ def test_scenario_1(page: Page, general_properties: dict) -> None:
457459
},
458460
)
459461
# And there is a "X610" letter batch for my subject with the exact title "Surveillance Appointment Invitation Letter"
462+
460463
SubjectRepository().there_is_letter_batch_for_subject(
461464
nhs_no, "X610", "Surveillance Appointment Invitation Letter"
462465
)

utils/appointments.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import logging
2-
from typing import Optional
32
from playwright.sync_api import Page
43
from pages.base_page import BasePage
54
from pages.logout.log_out_page import LogoutPage
@@ -134,7 +133,7 @@ def book_appointments(page: Page, screening_centre: str, site: str) -> None:
134133

135134

136135
def book_post_investigation_appointment(
137-
page: Page, site: str, appointment_date: Optional[datetime] = None
136+
page: Page, site: str, appointment_date= datetime.today()
138137
) -> None:
139138
"""
140139
Book a post-investigation appointment for a subject.
@@ -147,8 +146,6 @@ def book_post_investigation_appointment(
147146
site (str): The name of the site.
148147
appointment_date (datetime, optional): The appointment date. Defaults to today.
149148
"""
150-
if appointment_date is None:
151-
appointment_date = datetime.today()
152149
book_appointments_page = BookAppointmentPage(page)
153150
book_appointments_page.select_site_dropdown_option(
154151
[

0 commit comments

Comments
 (0)