File tree Expand file tree Collapse file tree 3 files changed +9
-7
lines changed
samples/IntegrationTestApp
tests/Avalonia.IntegrationTests.Appium Expand file tree Collapse file tree 3 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ private void InitializeViewMenu()
49
49
var menuItem = new NativeMenuItem
50
50
{
51
51
Header = ( string ? ) tabItem . Header ,
52
- ToolTip = ( string ? ) tabItem . Header ,
52
+ ToolTip = $ "Tip: { ( string ? ) tabItem . Header } " ,
53
53
IsChecked = tabItem . IsSelected ,
54
54
ToggleType = NativeMenuItemToggleType . Radio ,
55
55
} ;
Original file line number Diff line number Diff line change @@ -33,7 +33,9 @@ internal class NativeMenuBarPresenter : Menu
33
33
[ ! MenuItem . InputGestureProperty ] = nativeItem . GetObservable ( NativeMenuItem . GestureProperty ) . ToBinding ( ) ,
34
34
[ ! MenuItem . ToggleTypeProperty ] = nativeItem . GetObservable ( NativeMenuItem . ToggleTypeProperty )
35
35
// TODO12 remove NativeMenuItemToggleType
36
- . Select ( v => ( MenuItemToggleType ) v ) . ToBinding ( )
36
+ . Select ( v => ( MenuItemToggleType ) v ) . ToBinding ( ) ,
37
+ [ ! ToolTip . TipProperty ] =
38
+ nativeItem . GetObservable ( NativeMenuItem . ToolTipProperty ) . ToBinding ( ) ,
37
39
} ;
38
40
39
41
BindingOperations . Apply ( newItem , MenuItem . IsCheckedProperty , InstancedBinding . TwoWay (
Original file line number Diff line number Diff line change @@ -70,13 +70,13 @@ public void Win32_Avalonia_Menu_Has_ToolTip_If_Defined()
70
70
buttonMenuItem . MovePointerOver ( ) ;
71
71
72
72
// Wait for tooltip to open.
73
- Thread . Sleep ( 1000 ) ;
73
+ Thread . Sleep ( 2000 ) ;
74
74
75
75
var toolTipCandidates = _session . FindElementsByClassName ( "TextBlock" ) ;
76
- Assert . Contains ( toolTipCandidates , x => x . Text == "Button" ) ;
76
+ Assert . Contains ( toolTipCandidates , x => x . Text == "Tip: Button" ) ;
77
77
}
78
78
79
- [ PlatformFact ( TestPlatforms . MacOS ) ]
79
+ [ PlatformFact ( TestPlatforms . MacOS , Skip = "Flaky test" ) ]
80
80
public void MacOS_Native_Menu_Has_ToolTip_If_Defined ( )
81
81
{
82
82
var menuBar = _session . FindElementByXPath ( "/XCUIElementTypeApplication/XCUIElementTypeMenuBar" ) ;
@@ -87,10 +87,10 @@ public void MacOS_Native_Menu_Has_ToolTip_If_Defined()
87
87
buttonMenuItem . MovePointerOver ( ) ;
88
88
89
89
// Wait for tooltip to open.
90
- Thread . Sleep ( 2000 ) ;
90
+ Thread . Sleep ( 4000 ) ;
91
91
92
92
var toolTipCandidates = _session . FindElementsByClassName ( "XCUIElementTypeStaticText" ) ;
93
- Assert . Contains ( toolTipCandidates , x => x . Text == "Button" ) ;
93
+ Assert . Contains ( toolTipCandidates , x => x . Text == "Tip: Button" ) ;
94
94
}
95
95
}
96
96
}
You can’t perform that action at this time.
0 commit comments