summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Core.iOS.UITests/Tests/ActivityIndicatorUITests.cs
blob: 325a5682e1ac6f7311fc18846d3707f3cbb3783b (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
68
69
70
71
72
73
74
75
76
using System;
using System.IO;
using System.Linq;

using NUnit.Framework;

using Xamarin.Forms.CustomAttributes;
using Xamarin.UITest.Queries;

namespace Xamarin.Forms.Core.UITests
{
	[TestFixture]
	[Category ("ActivityIndicator")]
	internal class ActivityIndicatorUITests : _ViewUITests
	{
		public ActivityIndicatorUITests ()
		{
			PlatformViewType = Views.ActivityIndicator;
		}

		protected override void NavigateToGallery ()
		{
			App.NavigateToGallery (GalleryQueries.ActivityIndicatorGallery);
		}

		// View tests
		[UiTestExempt (ExemptReason.CannotTest, "Invalid interaction")]
		public override void _Focus () {}

		public override void _GestureRecognizers ()
		{
			// TODO Can implement this
			var remote = new ViewContainerRemote (App, Test.View.GestureRecognizers, PlatformViewType);
			remote.GoTo ();
		}
		[UiTestExempt (ExemptReason.CannotTest, "Invalid interaction")]
		public override void _IsEnabled () {}

		[UiTestExempt (ExemptReason.CannotTest, "Invalid interaction")]
		public override void _IsFocused () {}

		[UiTestExempt (ExemptReason.CannotTest, "Invalid interaction")]
		public override void _UnFocus () {}

		//[UiTest (typeof(ActivityIndicator), "Color")]
		public void Color ()
		{
			//TODO: this was failing and is changing in next version of calabash (UI-Test-pre nuget) to a json rgb

//			var remote = RemoteFactory.CreateRemote<ViewContainerRemote> (App, "Color", PlatformViewType);
//			remote.GoTo ();
//
//			var color = remote.GetProperty<Color> (ActivityIndicator.ColorProperty);
//			Assert.AreEqual (Forms.Color.Lime, color);
		}

		// ActivityIndicator tests
		[Test]
		[UiTest (typeof(ActivityIndicator), "IsRunning")]
		public void IsRunning ()
		{
			var remote = new ViewContainerRemote (App, Test.ActivityIndicator.IsRunning, PlatformViewType);
			remote.GoTo ();

			var isRunning = remote.GetProperty<bool> (ActivityIndicator.IsRunningProperty);
			Assert.IsTrue (isRunning);
		}
		
		protected override void FixtureTeardown ()
		{
			App.NavigateBack ();
			base.FixtureTeardown ();
		}

	}
}