-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
Issue5132.cs
79 lines (74 loc) · 2.03 KB
/
Issue5132.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
using Xamarin.Forms.CustomAttributes;
using Xamarin.Forms.Internals;
using Xamarin.Forms.Controls;
#if UITEST
using Xamarin.Forms.Core.UITests;
using Xamarin.UITest;
using NUnit.Framework;
#endif
namespace Xamarin.Forms.Controls.Issues
{
#if UITEST
[Category(UITestCategories.Shell)]
#endif
[Preserve(AllMembers = true)]
[Issue(IssueTracker.Github, 5132, "Unable to specify automation properties on the hamburger/flyout icon", PlatformAffected.Default)]
public class Issue5132 : TestShell
{
string _idIconElement = "shellIcon";
string _titleElement = "Connect";
protected override void Init()
{
Title = "Shell";
FlyoutIcon = new FontImageSource
{
Glyph = "\uf2fb",
FontFamily = DefaultFontFamily(),
Size = 20,
AutomationId = _idIconElement
};
FlyoutIcon.SetValue(AutomationProperties.HelpTextProperty, "This as Shell FlyoutIcon");
FlyoutIcon.SetValue(AutomationProperties.NameProperty, "Shell Icon");
Items.Add(new FlyoutItem
{
Title = _titleElement,
Items = {
new Tab { Title = "library",
Items = {
new ContentPage { Title = "Library", Content = new ScrollView { Content = new Label { Text = "Turn accessibility on and make sure the help text is read on iOS, on Android it will read the AutomationID if specified and then the HelpText this allows UITest to work " } } }
}
}
}
});
}
static string DefaultFontFamily()
{
var fontFamily = "";
switch (Device.RuntimePlatform)
{
case Device.iOS:
fontFamily = "Ionicons";
break;
case Device.UWP:
fontFamily = "Assets/Fonts/ionicons.ttf#ionicons";
break;
case Device.Android:
default:
fontFamily = "fonts/ionicons.ttf#";
break;
}
return fontFamily;
}
#if UITEST
#if !(__ANDROID__ || __IOS__)
[Ignore("Shell test is only supported on Android and iOS")]
#endif
[Test]
public void ShellFlyoutAndHamburgerAutomationProperties()
{
RunningApp.WaitForElement(q => q.Marked(_idIconElement));
TapInFlyout(_titleElement, _idIconElement);
}
#endif
}
}