Skip to content

Commit b2a46c5

Browse files
committed
Debugging test_run_fobt_invitations_and_process_s1_batch
1 parent afa0604 commit b2a46c5

File tree

4 files changed

+21
-18
lines changed

4 files changed

+21
-18
lines changed

pages/call_and_recall/generate_invitations_page.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def wait_for_invitation_generation_complete(
9191
value = value.strip() # Get text and remove extra spaces
9292
if int(value) < number_of_invitations:
9393
pytest.fail(
94-
f"There are less than {number_of_invitations} invitations generated"
94+
f"Expected {number_of_invitations} invitations generated but got {value}"
9595
)
9696

9797
self_referrals_total_text = self.self_referrals_total.text_content()

pages/communication_production/batch_list_page.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,11 @@ def open_letter_batch(
9898
) -> None:
9999
"""
100100
Finds and opens the batch row based on type, status, level, and description.
101+
Args:
102+
batch_type (str): The type of the batch (e.g., "Original").
103+
status (str): The status of the batch (e.g., "Open").
104+
level (str): The level of the batch (e.g., "S1").
105+
description (str): The description of the batch (e.g., "Pre-invitation (FIT)").
101106
"""
102107
# Step 1: Match the row using nested filters, one per column value
103108
row = (
@@ -109,7 +114,9 @@ def open_letter_batch(
109114
)
110115

111116
# Step 2: Click the "View" link in the matched row
112-
view_link = row.get_by_role("link", name="View")
117+
view_link = row.locator(
118+
"a"
119+
) # Click the first link in the row identified in step 1
113120
expect(view_link).to_be_visible()
114121
view_link.click()
115122

tests/bcss_tests.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,5 @@ episode_closed_date=22/09/2020
2525
# ----------------------------------
2626
# CALL AND RECALL TEST DATA
2727
# ----------------------------------
28-
daily_invitation_rate=28
28+
daily_invitation_rate=6
2929
weekly_invitation_rate=130

tests/regression/call_and_recall/test_generate_fobt_invitation_regression.py

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
ManageActiveBatchPage,
1313
)
1414
from utils.user_tools import UserTools
15-
from utils.batch_processing import prepare_and_print_batch
1615

1716

1817
@pytest.fixture(scope="function", autouse=True)
@@ -27,10 +26,11 @@ def before_each(page: Page):
2726
BasePage(page).go_to_call_and_recall_page()
2827

2928

30-
@pytest.mark.wip
3129
@pytest.mark.regression
3230
@pytest.mark.call_and_recall
33-
def test_run_fobt_invitations_and_process_s1_batch(page, general_properties: dict):
31+
def test_run_fobt_invitations_and_process_s1_batch(
32+
page: Page, general_properties: dict
33+
):
3434
"""
3535
Run FOBT invitations, open the S1 batch, prepare, retrieve+confirm,
3636
and assert we have a subject at status S9.
@@ -47,6 +47,8 @@ def test_run_fobt_invitations_and_process_s1_batch(page, general_properties: dic
4747
logging.info("Invitations generated successfully")
4848

4949
# And I view the active batch list
50+
BasePage(page).click_main_menu_link()
51+
BasePage(page).go_to_communications_production_page()
5052
CommunicationsProductionPage(page).go_to_active_batch_list_page()
5153

5254
# And I open the "Original" / "Open" / "S1" / "Pre-invitation (FIT)" batch
@@ -57,15 +59,9 @@ def test_run_fobt_invitations_and_process_s1_batch(page, general_properties: dic
5759
description="Pre-invitation (FIT)",
5860
)
5961

60-
# # And I prepare, retrieve & confirm
61-
# ManageActiveBatchPage(page).click_prepare_button()
62-
# ManageActiveBatchPage(page).click_retrieve_button()
63-
# ManageActiveBatchPage(page).click_confirm_button()
64-
65-
# # Then there is a subject matching the criteria
66-
# assert lb.subject_exists(
67-
# latest_kit_class="FIT",
68-
# latest_event_status="S9",
69-
# latest_episode_type="FOBT",
70-
# subject_hub_code="BCS01",
71-
# ), "Expected at least one subject at S9 with FIT/FOBT/BCS01"
62+
# Then I retrieve and confirm the letters
63+
ManageActiveBatchPage(page).click_prepare_button()
64+
ManageActiveBatchPage(page).click_retrieve_button()
65+
BasePage(page).safe_accept_dialog(
66+
page.get_by_role("button", name="Confirm Printed")
67+
) # Click the confirm button and accept the confirmation dialog

0 commit comments

Comments
 (0)