11import pytest
22from playwright .sync_api import Page
3+ import logging
34from pages .base_page import BasePage
45from pages .call_and_recall .call_and_recall_page import CallAndRecallPage
5- from pages .call_and_recall .invitations_monitoring_page import InvitationsMonitoringPage
66from pages .call_and_recall .generate_invitations_page import GenerateInvitationsPage
7- from pages .call_and_recall .non_invitations_days_page import NonInvitationDaysPage
8- from pages .call_and_recall .invitations_plans_page import InvitationsPlansPage
9- from pages .call_and_recall .create_a_plan_page import CreateAPlanPage
7+ from pages .communication_production .batch_list_page import BatchListPage
8+ from pages .communication_production .communications_production_page import (
9+ CommunicationsProductionPage ,
10+ )
11+ from pages .communication_production .manage_active_batch_page import (
12+ ManageActiveBatchPage ,
13+ )
1014from utils .user_tools import UserTools
1115
1216
@@ -22,43 +26,45 @@ def before_each(page: Page):
2226 BasePage (page ).go_to_call_and_recall_page ()
2327
2428
25- # Scenario: Run FOBT invitations and process the S1 letter batch
26- # Many feature scenarios need a subject at S9.
27- # When I generate invitations
28- # And I view the active batch list
29- # And I view the "Original" type "Open" status active letter batch for "S1" "Pre-invitation (FIT)"
30- # And I prepare the letter batch
31- # And I retrieve and confirm the letters
32- # Then there is a subject who meets the following criteria:
33- # | Latest episode kit class | FIT |
34- # | Latest event status | S9 |
35- # | Latest episode type | FOBT |
36- # | Subject hub code | BCS01 |
37-
38- # Scenario: User generates invitations for screening episodes (#3)
39- # # Version copied from now-deleted UserPathway.feature - duplicate steps etc need to be sorted out
40- # Given I log in to BCSS "England" as user role "Hub Manager - State Registered"
41- # When I navigate to the Call and Recall > Generate Invitations Page
42- # And I press the Generate Invitations button and generate invitations
43- # Then Invitations are successfully generated
44-
45-
29+ @pytest .mark .wip
4630@pytest .mark .regression
4731@pytest .mark .call_and_recall
48- def test_generate_fobt_invitations (page : Page ) -> None :
32+ def test_run_fobt_invitations_and_process_s1_batch (page , general_properties : dict ) :
4933 """
50- Verifies that a user can generate FOBT invitations and process the S1 letter batch.
34+ Run FOBT invitations, open the S1 batch, prepare, retrieve+confirm,
35+ and assert we have a subject at status S9.
5136 """
37+ # Navigate to generate invitations
5238 CallAndRecallPage (page ).go_to_generate_invitations_page ()
53- GenerateInvitationsPage (page ).click_generate_invitations_button ()
5439
55- GenerateInvitationsPage (page ).view_active_batch_list ()
56- GenerateInvitationsPage (page ).view_original_open_status_batch (
57- "S1" , "Pre-invitation (FIT)"
40+ # When I generate invitations
41+ logging .info ("Generating invitations based on the invitation plan" )
42+ GenerateInvitationsPage (page ).click_generate_invitations_button ()
43+ GenerateInvitationsPage (page ).wait_for_invitation_generation_complete (
44+ int (general_properties ["daily_invitation_rate" ])
5845 )
59- GenerateInvitationsPage (page ).prepare_letter_batch ()
60- GenerateInvitationsPage (page ).retrieve_and_confirm_letters ()
46+ logging .info ("Invitations generated successfully" )
47+
48+ # And I view the active batch list
49+ CommunicationsProductionPage (page ).go_to_active_batch_list_page ()
6150
62- GenerateInvitationsPage (page ).verify_subject_meets_criteria (
63- kit_class = "FIT" , event_status = "S9" , episode_type = "FOBT" , hub_code = "BCS01"
51+ # And I open the "Original" / "Open" / "S1" / "Pre-invitation (FIT)" batch
52+ BatchListPage (page ).open_letter_batch (
53+ batch_type = "Original" ,
54+ status = "Open" ,
55+ level = "S1" ,
56+ description = "Pre-invitation (FIT)" ,
6457 )
58+
59+ # # And I prepare, retrieve & confirm
60+ # ManageActiveBatchPage(page).click_prepare_button()
61+ # ManageActiveBatchPage(page).click_retrieve_button()
62+ # ManageActiveBatchPage(page).click_confirm_button()
63+
64+ # # Then there is a subject matching the criteria
65+ # assert lb.subject_exists(
66+ # latest_kit_class="FIT",
67+ # latest_event_status="S9",
68+ # latest_episode_type="FOBT",
69+ # subject_hub_code="BCS01",
70+ # ), "Expected at least one subject at S9 with FIT/FOBT/BCS01"
0 commit comments