summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla35477.cs
blob: 5fc92ce75f9e29cd091c43c06b2e80ad64988ebd (plain)
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
using Xamarin.Forms.CustomAttributes;
using Xamarin.Forms.Internals;

#if UITEST
using NUnit.Framework;
using Xamarin.UITest.Queries;
#endif

namespace Xamarin.Forms.Controls.Issues
{
	[Preserve (AllMembers = true)]
	[Issue (IssueTracker.Bugzilla, 35477, "Tapped event does not fire when added to Frame in Android AppCompat",
		PlatformAffected.Android)]
	public class Bugzilla35477 : TestContentPage
	{
		protected override void Init ()
		{
			var instructions = new Label {
				Text = "Tap the frame below. The label with the text 'No taps yet' should change its text to 'Frame was tapped'."
			};
			var frame = new Frame () {};
			var frameLabel = new Label() {Text = "Tap here" };

			frame.Content = new StackLayout() {Children = { frameLabel }};

			var label = new Label { Text = "No taps yet" };

			var rec = new TapGestureRecognizer { NumberOfTapsRequired = 1 };
			rec.Tapped += (s, e) => { label.Text = "Frame was tapped"; };
			frame.GestureRecognizers.Add (rec);

			Content = new StackLayout {
				Children = { instructions, frame, label }
			};
		}

#if UITEST
		[Test]
		public void TapGestureFiresOnFrame ()
		{
			RunningApp.WaitForElement ("No taps yet");
			RunningApp.WaitForElement ("Tap here");
			
		    RunningApp.Tap ("Tap here");

			RunningApp.WaitForElement ("Frame was tapped");
		}
#endif
	}
}