summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla58779.cs
blob: e83f50122fff4a58f640132ff954f95d10176b75 (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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
using Xamarin.Forms.CustomAttributes;
using Xamarin.Forms.Internals;
using System.Collections.ObjectModel;
using System;

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

namespace Xamarin.Forms.Controls.Issues
{
	[Preserve(AllMembers = true)]
	[Issue(IssueTracker.Bugzilla, 58779, "[MacOS] DisplayActionSheet on MacOS needs scroll bars if list is long", PlatformAffected.All)]
	public class Bugzilla58779 : TestContentPage
	{
		const string ButtonId = "button";

		protected override void Init()
		{
			Button button = new Button
			{
				Text = "Click Here",
				Font = Font.SystemFontOfSize(NamedSize.Large),
				BorderWidth = 1,
				HorizontalOptions = LayoutOptions.Center,
				VerticalOptions = LayoutOptions.CenterAndExpand,
				AutomationId = ButtonId,
			};

			// The root page of your application
			var content = new StackLayout {
				VerticalOptions = LayoutOptions.Center,
				Children = {
					new Label {
						HorizontalTextAlignment = TextAlignment.Center,
						Text = "Tap on the button to show the DisplayActionSheet with 15 items"
					},
					new Label {
						HorizontalTextAlignment = TextAlignment.Center,
						Text = "The list of items should be scrollable and Cancel should be visible"
					},
					button

				}
			};

			button.Clicked += (sender, e) => {
				String[] string_array = {"1","2","3","4","5","6","7","8","9","10","11","12","13","14","15"};
				this.DisplayActionSheet("title","cancel","destruction",string_array);
			};

			Content = content;
		}


#if UITEST
		[Test]
		public void Bugzilla58779Test()
		{
			RunningApp.WaitForElement(q => q.Marked(ButtonId));
			RunningApp.Tap(q => q.Marked(ButtonId));
			RunningApp.Screenshot ("Check list fits on screen");
		}
#endif
	}
}