summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla30166.cs
blob: 9f4ed7c76f81bdad963cd420412e34f3ae1512ee (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
using System;
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, 30166, "NavigationBar.BarBackgroundColor resets on Lollipop after popping modal page", PlatformAffected.Android)]
	public class Bugzilla30166 : TestNavigationPage
	{
		protected override void Init()
		{
			BarBackgroundColor = Color.Red;

			Navigation.PushAsync(new ContentPage
			{
				Content = new Button
				{
					Text = "Push Modal",
					Command = new Command(async () => await Navigation.PushModalAsync(new ContentPage
					{
						Content = new Button
						{
							Text = "Back",
							Command = new Command(async () => await Navigation.PopModalAsync()),
						},
					})),
				},
			});
		}

#if UITEST
		[Test]
		public void Bugzilla30166Test()
		{
			RunningApp.WaitForElement(q => q.Marked("Push Modal"));
			RunningApp.Tap(q => q.Marked("Push Modal"));
			RunningApp.WaitForElement(q => q.Marked("Back"));
			RunningApp.Tap(q => q.Marked("Back"));
			RunningApp.Screenshot("Navigation bar should be red");
		}
#endif
	}
}