@@ -56,9 +56,16 @@ describe("USERCONTROL Combobox >", () => {
5656 await atom . acceptInput ( text ) ;
5757 if ( ( await atom . getInputValue ( ) ) !== text ) {
5858 await atom . clearText ( ) ;
59- for ( const char of text ) { // Type character by character to prevent lost spaces
60- await atom . getInput ( ) . sendKeys ( char ) ;
61- await browser . sleep ( 20 ) ; // Small delay to ensure stability in CI
59+ // Fallback clear if standard clear fails
60+ if ( ( await atom . getInputValue ( ) ) !== "" ) {
61+ await atom . getInput ( ) . sendKeys ( Key . chord ( Key . CONTROL , "a" ) , Key . DELETE ) ;
62+ }
63+
64+ await atom . getInput ( ) . click ( ) ;
65+ for ( const char of text ) {
66+ // Use browser actions for robust typing, especially for spaces
67+ await browser . actions ( ) . sendKeys ( char ) . perform ( ) ;
68+ await browser . sleep ( 100 ) ;
6269 }
6370 }
6471 } ;
@@ -175,7 +182,7 @@ describe("USERCONTROL Combobox >", () => {
175182 await comboboxBasic . select ( oldValue ) ;
176183 await comboboxBasic . toggleMenu ( ) ;
177184 await comboboxBasic . clearText ( ) ;
178- await comboboxBasic . acceptInput ( newValue ) ;
185+ await applySafeType ( comboboxBasic , newValue ) ;
179186 // Trigger BLUR (click outside or press TAB)
180187 await browser . actions ( ) . sendKeys ( protractor . Key . TAB ) . perform ( ) ;
181188 expect ( await comboboxBasic . getInputValue ( ) ) . toEqual ( newValue ) ;
@@ -388,6 +395,7 @@ describe("USERCONTROL Combobox >", () => {
388395 await comboboxSeparators . toggleMenu ( ) ;
389396 expect ( await comboboxSeparators . getItemsCount ( ) ) . toEqual ( 9 ) ;
390397 await applySafeType ( comboboxSeparators , "Item 1" ) ;
398+ await browser . wait ( async ( ) => ( await comboboxSeparators . getItemsCount ( ) ) === 3 , 5000 , "Expected item count to be 3" ) ;
391399 expect ( await comboboxSeparators . getItemsCount ( ) ) . toEqual ( 3 ) ;
392400 } ) ;
393401 } ) ;
@@ -397,13 +405,15 @@ describe("USERCONTROL Combobox >", () => {
397405 await comboboxBasic . waitElementVisible ( ) ;
398406 await comboboxBasic . toggleMenu ( ) ;
399407 await applySafeType ( comboboxBasic , "Item" ) ;
400- await comboboxBasic . toggleMenu ( ) ;
408+ // await comboboxBasic.toggleMenu(); // Removing potentially closing toggle
409+ await browser . wait ( async ( ) => ( await comboboxBasic . getHighlightedItemsCount ( ) ) === 15 , 5000 , "Expected highlighted count to be 15" ) ;
401410 expect ( await comboboxBasic . getHighlightedItemsCount ( ) ) . toEqual (
402411 15
403412 ) ;
404413 await comboboxBasic . clearText ( ) ;
405414 await applySafeType ( comboboxBasic , "Item 1" ) ;
406- await comboboxBasic . toggleMenu ( ) ;
415+ // await comboboxBasic.toggleMenu(); // Removing potentially closing toggle
416+ await browser . wait ( async ( ) => ( await comboboxBasic . getHighlightedItemsCount ( ) ) === 6 , 5000 , "Expected highlighted count to be 6" ) ;
407417 expect ( await comboboxBasic . getHighlightedItemsCount ( ) ) . toEqual (
408418 6
409419 ) ;
@@ -413,13 +423,15 @@ describe("USERCONTROL Combobox >", () => {
413423 await comboboxSeparators . waitElementVisible ( ) ;
414424 await comboboxSeparators . toggleMenu ( ) ;
415425 await applySafeType ( comboboxSeparators , "Item" ) ;
416- await comboboxSeparators . toggleMenu ( ) ;
426+ // await comboboxSeparators.toggleMenu(); // Removing potentially closing toggle
427+ await browser . wait ( async ( ) => ( await comboboxSeparators . getHighlightedItemsCount ( ) ) === 9 , 5000 , "Expected highlighted count to be 9" ) ;
417428 expect (
418429 await comboboxSeparators . getHighlightedItemsCount ( )
419430 ) . toEqual ( 9 ) ;
420431 await comboboxSeparators . clearText ( ) ;
421432 await applySafeType ( comboboxSeparators , "Item 1" ) ;
422- await comboboxSeparators . toggleMenu ( ) ;
433+ // await comboboxSeparators.toggleMenu(); // Removing potentially closing toggle
434+ await browser . wait ( async ( ) => ( await comboboxSeparators . getHighlightedItemsCount ( ) ) === 3 , 5000 , "Expected highlighted count to be 3" ) ;
423435 expect (
424436 await comboboxSeparators . getHighlightedItemsCount ( )
425437 ) . toEqual ( 3 ) ;
0 commit comments