@@ -43,6 +43,9 @@ export async function createGeneralPage(page, generalpageURL, titleMessage, body
4343 await page . keyboard . type ( bodyMessage , { delay : 0 } ) ;
4444
4545 // Check General Visibility
46+ const visibilityInput = page . locator ( '[data-drupal-selector="edit-field-visibility-0-target-id"]' ) ;
47+ await visibilityInput . waitFor ( { state : 'visible' , timeout : 10000 } ) ;
48+ await visibilityInput . fill ( 'General' ) ;
4649 // await page.fill('[data-drupal-selector="edit-field-visibility-0-target-id"]', 'General');
4750
4851 // Add menu
@@ -75,7 +78,13 @@ export async function createCWLPage(page, cwlpageURL, titleMessage, bodyMessage)
7578 await page . keyboard . type ( bodyMessage , { delay : 0 } ) ;
7679
7780 // Check General Visibility
78- await page . fill ( '[data-drupal-selector="edit-field-visibility-0-target-id"]' , 'CWL' ) ;
81+ // await page.fill('[data-drupal-selector="edit-field-visibility-0-target-id"]', 'CWL');
82+ const visibilityInput = page . locator ( '[data-drupal-selector="edit-field-visibility-0-target-id"]' ) ;
83+ await visibilityInput . waitFor ( { state : 'visible' , timeout : 10000 } ) ;
84+ await visibilityInput . fill ( 'CWL' ) ;
85+
86+ const suggestion = page . locator ( '.ui-autocomplete li' , { hasText : 'CWL' } ) ;
87+ await suggestion . waitFor ( { state : 'visible' , timeout : 5000 } ) ;
7988
8089 // Add menu
8190 await page . locator ( '[data-drupal-selector="edit-menu"]' ) . first ( ) . locator ( 'summary' ) . click ( ) ;
0 commit comments