@@ -44,77 +44,98 @@ public async Task<string> GetSelectedValueAsync()
4444 /// Используй этот метод, когда в меню существует несколько элементов с одинаковым названием
4545 /// В остальных случаях лучше использовать `SelectAsync`
4646 /// </summary>
47- public async Task SelectFirstAsync ( string value )
47+ public async Task SelectFirstAsync ( string value , LocatorClickOptions ? options = default )
4848 {
4949 var items = await GetComboboxMenuItemsLocatorAsync ( value ) . ConfigureAwait ( false ) ;
50- await items . First . ClickAsync ( ) . ConfigureAwait ( false ) ;
50+ await items . First . ClickAsync ( options ) . ConfigureAwait ( false ) ;
5151 }
5252
5353 /// <summary>
5454 /// Используй этот метод, когда в меню существует несколько элементов с одинаковым названием
5555 /// В остальных случаях лучше использовать `SelectAsync`
5656 /// </summary>
57- public async Task SelectFirstAsync ( Regex value )
57+ public async Task SelectFirstAsync ( Regex value , LocatorClickOptions ? options = default )
5858 {
5959 var items = await GetComboboxMenuItemsLocatorAsync ( value ) . ConfigureAwait ( false ) ;
60- await items . First . ClickAsync ( ) . ConfigureAwait ( false ) ;
60+ await items . First . ClickAsync ( options ) . ConfigureAwait ( false ) ;
6161 }
6262
63- public async Task SelectAsync ( string value )
63+ public async Task SelectAsync ( string value , LocatorClickOptions ? options = default )
6464 {
6565 var items = await GetComboboxMenuItemsLocatorAsync ( value ) . ConfigureAwait ( false ) ;
66- await items . Expect ( ) . ToHaveCountAsync ( 1 ) . ConfigureAwait ( false ) ;
67- await items . ClickAsync ( ) . ConfigureAwait ( false ) ;
66+ await items . Expect ( )
67+ . ToHaveCountAsync ( 1 , new LocatorAssertionsToHaveCountOptions { Timeout = options ? . Timeout } )
68+ . ConfigureAwait ( false ) ;
69+ await items . ClickAsync ( options ) . ConfigureAwait ( false ) ;
6870 }
6971
70- public async Task SelectAsync ( Regex value )
72+ public async Task SelectAsync ( Regex value , LocatorClickOptions ? options = default )
7173 {
7274 var items = await GetComboboxMenuItemsLocatorAsync ( value ) . ConfigureAwait ( false ) ;
73- await items . Expect ( ) . ToHaveCountAsync ( 1 ) . ConfigureAwait ( false ) ;
74- await items . ClickAsync ( ) . ConfigureAwait ( false ) ;
75+ await items . Expect ( )
76+ . ToHaveCountAsync ( 1 , new LocatorAssertionsToHaveCountOptions { Timeout = options ? . Timeout } )
77+ . ConfigureAwait ( false ) ;
78+ await items . ClickAsync ( options ) . ConfigureAwait ( false ) ;
7579 }
7680
7781 public async Task FillAsync ( string value , LocatorFillOptions ? options = default )
7882 {
79- await FocusAsync ( ) . ConfigureAwait ( false ) ;
83+ await FocusAsync ( new LocatorFocusOptions { Timeout = options ? . Timeout } ) . ConfigureAwait ( false ) ;
8084 await NativeInputLocator . FillAsync ( value , options ) . ConfigureAwait ( false ) ;
8185 }
8286
8387 public async Task ClearAsync ( LocatorClearOptions ? options = default )
8488 {
85- await FocusAsync ( ) . ConfigureAwait ( false ) ;
89+ await FocusAsync ( new LocatorFocusOptions { Timeout = options ? . Timeout } ) . ConfigureAwait ( false ) ;
8690 await NativeInputLocator . ClearAsync ( options ) . ConfigureAwait ( false ) ;
8791 }
8892
89- public async Task FocusAsync ( )
93+ public async Task FocusAsync ( LocatorFocusOptions ? options = default )
9094 {
91- await NativeInputLocator . Expect ( ) . ToBeEnabledAsync ( ) . ConfigureAwait ( false ) ;
95+ await NativeInputLocator . Expect ( )
96+ . ToBeEnabledAsync ( new LocatorAssertionsToBeEnabledOptions { Timeout = options ? . Timeout } )
97+ . ConfigureAwait ( false ) ;
9298 await RootLocator
9399 . Locator ( "input[type='text']" )
94100 . Or ( RootLocator . Locator ( "[data-tid='InputLikeText__root']" ) )
95- . FocusAsync ( )
101+ . FocusAsync ( options )
96102 . ConfigureAwait ( false ) ;
97103 }
98104
99- public async Task BlurAsync ( )
100- => await NativeInputLocator . PressAsync ( "Tab" ) . ConfigureAwait ( false ) ;
105+ public async Task BlurAsync ( LocatorBlurOptions ? options = default )
106+ => await NativeInputLocator . PressAsync (
107+ "Tab" ,
108+ new LocatorPressOptions { Timeout = options ? . Timeout }
109+ ) . ConfigureAwait ( false ) ;
101110
102111 public override async Task ClickAsync ( LocatorClickOptions ? options = default )
103112 {
104113 // NOTE: rootLocator всегда в состоянии enabled, даже если ComboBox disabled
105- await NativeInputLocator . Expect ( ) . ToBeEnabledAsync ( ) . ConfigureAwait ( false ) ;
114+ await ExpectV2 ( )
115+ . ToBeEnabledAsync ( new LocatorAssertionsToBeEnabledOptions { Timeout = options ? . Timeout } )
116+ . ConfigureAwait ( false ) ;
106117 await base . ClickAsync ( options ) . ConfigureAwait ( false ) ;
107118 }
108119
109120 public async Task < Tooltip > GetTooltipAsync ( TooltipType type )
110121 => await TooltipProvider . GetTooltipAsync ( type , this ) . ConfigureAwait ( false ) ;
111122
123+ /// <summary>
124+ /// Возвращает список меню по data-tid из react-ui:
125+ /// - MenuItem__root
126+ /// - MenuMessage__root
127+ /// - ComboBoxMenu__item
128+ /// - ComboBoxMenu__notFound
129+ /// - MenuHeader__root
130+ /// - MenuFooter__root
131+ /// </summary>
112132 public async Task < ControlList < MenuItem > > GetMenuItemsAsync ( )
113133 {
114134 await FocusAsync ( ) . ConfigureAwait ( false ) ;
115135 var container = await portal . GetContainerAsync ( ) . ConfigureAwait ( false ) ;
116136 await container . Locator ( "[data-tid='Spinner__root']" )
117- . WaitForAsync ( new LocatorWaitForOptions { State = WaitForSelectorState . Hidden } ) . ConfigureAwait ( false ) ;
137+ . WaitForAsync ( new LocatorWaitForOptions { State = WaitForSelectorState . Hidden } )
138+ . ConfigureAwait ( false ) ;
118139
119140 return new ControlList < MenuItem > (
120141 container ,
0 commit comments