|
7 | 7 | from playwright.sync_api import Page |
8 | 8 | from enum import IntEnum |
9 | 9 |
|
| 10 | +BTN_REQUEST_CEASE_SELECTOR = "input[name='BTN_REQUEST_CEASE']" |
| 11 | + |
10 | 12 |
|
11 | 13 | def create_manual_cease_ready_subject( |
12 | 14 | screening_centre: str = "BCS002", base_age: int = 75 |
@@ -77,13 +79,13 @@ def process_manual_cease_with_disclaimer( |
77 | 79 |
|
78 | 80 | try: |
79 | 81 | # Check if Request Cease button is visible |
80 | | - page.locator("input[name='BTN_REQUEST_CEASE']").wait_for(timeout=3000) |
| 82 | + page.locator(BTN_REQUEST_CEASE_SELECTOR).wait_for(timeout=3000) |
81 | 83 | logging.info( |
82 | 84 | "[CHECK] 'Request Cease' button is present — proceeding with steps 1-3" |
83 | 85 | ) |
84 | 86 |
|
85 | 87 | # Step 1: Click "Request Cease" |
86 | | - page.locator("input[name='BTN_REQUEST_CEASE']").click() |
| 88 | + page.locator(BTN_REQUEST_CEASE_SELECTOR).click() |
87 | 89 | logging.info("[STEP 1] Clicked 'Request Cease'") |
88 | 90 |
|
89 | 91 | # Step 2: Select reason |
@@ -136,7 +138,7 @@ def process_manual_cease_immediate( |
136 | 138 | logging.info("[MANUAL CEASE] Starting full cease workflow") |
137 | 139 |
|
138 | 140 | # Step 1: Click "Request Cease" |
139 | | - page.locator("input[name='BTN_REQUEST_CEASE']").click() |
| 141 | + page.locator(BTN_REQUEST_CEASE_SELECTOR).click() |
140 | 142 | logging.info("[STEP 1] Clicked 'Request Cease'") |
141 | 143 |
|
142 | 144 | # Step 2: Select reason from dropdown |
@@ -169,7 +171,7 @@ def process_manual_cease_immediate( |
169 | 171 | logging.info("[STEP 4] Clicked 'Save Request Cease'") |
170 | 172 | else: |
171 | 173 | logging.error("[STEP 4] No cease confirmation button found!") |
172 | | - raise Exception("Cease button not found on the page") |
| 174 | + raise RuntimeError("Cease button not found on the page") |
173 | 175 |
|
174 | 176 |
|
175 | 177 | # Markers for special assertions |
|
0 commit comments