summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla35157.cs
blob: ec71bd851768f0a2abf02996063fef4a7ed47fc9 (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
using Xamarin.Forms.CustomAttributes;
using Xamarin.Forms.Internals;

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

namespace Xamarin.Forms.Controls.Issues
{
	[Preserve (AllMembers = true)]
	[Issue (IssueTracker.Bugzilla, 35157, "CarouselPage inside NavPage inside TabbedPage gets laid out incorrectly", NavigationBehavior.PushModalAsync)]
	public class Bugzilla35157 : TestTabbedPage
	{
		protected override void Init ()
		{
			var button = new Button {
				Text = "Go",
				AutomationId = "firstButton"
			};

			
			button.Clicked += (sender, args) => {
				Button button2 = null;
				button.Navigation.PushAsync (new CarouselPage {
					Children = {
						new ContentPage {
							Content = button2 = new Button {
								AutomationId = "secondButton",
								VerticalOptions = LayoutOptions.EndAndExpand,
								Text = "Click Me"
							}
						}
					}
				});

				button2.Clicked += (s, a) => button2.Text = "Button Clicked!";
			};

			var tab = new NavigationPage(new ContentPage {Content = button});
			tab.Title = "Tab";
			Children.Add (tab);

			
		}

#if UITEST
		[Test]
		public void ButtonCanBeClicked ()
		{
			RunningApp.WaitForElement (q => q.Marked ("firstButton"));
			RunningApp.Tap (q => q.Marked ("firstButton"));
			RunningApp.WaitForElement (q => q.Marked ("secondButton"));
			RunningApp.Tap (q => q.Marked ("secondButton"));
			RunningApp.WaitForElement (q => q.Button ("Button Clicked!"));
		}
#endif
	}
}