@@ -96,6 +96,7 @@ def batch_processing(page: Page, batch_type: str, batch_description: str, latest
9696 link = row .locator ("a" ).first
9797 link_text = link .inner_text () # Get the link text dynamically
9898 link .click ()
99+ break
99100 else :
100101 pytest .fail (f"No { batch_type } batch found" )
101102
@@ -119,7 +120,7 @@ def batch_processing(page: Page, batch_type: str, batch_description: str, latest
119120 download_file = download_info .value
120121 file = download_file .suggested_filename
121122 # Wait for the download process to complete and save the downloaded file in a temp folder
122- download_file .save_as (f"/temp/ { file } " )
123+ download_file .save_as (file )
123124 page .wait_for_timeout (1000 )
124125 if file .endswith (".pdf" ):
125126 nhs_no = pdf_Reader (file )
@@ -146,7 +147,7 @@ def batch_processing(page: Page, batch_type: str, batch_description: str, latest
146147 subject_search_by_nhs_no (page , nhs_no , latest_event_status )
147148
148149def pdf_Reader (file : str ):
149- reader = PdfReader (f"/temp/ { file } " )
150+ reader = PdfReader (file )
150151
151152 # For loop looping through all pages of the file to find the NHS Number
152153 for pages in reader .pages :
@@ -162,7 +163,7 @@ def pdf_Reader(file: str):
162163 return nhs_no
163164
164165def csv_Reader (file : str ):
165- csv_df = pd .read_csv (f"/temp/ { file } " )
166+ csv_df = pd .read_csv (file )
166167 return csv_df
167168
168169def subject_search_by_nhs_no (page : Page , nhs_no : str , latest_event_status : str ):
0 commit comments