Skip to content

Commit 2ab6a03

Browse files
committed
Merge branch 'main' into feature/BCSS-20476-c6-pom-advance-fobt-screening-episode
# Conflicts: # tests/smokescreen/test_compartment_6.py
2 parents 5aeb9d5 + bf6b575 commit 2ab6a03

13 files changed

+1334
-350
lines changed

docs/utility-guides/BatchProcessing.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ This will call the other two functions in order to successfully process a batch.
4343
- Type: `str`
4444
- This is the description of the batch. For example: **Pre-invitation (FIT)** or **Post-investigation Appointment NOT Required**
4545
- `latest_event_status`:
46-
- Type: `str`
47-
- This is the status the subject will get updated to after the batch has been processed. It is used to check that the subject has been updated to the correct status after a batch has been printed
46+
- Type: `str | None`
47+
- This is the status the subject will get updated to after the batch has been processed. It is used to check that the subject has been updated to the correct status after a batch has been printed. If there are multiple different status in the same batch, provide them all in a list.
4848

4949
#### Optional Arguments
5050

pages/datasets/investigation_dataset_page.py

Lines changed: 834 additions & 0 deletions
Large diffs are not rendered by default.

pages/screening_subject_search/subject_screening_summary_page.py

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,17 +84,36 @@ def verify_latest_event_status_header(self) -> None:
8484
"""Verify that the latest event status header is visible."""
8585
expect(self.latest_event_status).to_be_visible()
8686

87-
def verify_latest_event_status_value(self, latest_event_status: str) -> None:
87+
def verify_latest_event_status_value(self, latest_event_status: str | list) -> None:
8888
"""Verify that the latest event status value is visible."""
89-
logging.info(f"Verifying subject has the status: {latest_event_status}")
90-
latest_event_status_cell = self.get_latest_event_status_cell(
89+
latest_event_status_locator = self.get_visible_status_from_list(
9190
latest_event_status
9291
)
92+
status = latest_event_status_locator.inner_text()
93+
logging.info(f"Verifying subject has the status: {status}")
9394
try:
94-
expect(latest_event_status_cell).to_be_visible()
95-
logging.info(f"Subject has the status: {latest_event_status}")
95+
expect(latest_event_status_locator).to_be_visible()
96+
logging.info(f"Subject has the status: {status}")
9697
except Exception:
97-
pytest.fail(f"Subject does not have the status: {latest_event_status}")
98+
pytest.fail(f"Subject does not have the status: {status}")
99+
100+
def get_visible_status_from_list(self, latest_event_status) -> Locator:
101+
"""
102+
Get the first visible status from the latest event status string or list.
103+
104+
Args:
105+
latest_event_status (str | list): The latest event status to check.
106+
107+
Returns:
108+
Locator: The locator for the first visible status.
109+
"""
110+
if isinstance(latest_event_status, str):
111+
latest_event_status = [latest_event_status]
112+
for status in latest_event_status:
113+
locator = self.page.get_by_role("cell", name=status, exact=True)
114+
if locator.is_visible():
115+
return locator
116+
logging.error("Unable to find any of the listed statuses")
98117

99118
def click_subjects_events_notes(self) -> None:
100119
"""Click on the 'Subject Events & Notes' link."""

tests/smokescreen/test_compartment_2.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from pages.logout.log_out_page import LogoutPage
88
from pages.fit_test_kits.log_devices_page import LogDevicesPage
99
from utils.batch_processing import batch_processing
10-
from utils.fit_kit_generation import create_fit_id_df
10+
from utils.fit_kit import FitKitGeneration
1111
from utils.screening_subject_page_searcher import verify_subject_event_status_by_nhs_no
1212
from utils.user_tools import UserTools
1313

@@ -33,8 +33,7 @@ def test_compartment_2(page: Page, smokescreen_properties: dict) -> None:
3333
tk_type_id = smokescreen_properties["c2_fit_kit_tk_type_id"]
3434
hub_id = smokescreen_properties["c2_fit_kit_logging_test_org_id"]
3535
no_of_kits_to_retrieve = smokescreen_properties["c2_total_fit_kits_to_retieve"]
36-
subjectdf = create_fit_id_df(tk_type_id, hub_id, no_of_kits_to_retrieve)
37-
36+
subjectdf = FitKitGeneration().create_fit_id_df(tk_type_id, hub_id, no_of_kits_to_retrieve)
3837
for subject in range(int(smokescreen_properties["c2_normal_kits_to_log"])):
3938
fit_device_id = subjectdf["fit_device_id"].iloc[subject]
4039
logging.info(f"Logging FIT Device ID: {fit_device_id}")

tests/smokescreen/test_compartment_3.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from playwright.sync_api import Page
44
from pages.logout.log_out_page import LogoutPage
55
from utils.batch_processing import batch_processing
6-
from utils.fit_kit_logged import process_kit_data
6+
from utils.fit_kit import FitKitLogged
77
from utils.screening_subject_page_searcher import verify_subject_event_status_by_nhs_no
88
from utils.oracle.oracle_specific_functions import (
99
update_kit_service_management_entity,
@@ -26,9 +26,10 @@ def test_compartment_3(page: Page, smokescreen_properties: dict) -> None:
2626
"""
2727
UserTools.user_login(page, "Hub Manager State Registered at BCS01")
2828

29+
2930
# Find data , separate it into normal and abnormal, Add results to the test records in the KIT_QUEUE table (i.e. mimic receiving results from the middleware)
3031
# and get device IDs and their flags
31-
device_ids = process_kit_data(smokescreen_properties)
32+
device_ids =FitKitLogged().process_kit_data(smokescreen_properties)
3233
# Retrieve NHS numbers for each device_id and determine normal/abnormal status
3334
nhs_numbers = []
3435
normal_flags = []

0 commit comments

Comments
 (0)