22
33from libs import CurrentExecution , file_ops , playwright_ops , testdata_ops
44from libs .generic_constants import element_properties , framework_actions , wait_time
5- from libs .mavis_constants import child_year_group , record_limit
5+ from libs .mavis_constants import child_year_group , mavis_file_types , record_limit
66from libs .wrappers import *
77from pages import pg_children , pg_dashboard , pg_sessions , pg_vaccines
88
@@ -25,11 +25,8 @@ class pg_import_records:
2525 RDO_VACCINATION_RECORDS : Final [str ] = "Vaccination records"
2626 BTN_CONTINUE : Final [str ] = "Continue"
2727 LBL_CHILD_RECORDS : Final [str ] = "Upload file"
28- # LBL_CLASS_LIST_RECORDS: Final[str] = f"{sessions_page.LNK_SCHOOL_1}Import"
2928 LBL_CLASS_LIST_RECORDS : Final [str ] = "Upload file"
30- # LBL_VACCINATION_RECORDS: Final[str] = "Vaccination records"
3129 LBL_VACCINATION_RECORDS : Final [str ] = "Upload file"
32- # LBL_CLASS_LIST_RECORDS_FOR_SCHOOL1: Final[str] = f"{sessions_page.LNK_SCHOOL_1}Import"
3330 LBL_CLASS_LIST_RECORDS_FOR_SCHOOL1 : Final [str ] = "Upload file"
3431 LBL_SCHOOL_NAME : Final [str ] = "Which school is this class"
3532 LBL_MAIN : Final [str ] = "main"
@@ -39,11 +36,18 @@ class pg_import_records:
3936 CHK_YEAR11 : Final [str ] = "Year 11"
4037 LNK_IMPORT_CLASS_LIST_RECORDS : Final [str ] = "Import class lists"
4138
39+ def __init__ (self ):
40+ self .upload_time = ""
41+
4242 def click_import_records (self ):
4343 self .po .act (locator = self .LNK_IMPORT_RECORDS , action = framework_actions .CLICK_LINK )
4444
45- def import_child_records (self , file_paths : str ):
45+ def import_child_records (self , file_paths : str , verify_on_children_page : bool = False ):
4646 _input_file_path , _output_file_path = self .tdo .get_file_paths (file_paths = file_paths )
47+ if verify_on_children_page :
48+ _cl = self .tdo .create_child_list_from_file (
49+ file_path = _input_file_path , file_type = mavis_file_types .CHILD_LIST
50+ )
4751 self .po .act (locator = self .RDO_CHILD_RECORDS , action = framework_actions .RADIO_BUTTON_SELECT )
4852 self .po .act (locator = self .BTN_CONTINUE , action = framework_actions .CLICK_BUTTON )
4953 self .po .act (
@@ -57,6 +61,8 @@ def import_child_records(self, file_paths: str):
5761 if self .ce .get_file_record_count () > record_limit .FILE_RECORD_MAX_THRESHOLD :
5862 self ._click_uploaded_file_datetime (truncated = True )
5963 self ._verify_upload_output (file_path = _output_file_path )
64+ if verify_on_children_page :
65+ self .children_page .verify_child_has_been_uploaded (child_list = _cl )
6066
6167 def import_class_list_records (self , file_paths : str , year_group : str = child_year_group .ALL ):
6268 _input_file_path , _output_file_path = self .tdo .get_file_paths (file_paths = file_paths )
0 commit comments