summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzila57749.cs
blob: 1d3aa0564b4f68f5c66185c58856a5f719efb552 (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;
using System;
using System.Threading.Tasks;

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

namespace Xamarin.Forms.Controls.Issues
{
	[Preserve(AllMembers = true)]
	[Issue(IssueTracker.Bugzilla, 57749, "After enabling a disabled button it is not clickable", PlatformAffected.UWP)]
	public class Bugzilla57749 : TestContentPage 
	{
		protected override void Init()
		{
			button1.Text = "Click me";
			button1.AutomationId = "btnClick";
			button1.IsEnabled = false;
			button1.Clicked += Button1_Clicked1;
			this.Content = button1;
		}
		Button button1 = new Button();

		private void Button1_Clicked1(object sender, EventArgs e)
		{
			this.DisplayAlert("Button test", "Button was clicked", "Ok");
		}

		protected async override void OnAppearing()
		{
			base.OnAppearing();
			await Task.Delay(100);
			button1.IsEnabled = true;
		}

#if UITEST
		[Test]
		public async void Bugzilla57749Test()
		{
			await Task.Delay(500);
			RunningApp.Tap(c => c.Marked("btnClick"));
			RunningApp.WaitForElement (q => q.Marked ("Button was clicked"));
			RunningApp.Tap("Ok");
		}
#endif
	}
}