Skip to content

Commit e72d83e

Browse files
Merge branch 'feature/smokescreen_compartment_1' of github.com:NHSDigital/bcss-playwright into feature/smokescreen_compartment_1
2 parents a4d86e6 + 94a379a commit e72d83e

File tree

2 files changed

+15
-41
lines changed

2 files changed

+15
-41
lines changed

pages/reports_page.py

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,7 @@
1-
from datetime import datetime
2-
from utils import date_time_utils
31
from utils.click_helper import click
42
from playwright.sync_api import Page
53

64

7-
class ReportsPageUtils:
8-
def __init__(self):
9-
pass
10-
11-
12-
# Timestamp Date Formatting
13-
def report_timestamp_date_format() -> str:
14-
"""Gets the current date time and converts it to the timestamp format used on the report pages
15-
16-
Returns:
17-
date report last requested (str): The current datetime in the "date report last requested" timestamp format.
18-
19-
"""
20-
dtu = date_time_utils.DateTimeUtils
21-
return dtu.format_date(datetime.now(), "%d/%m/%Y" + " at " + "%H:%M:%S")
22-
23-
24-
def fobt_kits_logged_but_not_read_report_timestamp_date_format() -> str:
25-
"""Gets the current date time and converts it to the timestamp format used on the fobt_kits_logged_but_not_read report page
26-
27-
Returns:
28-
fobt_kits_logged_but_not_read timestamp (str): The current datetime in the "fobt_kits_logged_but_not_read report" timestamp format.
29-
30-
"""
31-
dtu = date_time_utils.DateTimeUtils
32-
return dtu.format_date(datetime.now(), "%d %b %Y %H:%M:%S")
33-
34-
35-
def screening_practitioner_appointments_report_timestamp_date_format() -> str:
36-
"""Gets the current date time and converts it to the timestamp format used on the screening practitioner appointments report page
37-
38-
Returns:
39-
screening practitioner appointments timestamp (str): The current datetime in the "screening practitioner appointments report" timestamp format.
40-
41-
"""
42-
dtu = date_time_utils.DateTimeUtils
43-
return dtu.format_date(datetime.now(), "%d.%m.%Y" + " at " + "%H:%M:%S")
44-
45-
465
# Reports page main menu links
476
def go_to_failsafe_reports_page(page: Page) -> None:
487
click(page, page.get_by_role("link", name="Failsafe Reports"))

utils/date_time_utils.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,18 @@ def get_a_day_of_week(date: datetime) -> str:
7070
str: The day of the week relating to the specified date.
7171
"""
7272
return date.strftime("%A")
73+
74+
@staticmethod
75+
def report_timestamp_date_format() -> str:
76+
"""Gets the current datetime in the timestamp format used on the report pages."""
77+
return DateTimeUtils.format_date(datetime.now(), "%d/%m/%Y at %H:%M:%S")
78+
79+
@staticmethod
80+
def fobt_kits_logged_but_not_read_report_timestamp_date_format() -> str:
81+
"""Gets the current datetime in the format used for FOBT Kits Logged but Not Read report."""
82+
return DateTimeUtils.format_date(datetime.now(), "%d %b %Y %H:%M:%S")
83+
84+
@staticmethod
85+
def screening_practitioner_appointments_report_timestamp_date_format() -> str:
86+
"""Gets the current datetime in the format used for Screening Practitioner Appointments report."""
87+
return DateTimeUtils.format_date(datetime.now(), "%d.%m.%Y at %H:%M:%S")

0 commit comments

Comments
 (0)