-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
Bugzilla51825.cs
74 lines (66 loc) · 1.79 KB
/
Bugzilla51825.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
using Xamarin.Forms.CustomAttributes;
using Xamarin.Forms.Internals;
#if UITEST
using Xamarin.UITest;
using NUnit.Framework;
#endif
namespace Xamarin.Forms.Controls.Issues
{
#if UITEST
[NUnit.Framework.Category(Core.UITests.UITestCategories.Bugzilla)]
#endif
[Preserve(AllMembers = true)]
[Issue(IssueTracker.Bugzilla, 51825, "[iOS] Korean input in SearchBar doesn't work", PlatformAffected.iOS)]
public class Bugzilla51815 : TestContentPage
{
protected override void Init()
{
var sb = new SearchBar { AutomationId = "Bugzilla51825SearchBar" };
var text = new Label { AutomationId = "Bugzilla51825Label" };
sb.TextChanged += (sender, e) =>
{
text.Text = sb.Text;
};
Content = new StackLayout
{
Children =
{
sb,
new Button
{
AutomationId = "Bugzilla51825Button",
Text = "Change SearchBar text",
Command = new Command(() =>
{
sb.Text = "Test";
})
},
text,
new Label
{
Text = "The label above should match the text in the SearchBar; " +
"additionally, typing Korean characters should properly combine them."
}
}
};
}
#if UITEST
[Test]
public void Bugzilla51825Test()
{
RunningApp.WaitForElement(q => q.Marked("Bugzilla51825SearchBar"));
RunningApp.EnterText("Bugzilla51825SearchBar", "Hello");
var label = RunningApp.WaitForFirstElement("Bugzilla51825Label");
Assert.IsNotEmpty(label.ReadText());
// Windows App Driver and the Search Bar are a bit buggy
// It randomly doesn't enter the first letter
#if !__WINDOWS__
Assert.AreEqual("Hello", label.ReadText());
#endif
RunningApp.Tap("Bugzilla51825Button");
var labelChange2 = RunningApp.WaitForFirstElement("Bugzilla51825Label");
Assert.AreEqual("Test", labelChange2.ReadText());
}
#endif
}
}