|
| 1 | +from datetime import datetime |
| 2 | +from utils import date_time_utils |
| 3 | +from playwright.sync_api import Page |
| 4 | + |
| 5 | + |
| 6 | +class ReportsPageUtils: |
| 7 | + def __init__(self): |
| 8 | + pass |
| 9 | + |
| 10 | + |
| 11 | +# Timestamp Date Formatting |
| 12 | +def report_timestamp_date_format() -> str: |
| 13 | + """Gets the current date time and converts it to the timestamp format used on the report pages |
| 14 | +
|
| 15 | + Returns: |
| 16 | + date report last requested (str): The current datetime in the "date report last requested" timestamp format. |
| 17 | +
|
| 18 | + """ |
| 19 | + dtu = date_time_utils.DateTimeUtils |
| 20 | + return dtu.format_date(datetime.now(), "%d/%m/%Y" + " at " + "%H:%M:%S") |
| 21 | + |
| 22 | + |
| 23 | +def fobt_kits_logged_but_not_read_report_timestamp_date_format() -> str: |
| 24 | + """Gets the current date time and converts it to the timestamp format used on the fobt_kits_logged_but_not_read report page |
| 25 | +
|
| 26 | + Returns: |
| 27 | + fobt_kits_logged_but_not_read timestamp (str): The current datetime in the "fobt_kits_logged_but_not_read report" timestamp format. |
| 28 | +
|
| 29 | + """ |
| 30 | + dtu = date_time_utils.DateTimeUtils |
| 31 | + return dtu.format_date(datetime.now(), "%d %b %Y %H:%M:%S") |
| 32 | + |
| 33 | + |
| 34 | +def screening_practitioner_appointments_report_timestamp_date_format() -> str: |
| 35 | + """Gets the current date time and converts it to the timestamp format used on the screening practitioner appointments report page |
| 36 | +
|
| 37 | + Returns: |
| 38 | + screening practitioner appointments timestamp (str): The current datetime in the "screening practitioner appointments report" timestamp format. |
| 39 | +
|
| 40 | + """ |
| 41 | + dtu = date_time_utils.DateTimeUtils |
| 42 | + return dtu.format_date(datetime.now(), "%d.%m.%Y" + " at " + "%H:%M:%S") |
| 43 | + |
| 44 | + |
| 45 | +# Reports page main menu links |
| 46 | +def go_to_failsafe_reports_page(page: Page) -> None: |
| 47 | + page.get_by_role("link", name="Failsafe Reports").click() |
| 48 | + |
| 49 | + |
| 50 | +def go_to_operational_reports_page(page: Page) -> None: |
| 51 | + page.get_by_role("link", name="Operational Reports").click() |
| 52 | + |
| 53 | + |
| 54 | +def go_to_strategic_reports_page(page: Page) -> None: |
| 55 | + page.get_by_role("link", name="Strategic Reports").click() |
| 56 | + |
| 57 | + |
| 58 | +def go_to_cancer_waiting_times_reports_page(page: Page) -> None: |
| 59 | + page.get_by_role("link", name="Cancer Waiting Times Reports").click() |
| 60 | + |
| 61 | + |
| 62 | +def go_to_dashboard(page: Page) -> None: |
| 63 | + page.get_by_role("link", name="Dashboard").click() |
| 64 | + |
| 65 | + |
| 66 | +# Failsafe Reports menu links |
| 67 | +def go_to_date_report_last_requested_page(page: Page) -> None: |
| 68 | + page.get_by_role("link", name="Date Report Last Requested").click() |
| 69 | + |
| 70 | + |
| 71 | +def go_to_screening_subjects_with_inactive_open_episode_link_page(page: Page) -> None: |
| 72 | + page.get_by_role("link", name="Screening Subjects With").click() |
| 73 | + |
| 74 | + |
| 75 | +def go_to_subjects_ceased_due_to_date_of_birth_changes_page(page: Page) -> None: |
| 76 | + page.get_by_role("link", name="Subjects Ceased Due to Date").click() |
| 77 | + |
| 78 | + |
| 79 | +def go_to_allocate_sc_for_patient_movements_within_hub_boundaries_page(page: Page) -> None: |
| 80 | + page.get_by_role("link", name="Allocate SC for Patient Movements within Hub Boundaries").click() |
| 81 | + |
| 82 | + |
| 83 | +def go_to_allocate_sc_for_patient_movements_into_your_hub_page(page: Page) -> None: |
| 84 | + page.get_by_role("link", name="Allocate SC for Patient Movements into your Hub").click() |
| 85 | + |
| 86 | + |
| 87 | +def go_to_identify_and_link_new_gp_page(page: Page) -> None: |
| 88 | + page.get_by_role("link", name="Identify and link new GP").click() |
| 89 | + |
| 90 | + |
| 91 | +# Operational Reports menu links |
| 92 | +def go_to_appointment_attendance_not_updated_page(page: Page) -> None: |
| 93 | + page.get_by_role("link", name="Appointment Attendance Not").click() |
| 94 | + |
| 95 | + |
| 96 | +def go_to_fobt_kits_logged_but_not_read_page(page: Page) -> None: |
| 97 | + page.get_by_role("link", name="FOBT Kits Logged but Not Read").click() |
| 98 | + |
| 99 | + |
| 100 | +def go_to_demographic_update_inconsistent_with_manual_update_page(page: Page) -> None: |
| 101 | + page.get_by_role("link", name="Demographic Update").click() |
| 102 | + |
| 103 | + |
| 104 | +def go_to_screening_practitioner_6_weeks_availability_not_set_up_report_page(page: Page) -> None: |
| 105 | + page.get_by_role("link", name="Screening Practitioner 6").click() |
| 106 | + |
| 107 | + |
| 108 | +def go_to_screening_practitioner_appointments_page(page: Page) -> None: |
| 109 | + page.get_by_role("link", name="Screening Practitioner Appointments").click() |
0 commit comments