@@ -20,7 +20,7 @@ def test_example(page: Page) -> None:
2020 # Create plan
2121 page .get_by_role ("link" , name = "Call and Recall" ).click ()
2222 page .get_by_role ("link" , name = "Planning and Monitoring" ).click ()
23- page .get_by_role ("link" , name = "BCS009 " ).click ()
23+ page .get_by_role ("link" , name = "BCS001 " ).click ()
2424 page .get_by_role ("button" , name = "Create a Plan" ).click ()
2525 page .get_by_role ("link" , name = "Set all" ).click ()
2626 page .get_by_placeholder ("Enter weekly invitation rate" ).fill ("1" )
@@ -134,6 +134,7 @@ def active_batch_processing(page: Page, batch_type: str, batch_description: str,
134134 page .on ("dialog" , lambda dialog : dialog .accept ())
135135 page .get_by_role ("button" , name = "Confirm Printed" ).click ()
136136
137+ page .get_by_role ("link" , name = "Back" ).click ()
137138 page .get_by_role ("link" , name = "Back" ).click ()
138139 page .get_by_role ("link" , name = "Archived Batch List" ).click ()
139140 page .locator ("#batchIdFilter" ).click ()
@@ -184,7 +185,7 @@ def active_batch_processing_csv(page: Page, batch_type: str, batch_description:
184185 # Start waiting for the pdf download
185186 with page .expect_download () as download_info :
186187 # Perform the action that initiates download
187- page .locator ( "[id= \" \\ 32 8336 \" ]" ). get_by_role ("button" , name = "Retrieve" ).click () # Needs to be changed, locator ID is dynamic and changes each run
188+ page .get_by_role ("button" , name = "Retrieve" ).nth ( 0 ). click ()
188189 download_pdf = download_info .value
189190 # Wait for the download process to complete and save the downloaded file in a temp folder
190191 download_pdf .save_as (f"/temp/{ download_pdf .suggested_filename } " )
@@ -204,22 +205,23 @@ def active_batch_processing_csv(page: Page, batch_type: str, batch_description:
204205 break
205206
206207 page .on ("dialog" , lambda dialog : dialog .accept ())
207- expect (page .locator ( "[id= \" \\ 32 8336 \" ]" ). get_by_role ("button" , name = "Confirm Printed" )) .to_be_visible () # Needs to be changed, locator ID is dynamic and changes each run
208-
208+ expect (page .get_by_role ("button" , name = "Confirm Printed" ). nth ( 0 )) .to_be_visible ()
209+ page . get_by_role ( "button" , name = "Confirm Printed" ). nth ( 0 ). click ()
209210 # Start waiting for the csv download
210211 with page .expect_download () as download_info :
211212 # Perform the action that initiates download
212- page .locator ( "[id= \" \\ 32 8337 \" ]" ). get_by_role ("button" , name = "Retrieve" ).click () # Needs to be changed, locator ID is dynamic and changes each run
213+ page .get_by_role ("button" , name = "Retrieve" ).nth ( 1 ). click ()
213214 download_csv = download_info .value
214215 # Wait for the download process to complete and save the downloaded file in a temp folder
215216 download_csv .save_as (f"/temp/{ download_csv .suggested_filename } " )
216217
217218 page .on ("dialog" , lambda dialog : dialog .accept ())
218- expect (page .locator ( "[id= \" \\ 32 8337 \" ]" ). get_by_role ("button" , name = "Confirm Printed" )) .to_be_visible () # Needs to be changed, locator ID is dynamic and changes each run
219-
219+ expect (page .get_by_role ("button" , name = "Confirm Printed" ). nth ( 0 )) .to_be_visible ()
220+ page . get_by_role ( "button" , name = "Confirm Printed" ). nth ( 0 ). click ()
220221 # Storing the downloaded csv into a pandas dataframe
221222 csv_df = pd .read_csv (download_csv .suggested_filename )
222223
224+ page .get_by_role ("link" , name = "Back" ).click ()
223225 page .get_by_role ("link" , name = "Back" ).click ()
224226 page .get_by_role ("link" , name = "Archived Batch List" ).click ()
225227 page .locator ("#batchIdFilter" ).click ()
0 commit comments