|
15 | 15 | from pages.navigation_bar_links import * |
16 | 16 | from pages.subject_screening_page import * |
17 | 17 |
|
| 18 | +# @pytest.mark.wip2 # Not working at the moment |
| 19 | +# def test_prereq(): |
| 20 | +# database_connection_exec("prereq_check") |
| 21 | + |
| 22 | +# paramater_32 = database_connection_query("select DEFAULT_VALUE from PARAMETERS where PARAM_ID = 32") |
| 23 | +# print(f"paramater_32: {paramater_32}") |
| 24 | +# if paramater_32[0] != "-1": |
| 25 | +# database_connection_query("UPDATE PARAMETERS SET DEFAULT_VALUE = -1 WHERE PARAM_ID = 32") |
| 26 | +# database_connection_query("COMMIT") |
| 27 | +# paramater_31 = database_connection_query("select DEFAULT_VALUE from PARAMETERS where PARAM_ID = 31") |
| 28 | +# print(f"paramater_31: {paramater_31}") |
| 29 | +# if paramater_31[0] != "-1": |
| 30 | +# database_connection_query("UPDATE PARAMETERS SET DEFAULT_VALUE = -1 WHERE PARAM_ID = 31") |
| 31 | +# database_connection_query("COMMIT") |
| 32 | + |
| 33 | + |
| 34 | +# To Do: |
| 35 | +# Create more POM |
| 36 | +# Remove as many hard coded timeouts as possible |
| 37 | +# Add more fail states |
| 38 | +# Add more logging to understand what is going on |
| 39 | +# Convert import pages * into 1 line |
| 40 | +# Move functions to utils |
| 41 | + |
18 | 42 | @pytest.mark.wip |
19 | 43 | def test_example(page: Page) -> None: |
20 | 44 | page.goto("/") |
21 | 45 | BcssLoginPage(page).login_as_user_bcss401() |
22 | 46 |
|
23 | | - # Create plan |
| 47 | + # 2 - Create plan |
24 | 48 | MainMenu(page).go_to_call_and_recall_page() |
25 | 49 | CallAndRecall(page).go_to_planning_and_monitoring_page() |
26 | 50 | page.get_by_role("link", name="BCS001").click() |
27 | 51 | page.get_by_role("button", name="Create a Plan").click() |
28 | 52 | page.get_by_role("link", name="Set all").click() |
29 | | - page.get_by_placeholder("Enter weekly invitation rate").fill("1") |
| 53 | + page.get_by_placeholder("Enter daily invitation rate").fill("1") |
30 | 54 | page.get_by_role("button", name="Update").click() |
31 | 55 | page.get_by_role("button", name="Confirm").click() |
32 | 56 | page.get_by_role("link", name="Set all").click() |
@@ -54,7 +78,7 @@ def test_example(page: Page) -> None: |
54 | 78 | # Loop until the table no longer contains "Queued" |
55 | 79 | while elapsed < timeout: |
56 | 80 | table_text = page.locator("#displayRS").text_content() |
57 | | - if "Queued" in table_text: |
| 81 | + if "Queued" in table_text or "In Progress" in table_text: |
58 | 82 | # Click the Refresh button |
59 | 83 | page.get_by_role("button", name="Refresh").click() |
60 | 84 | page.wait_for_timeout(wait_interval) |
@@ -93,7 +117,7 @@ def batch_processing(page: Page, batch_type: str, batch_description: str, latest |
93 | 117 | if pre_invitation_cells.count() == 0 and batch_description == "Pre-invitation (FIT) (digital leaflet)": |
94 | 118 | print(f"No S1 Pre-invitation (FIT) (digital leaflet) batch found. Skipping to next step") |
95 | 119 | return |
96 | | - elif page.locator("td", has_text="No matching records found"): |
| 120 | + elif pre_invitation_cells.count() == 0 and page.locator("td", has_text="No matching records found"): |
97 | 121 | pytest.fail(f"No {batch_type} {batch_description} batch found") |
98 | 122 |
|
99 | 123 | for i in range(pre_invitation_cells.count()): |
@@ -147,6 +171,8 @@ def batch_processing(page: Page, batch_type: str, batch_description: str, latest |
147 | 171 | page.get_by_role("button", name="Confirm Printed").nth(0).click() |
148 | 172 | page.wait_for_timeout(1000) |
149 | 173 |
|
| 174 | + # Add wait for batch successfully archived |
| 175 | + |
150 | 176 | NavigationBar(page).click_main_menu_link() |
151 | 177 | MainMenu(page).go_to_communications_production_page() |
152 | 178 | CommunicationsProduction(page).go_to_archived_batch_list_page() |
|
0 commit comments