Skip to content

Commit 58dad02

Browse files
committed
Addressing code review comments
1 parent 1e27e7d commit 58dad02

File tree

3 files changed

+9
-33
lines changed

3 files changed

+9
-33
lines changed

pages/communication_production/batch_list_page.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -210,12 +210,9 @@ def select_first_batch_row(self, table_selector: str, timeout_ms: int = 0) -> No
210210
def navigate_to_active_batch_list_page(self) -> None:
211211
"""
212212
Navigates to the active batch list page from anywhere in bcss (providing the main menu link is displayed).
213-
214-
Args:
215-
page (Page): The Playwright page object.
216213
"""
217-
BasePage(self.page).click_main_menu_link()
218-
BasePage(self.page).go_to_communications_production_page()
214+
self.click_main_menu_link()
215+
self.go_to_communications_production_page()
219216
CommunicationsProductionPage(self.page).go_to_active_batch_list_page()
220217

221218

tests/regression/regression_tests/fobt_regression_tests/test_scenario_2.py

Lines changed: 6 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,11 @@
1414
SubjectScreeningSummaryPage,
1515
)
1616
from pages.communication_production.batch_list_page import BatchListPage
17+
from pages.logout.log_out_page import LogoutPage
1718

1819

20+
@pytest.mark.vpn_required
21+
@pytest.mark.regression
1922
@pytest.mark.fobt_regression_tests
2023
def test_scenario_2(page: Page) -> None:
2124
"""
@@ -69,7 +72,6 @@ def test_scenario_2(page: Page) -> None:
6972
"screening status": "Inactive",
7073
},
7174
)
72-
logging.info("[DB ASSERTIONS COMPLETE] Created subject details checked in the DB")
7375

7476
# Navigate to subject summary page in UI
7577
screening_subject_page_searcher.navigate_to_subject_summary_page(page, nhs_no)
@@ -81,24 +83,20 @@ def test_scenario_2(page: Page) -> None:
8183

8284
# When I run the FOBT failsafe trawl for my subject
8385
CallAndRecallUtils().run_failsafe(nhs_no)
84-
logging.info(f"[FAILSAFE TRAWL RUN] FOBT failsafe trawl run for subject {nhs_no}")
8586

8687
# Then my subject has been updated as follows:
87-
today = datetime.now().strftime("%d/%m/%Y")
88-
8988
subject_assertion(
9089
nhs_no,
9190
{
9291
"subject has episodes": "No",
9392
"Screening Due Date": "Last Birthday",
94-
"Screening due date date of change": today,
93+
"Screening due date date of change": "Today",
9594
"Screening Due Date Reason": "Failsafe Trawl",
9695
"screening status": "Call",
97-
"Screening Status Date of Change": today,
96+
"Screening Status Date of Change": "Today",
9897
"Screening Status Reason": "Failsafe Trawl",
9998
},
10099
)
101-
logging.info("[DB ASSERTIONS COMPLETE] Updated subject details checked in the DB")
102100

103101
# Navigate to subject summary page in UI
104102
screening_subject_page_searcher.navigate_to_subject_summary_page(page, nhs_no)
@@ -119,20 +117,13 @@ def test_scenario_2(page: Page) -> None:
119117
"latest episode type": "FOBT",
120118
},
121119
)
122-
logging.info("[DB ASSERTIONS COMPLETE] Updated subject details checked in the DB")
123120

124121
# Then there is a "S1" letter batch for my subject with the exact title "Pre-invitation (FIT)"
125-
BatchListPage(page).navigate_to_active_batch_list_page()
126-
ActiveBatchListPage(page).is_batch_present("S1 - Pre-invitation (FIT)")
127-
logging.info("[UI ASSERTIONS COMPLETE] S1 Letter batch exists")
128-
129122
# When I process the open "S1" letter batch for my subject
130123
# Then there is a "S9" letter batch for my subject with the exact title "Invitation & Test Kit (FIT)"
131124
batch_processing(
132125
page, "S1", "Pre-invitation (FIT)", "S9 - Pre-invitation Sent", True
133126
)
134-
logging.info("[UI ASSERTIONS COMPLETE] Updated subject details checked in the UI")
135-
logging.info("[UI ASSERTIONS COMPLETE] S9 Letter batch exists")
136127

137128
# Then my subject has been updated as follows:
138129
subject_assertion(
@@ -141,7 +132,6 @@ def test_scenario_2(page: Page) -> None:
141132
"latest event status": "S9 - Pre-invitation Sent",
142133
},
143134
)
144-
logging.info("[DB ASSERTIONS COMPLETE] Updated subject status checked in the DB")
145135

146136
# When I process the open "S9" letter batch for my subject
147137
batch_processing(
@@ -151,7 +141,6 @@ def test_scenario_2(page: Page) -> None:
151141
"S10 - Invitation & Test Kit Sent",
152142
True,
153143
)
154-
logging.info("[UI ASSERTIONS COMPLETE] Updated subject status checked in the UI")
155144

156145
# Then my subject has been updated as follows:
157146
subject_assertion(
@@ -160,7 +149,6 @@ def test_scenario_2(page: Page) -> None:
160149
"latest event status": "S10 - Invitation & Test Kit Sent",
161150
},
162151
)
163-
logging.info("[DB ASSERTIONS COMPLETE] Updated subject status checked in the DB")
164152

165153
# When I log my subject's latest unlogged FIT kit
166154
fit_kit = FitKitGeneration().get_fit_kit_for_subject_sql(nhs_no, False, False)
@@ -174,7 +162,6 @@ def test_scenario_2(page: Page) -> None:
174162
"latest event status": "S43 Kit Returned and Logged (Initial Test)",
175163
},
176164
)
177-
logging.info("[DB ASSERTIONS COMPLETE] Updated subject status checked in the DB")
178165

179166
# Navigate to subject summary page in UI
180167
screening_subject_page_searcher.navigate_to_subject_summary_page(page, nhs_no)
@@ -195,7 +182,6 @@ def test_scenario_2(page: Page) -> None:
195182
"latest event status": "S2 Normal",
196183
},
197184
)
198-
logging.info("[DB ASSERTIONS COMPLETE] Updated subject status checked in the DB")
199185

200186
# Navigate to subject summary page in UI
201187
screening_subject_page_searcher.navigate_to_subject_summary_page(page, nhs_no)
@@ -217,7 +203,6 @@ def test_scenario_2(page: Page) -> None:
217203
"S158 - Subject Discharge Sent (Normal)",
218204
True,
219205
)
220-
logging.info("[UI ASSERTIONS COMPLETE] Updated subject status checked in the UI")
221206

222207
# Then my subject has been updated as follows:
223208
subject_assertion(
@@ -226,13 +211,8 @@ def test_scenario_2(page: Page) -> None:
226211
"latest event status": "S158 Subject Discharge Sent (Normal)",
227212
},
228213
)
229-
logging.info("[DB ASSERTIONS COMPLETE] Updated subject status checked in the DB")
230214

231215
# And there is a "S158" letter batch for my subject with the exact title "GP Result (Normal)"
232-
BatchListPage(page).navigate_to_active_batch_list_page()
233-
ActiveBatchListPage(page).is_batch_present("S158 - GP Result (Normal)")
234-
logging.info("[UI ASSERTIONS COMPLETE] S158 Letter batch exists")
235-
236216
# When I process the open "S158" letter batch for my subject
237217
batch_processing(
238218
page,
@@ -241,7 +221,6 @@ def test_scenario_2(page: Page) -> None:
241221
"S159 - GP Discharge Sent (Normal)",
242222
True,
243223
)
244-
logging.info("[UI ASSERTIONS COMPLETE] Updated subject status checked in the UI")
245224

246225
# Then my subject has been updated as follows:
247226
subject_assertion(
@@ -274,6 +253,6 @@ def test_scenario_2(page: Page) -> None:
274253
"surveillance due date reason": "Unchanged",
275254
},
276255
)
277-
logging.info("[DB ASSERTIONS COMPLETE] Updated subject details checked in the DB")
278256

279257
logging.info("[TEST COMPLETE] Scenario 2 passed all assertions")
258+
LogoutPage(page).log_out()

utils/call_and_recall_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def run_failsafe(self, nhs_no: str) -> None:
5555
result_cursor.close()
5656
cur.close()
5757
conn.close()
58-
logging.info(f"END: failsafe stored proc executed for {nhs_no}")
58+
logging.info(f"[FAILSAFE TRAWL RUN] FOBT failsafe trawl run for subject {nhs_no}")
5959

6060
def invite_subject_for_fobt_screening(
6161
self, nhs_no: str, user_role: UserRoleType

0 commit comments

Comments
 (0)