@@ -1216,44 +1216,49 @@ export async function addUserToOrganization(
1216
1216
* dynamic parameters by unchecking the "Enable dynamic parameters" checkbox.
1217
1217
*/
1218
1218
export const disableDynamicParameters = async (
1219
- page : Page ,
1220
- templateName : string ,
1221
- orgName = defaultOrganizationName ,
1219
+ page : Page ,
1220
+ templateName : string ,
1221
+ orgName = defaultOrganizationName ,
1222
1222
) => {
1223
- await page . goto ( `/templates/${ orgName } /${ templateName } /settings` , {
1224
- waitUntil : "networkidle" ,
1225
- } ) ;
1226
-
1227
- // Wait for the page to be fully loaded and the form to be visible
1228
- await page . waitForSelector ( "form" , { state : "visible" } ) ;
1229
-
1230
- // Find the "Enable dynamic parameters" checkbox and wait for it to be visible
1231
- const dynamicParamsCheckbox = page . getByRole ( "checkbox" , {
1232
- name : / E n a b l e d y n a m i c p a r a m e t e r s f o r w o r k s p a c e c r e a t i o n / ,
1233
- } ) ;
1234
-
1235
- // Wait for the checkbox to be visible and stable
1236
- await dynamicParamsCheckbox . waitFor ( { state : "visible" } ) ;
1237
-
1238
- // If the checkbox is checked, uncheck it
1239
- if ( await dynamicParamsCheckbox . isChecked ( ) ) {
1240
- await dynamicParamsCheckbox . click ( ) ;
1241
-
1242
- // Wait a bit for the UI to update after the click
1243
- await page . waitForTimeout ( 100 ) ;
1244
- }
1245
-
1246
- // Find and click the save button
1247
- const saveButton = page . getByRole ( "button" , { name : / s a v e / i } ) ;
1248
- await saveButton . waitFor ( { state : "visible" } ) ;
1249
- await saveButton . click ( ) ;
1250
-
1251
- // Wait for the success message with a more robust selector
1252
- await page . locator ( "[role='alert']:has-text('Template updated successfully'), .MuiAlert-root:has-text('Template updated successfully')" ) . first ( ) . waitFor ( {
1253
- state : "visible" ,
1254
- timeout : 15000 ,
1255
- } ) ;
1256
-
1257
- // Additional wait to ensure the changes are persisted
1258
- await page . waitForTimeout ( 500 ) ;
1259
- } ;
1223
+ await page . goto ( `/templates/${ orgName } /${ templateName } /settings` , {
1224
+ waitUntil : "networkidle" ,
1225
+ } ) ;
1226
+
1227
+ // Wait for the page to be fully loaded and the form to be visible
1228
+ await page . waitForSelector ( "form" , { state : "visible" } ) ;
1229
+
1230
+ // Find the "Enable dynamic parameters" checkbox and wait for it to be visible
1231
+ const dynamicParamsCheckbox = page . getByRole ( "checkbox" , {
1232
+ name : / E n a b l e d y n a m i c p a r a m e t e r s f o r w o r k s p a c e c r e a t i o n / ,
1233
+ } ) ;
1234
+
1235
+ // Wait for the checkbox to be visible and stable
1236
+ await dynamicParamsCheckbox . waitFor ( { state : "visible" } ) ;
1237
+
1238
+ // If the checkbox is checked, uncheck it
1239
+ if ( await dynamicParamsCheckbox . isChecked ( ) ) {
1240
+ await dynamicParamsCheckbox . click ( ) ;
1241
+
1242
+ // Wait a bit for the UI to update after the click
1243
+ await page . waitForTimeout ( 100 ) ;
1244
+ }
1245
+
1246
+ // Find and click the save button
1247
+ const saveButton = page . getByRole ( "button" , { name : / s a v e / i } ) ;
1248
+ await saveButton . waitFor ( { state : "visible" } ) ;
1249
+ await saveButton . click ( ) ;
1250
+
1251
+ // Wait for the success message with a more robust selector
1252
+ await page
1253
+ . locator (
1254
+ "[role='alert']:has-text('Template updated successfully'), .MuiAlert-root:has-text('Template updated successfully')" ,
1255
+ )
1256
+ . first ( )
1257
+ . waitFor ( {
1258
+ state : "visible" ,
1259
+ timeout : 15000 ,
1260
+ } ) ;
1261
+
1262
+ // Additional wait to ensure the changes are persisted
1263
+ await page . waitForTimeout ( 500 ) ;
1264
+ } ;
0 commit comments