Skip to content

Commit e0b8154

Browse files
committed
wip
moved some logging from test files into the methods
1 parent c6bd8ce commit e0b8154

File tree

3 files changed

+5
-13
lines changed

3 files changed

+5
-13
lines changed

pages/screening_subject_search/subject_screening_summary_page.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,7 @@ def assert_subject_age(self, expected_age: int) -> None:
365365
assert (
366366
actual_age == expected_age
367367
), f"[AGE MISMATCH] Expected age {expected_age}, but found {actual_age} in UI."
368+
logging.info("[UI ASSERTIONS COMPLETE] Subject age checked in the UI")
368369

369370
def assert_screening_status(self, expected_status: str) -> None:
370371
"""
@@ -380,6 +381,7 @@ def assert_screening_status(self, expected_status: str) -> None:
380381
assert (
381382
actual_status.lower() == expected_status.lower()
382383
), f"[SCREENING STATUS MISMATCH] Expected '{expected_status}', but found '{actual_status}' in UI."
384+
logging.info("[UI ASSERTIONS COMPLETE] Subject screening status checked in the UI")
383385

384386
def assert_latest_event_status(self, expected_status: str) -> None:
385387
"""
@@ -395,6 +397,7 @@ def assert_latest_event_status(self, expected_status: str) -> None:
395397
assert (
396398
actual_status == expected_status
397399
), f"[LATEST EVENT STATUS MISMATCH] Expected '{expected_status}', but found '{actual_status}' in UI."
400+
logging.info("[UI ASSERTIONS COMPLETE] Subject latest event status checked in the UI")
398401

399402
def click_reopen_fobt_screening_episode_button(self) -> None:
400403
"""Click on the 'Reopen FOBT Screening Episode' button"""

tests/regression/regression_tests/fobt_regression_tests/test_scenario_2.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import logging
33
from datetime import datetime
44
from playwright.sync_api import Page
5-
from pages.communication_production.batch_list_page import ActiveBatchListPage
65
from utils.oracle.subject_creation_util import CreateSubjectSteps
76
from utils.user_tools import UserTools
87
from utils.subject_assertion import subject_assertion
@@ -13,7 +12,6 @@
1312
from pages.screening_subject_search.subject_screening_summary_page import (
1413
SubjectScreeningSummaryPage,
1514
)
16-
from pages.communication_production.batch_list_page import BatchListPage
1715
from pages.logout.log_out_page import LogoutPage
1816

1917

@@ -79,7 +77,6 @@ def test_scenario_2(page: Page) -> None:
7977
# Assert subject details in the UI
8078
summary_page.assert_subject_age(66)
8179
summary_page.assert_screening_status("Inactive")
82-
logging.info("[UI ASSERTIONS COMPLETE] Updated subject details checked in the UI")
8380

8481
# When I run the FOBT failsafe trawl for my subject
8582
CallAndRecallUtils().run_failsafe(nhs_no)
@@ -103,7 +100,6 @@ def test_scenario_2(page: Page) -> None:
103100

104101
# Assert subject details in the UI
105102
summary_page.assert_screening_status("Call")
106-
logging.info("[UI ASSERTIONS COMPLETE] Updated subject details checked in the UI")
107103

108104
# When I invite my subject for FOBT screening
109105
CallAndRecallUtils().invite_subject_for_fobt_screening(nhs_no, user_role)
@@ -170,7 +166,6 @@ def test_scenario_2(page: Page) -> None:
170166
summary_page.assert_latest_event_status(
171167
"S43 - Kit Returned and Logged (Initial Test)"
172168
)
173-
logging.info("[UI ASSERTIONS COMPLETE] Updated subject details checked in the UI")
174169

175170
# When I read my subject's latest logged FIT kit as "NORMAL"
176171
FitKitLogged().read_latest_logged_kit(user_role, 2, fit_kit, "NORMAL")
@@ -188,7 +183,6 @@ def test_scenario_2(page: Page) -> None:
188183

189184
# Assert subject details in the UI
190185
summary_page.assert_latest_event_status("S2 - Normal")
191-
logging.info("[UI ASSERTIONS COMPLETE] Updated subject details checked in the UI")
192186

193187
# And there is a "S2" letter batch for my subject with the exact title "Subject Result (Normal)"
194188
# When I process the open "S2" letter batch for my subject

tests/regression/regression_tests/fobt_regression_tests/test_scenario_4.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,6 @@ def test_scenario_4(page: Page) -> None:
7979
if nhs_no is None:
8080
pytest.fail("Failed to create subject: NHS number not returned.")
8181

82-
# And I pause for 5 seconds to let the process complete
83-
page.wait_for_timeout(5000)
84-
8582
# Then Comment: NHS number
8683
logging.info(f"[SUBJECT CREATED] NHS number: {nhs_no}")
8784

@@ -94,7 +91,7 @@ def test_scenario_4(page: Page) -> None:
9491
"screening status": "Inactive",
9592
},
9693
)
97-
94+
# Assert subject details in the UI
9895
screening_subject_page_searcher.navigate_to_subject_summary_page(page, nhs_no)
9996
summary_page.assert_subject_age(62)
10097
summary_page.assert_screening_status("Inactive")
@@ -116,15 +113,13 @@ def test_scenario_4(page: Page) -> None:
116113
},
117114
)
118115

116+
# Assert subject details in the UI
119117
screening_subject_page_searcher.navigate_to_subject_summary_page(page, nhs_no)
120118
summary_page.assert_screening_status("Call")
121119

122120
# When I invite my subject for FOBT screening
123121
CallAndRecallUtils().invite_subject_for_fobt_screening(nhs_no, user_role)
124122

125-
# And I pause for 5 seconds to let the process complete
126-
page.wait_for_timeout(5000)
127-
128123
# Then my subject has been updated as follows:
129124
subject_assertion(
130125
nhs_no,

0 commit comments

Comments
 (0)