summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla24574.cs
blob: b6d3c508b0d35da4c34bd729eeb9fd8028dd795b (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 System;

using Xamarin.Forms.CustomAttributes;

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

namespace Xamarin.Forms.Controls
{
	[Preserve (AllMembers = true)]
	[Issue (IssueTracker.Bugzilla, 24574, "Tap Double Tap")]
	public class Issue24574 : TestContentPage // or TestMasterDetailPage, etc ...
	{
		protected override void Init ()
		{
			var label = new Label {
				AutomationId = "TapLabel",
				Text = "123" 
			};

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

			rec = new TapGestureRecognizer () { NumberOfTapsRequired = 2 };
			rec.Tapped += (s, e) => { label.Text = "Double"; };
			label.GestureRecognizers.Add (rec);

			Content = label;
		}

#if UITEST
		[Test]
		public void Issue1Test ()
		{
			RunningApp.Screenshot ("I am at Issue 24574");

			RunningApp.WaitForElement (q => q.Marked ("TapLabel"));
			
			RunningApp.Tap (q => q.Marked ("TapLabel"));
			RunningApp.WaitForElement (q => q.Marked ("Single"));
			
			RunningApp.DoubleTap (q => q.Marked ("TapLabel"));
			RunningApp.WaitForElement (q => q.Marked ("Double"));
		}
#endif
	}
}