|
2 | 2 | from playwright.sync_api import Page, expect |
3 | 3 | from pages.base_page import BasePage |
4 | 4 | from utils.user_tools import UserTools |
| 5 | +from utils.calendar_picker import CalendarPicker |
| 6 | +from datetime import datetime |
5 | 7 | from utils.screening_subject_page_searcher import verify_subject_event_status_by_nhs_no |
6 | 8 | from pages.screening_subject_search.subject_screening_summary_page import ( |
7 | 9 | SubjectScreeningSummaryPage, |
8 | 10 | ) |
9 | 11 | from utils.batch_processing import batch_processing |
10 | 12 | from pages.logout.log_out_page import LogoutPage |
11 | 13 | from pages.datasets.subject_datasets_page import SubjectDatasetsPage |
| 14 | +from pages.screening_subject_search.handover_into_symptomatic_care_page import ( |
| 15 | + HandoverIntoSymptomaticCarePage |
| 16 | +) |
12 | 17 |
|
13 | 18 |
|
14 | 19 | # This should go into a util. Adding it here to avoid SonarQube duplication errors: |
@@ -148,18 +153,25 @@ def test_compartment_5(page: Page, smokescreen_properties: dict) -> None: |
148 | 153 | page.get_by_role("button", name="Handover into Symptomatic Care").click() |
149 | 154 |
|
150 | 155 | # The following code is on the handover into symptomatic care page |
151 | | - page.get_by_label("Referral").select_option("20445") |
152 | | - page.get_by_role("button", name="Calendar").click() |
153 | | - page.get_by_role( |
154 | | - "cell", name="9", exact=True |
155 | | - ).click() # Todays date (v1 calendar picker) |
156 | | - page.locator("#UI_NS_CONSULTANT_PIO_SELECT_LINK").click() |
157 | | - page.locator("#UI_RESULTS_usgwmbob").select_option("201") |
158 | | - page.locator("#UI_NS_PRACTITIONER_PIO_SELECT_LINK").click() |
159 | | - page.get_by_role("textbox", name="Notes").click() |
160 | | - page.get_by_role("textbox", name="Notes").fill("Test Automation") |
161 | | - page.once("dialog", lambda dialog: dialog.accept()) |
162 | | - page.get_by_role("button", name="Save").click() |
| 156 | + #page.get_by_label("Referral").select_option("20445") |
| 157 | + #page.get_by_role("button", name="Calendar").click() |
| 158 | + #CalendarPicker(page).v1_calender_picker(datetime.today()) |
| 159 | + #page.locator("#UI_NS_CONSULTANT_PIO_SELECT_LINK").click() |
| 160 | + # Here value '201' is refering to Consultant B, Frame |
| 161 | + #option_locator = page.locator('[value="201"]:visible') |
| 162 | + #option_locator.wait_for(state="visible") |
| 163 | + #option_locator.click() |
| 164 | + #page.get_by_role("textbox", name="Notes").click() |
| 165 | + #page.get_by_role("textbox", name="Notes").fill("Test Automation") |
| 166 | + #page.once("dialog", lambda dialog: dialog.accept()) |
| 167 | + #page.get_by_role("button", name="Save").click() |
| 168 | + |
| 169 | + HandoverIntoSymptomaticCarePage(page).select_referral_dropdown_option("20445") |
| 170 | + HandoverIntoSymptomaticCarePage(page).click_calendar_button() |
| 171 | + CalendarPicker(page).v1_calender_picker(datetime.today()) |
| 172 | + HandoverIntoSymptomaticCarePage(page).select_consultant("201") |
| 173 | + HandoverIntoSymptomaticCarePage(page).fill_notes("Test Automation") |
| 174 | + HandoverIntoSymptomaticCarePage(page).click_save_button() |
163 | 175 |
|
164 | 176 | SubjectScreeningSummaryPage(page).verify_latest_event_status_value( |
165 | 177 | "A385 - Handover into Symptomatic Care" |
@@ -231,18 +243,25 @@ def test_compartment_5(page: Page, smokescreen_properties: dict) -> None: |
231 | 243 | page.get_by_role("button", name="Handover into Symptomatic Care").click() |
232 | 244 |
|
233 | 245 | # The following code is on the handover into symptomatic care page |
234 | | - page.get_by_label("Referral").select_option("20445") |
235 | | - page.get_by_role("button", name="Calendar").click() |
236 | | - page.get_by_role( |
237 | | - "cell", name="9", exact=True |
238 | | - ).click() # Todays date (v1 calendar picker) |
239 | | - page.locator("#UI_NS_CONSULTANT_PIO_SELECT_LINK").click() |
240 | | - page.locator("#UI_RESULTS_ktdtoepq").select_option("201") |
241 | | - page.locator("#UI_NS_PRACTITIONER_PIO_SELECT_LINK").click() |
242 | | - page.get_by_role("textbox", name="Notes").click() |
243 | | - page.get_by_role("textbox", name="Notes").fill("Test Automation") |
244 | | - page.once("dialog", lambda dialog: dialog.accept()) |
245 | | - page.get_by_role("button", name="Save").click() |
| 246 | + #page.get_by_label("Referral").select_option("20445") |
| 247 | + #page.get_by_role("button", name="Calendar").click() |
| 248 | + #CalendarPicker(page).v1_calender_picker(datetime.today()) |
| 249 | + #page.locator("#UI_NS_CONSULTANT_PIO_SELECT_LINK").click() |
| 250 | + # Here value '201' is refering to Consultant B, Frame |
| 251 | + #option_locator = page.locator('[value="201"]:visible') |
| 252 | + #option_locator.wait_for(state="visible") |
| 253 | + #option_locator.click() |
| 254 | + #page.get_by_role("textbox", name="Notes").click() |
| 255 | + #page.get_by_role("textbox", name="Notes").fill("Test Automation") |
| 256 | + #page.once("dialog", lambda dialog: dialog.accept()) |
| 257 | + #page.get_by_role("button", name="Save").click() |
| 258 | + |
| 259 | + HandoverIntoSymptomaticCarePage(page).select_referral_dropdown_option("20445") |
| 260 | + HandoverIntoSymptomaticCarePage(page).click_calendar_button() |
| 261 | + CalendarPicker(page).v1_calender_picker(datetime.today()) |
| 262 | + HandoverIntoSymptomaticCarePage(page).select_consultant("201") |
| 263 | + HandoverIntoSymptomaticCarePage(page).fill_notes("Test Automation") |
| 264 | + HandoverIntoSymptomaticCarePage(page).click_save_button() |
246 | 265 |
|
247 | 266 | SubjectScreeningSummaryPage(page).verify_latest_event_status_value( |
248 | 267 | "A385 - Handover into Symptomatic Care" |
|
0 commit comments