File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
tests/MaterialDesignThemes.UITests/WPF/TextBoxes Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -335,12 +335,18 @@ public async Task ContextMenu_UsesInheritedFontFamily()
335335</StackPanel>
336336" ) ;
337337 var textBox = await stackPanel . GetElement < TextBox > ( "/TextBox" ) ;
338- await textBox . RightClick ( ) ;
339-
340- var contextMenu = await textBox . GetElement < ContextMenu > ( ".ContextMenu" ) ;
341-
342338 var textBoxFont = await textBox . GetFontFamily ( ) ;
343339 await Assert . That ( textBoxFont ? . FamilyNames . Values . First ( ) ) . IsEqualTo ( "Times New Roman" ) ;
340+
341+ IVisualElement < ContextMenu > contextMenu = null ! ;
342+ await Wait . For ( async ( ) =>
343+ {
344+ await textBox . RightClick ( ) ;
345+ contextMenu = await textBox . GetElement < ContextMenu > ( ".ContextMenu" ) ;
346+ return await contextMenu . GetIsOpen ( ) ;
347+ } ) ;
348+
349+
344350 await Assert . That ( await contextMenu . GetFontFamily ( ) ) . IsEqualTo ( textBoxFont ) ;
345351
346352 recorder . Success ( ) ;
You can’t perform that action at this time.
0 commit comments