summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Core.iOS.UITests/Tests/DisplayAlertUITests.cs
diff options
context:
space:
mode:
authorJason Smith <jason.smith@xamarin.com>2016-03-22 13:02:25 -0700
committerJason Smith <jason.smith@xamarin.com>2016-03-22 16:13:41 -0700
commit17fdde66d94155fc62a034fa6658995bef6fd6e5 (patch)
treeb5e5073a2a7b15cdbe826faa5c763e270a505729 /Xamarin.Forms.Core.iOS.UITests/Tests/DisplayAlertUITests.cs
downloadxamarin-forms-17fdde66d94155fc62a034fa6658995bef6fd6e5.tar.gz
xamarin-forms-17fdde66d94155fc62a034fa6658995bef6fd6e5.tar.bz2
xamarin-forms-17fdde66d94155fc62a034fa6658995bef6fd6e5.zip
Initial import
Diffstat (limited to 'Xamarin.Forms.Core.iOS.UITests/Tests/DisplayAlertUITests.cs')
-rw-r--r--Xamarin.Forms.Core.iOS.UITests/Tests/DisplayAlertUITests.cs85
1 files changed, 85 insertions, 0 deletions
diff --git a/Xamarin.Forms.Core.iOS.UITests/Tests/DisplayAlertUITests.cs b/Xamarin.Forms.Core.iOS.UITests/Tests/DisplayAlertUITests.cs
new file mode 100644
index 00000000..be0e4997
--- /dev/null
+++ b/Xamarin.Forms.Core.iOS.UITests/Tests/DisplayAlertUITests.cs
@@ -0,0 +1,85 @@
+using NUnit.Framework;
+using Xamarin.UITest;
+using System;
+using System.Threading;
+
+
+namespace Xamarin.Forms.Core.UITests
+{
+ [TestFixture]
+ [Category ("DisplayAlert")]
+ internal class DisplayAlertUITests : BaseTestFixture
+ {
+
+ protected override void NavigateToGallery ()
+ {
+ App.NavigateToGallery (GalleryQueries.DisplayAlertGallery);
+ }
+
+ [Test]
+ public void TestWithCancelButton ()
+ {
+
+ App.Tap (c => c.Marked ("Alert Override1"));
+ App.Screenshot ("Display Alert");
+ App.WaitForElement (c => c.Marked ("TheAlertTitle"));
+ App.WaitForElement (c => c.Marked ("TheAlertMessage"));
+ App.WaitForElement (c => c.Marked ("TheCancelButton"));
+ App.Screenshot ("Display Alert Closed");
+ App.Tap (c => c.Marked ("TheCancelButton"));
+ App.WaitForNoElement (c => c.Marked ("TheAlertTitle"));
+ }
+
+ [Test]
+ public void TestWithCancelAndOkButton ()
+ {
+ App.Tap (c => c.Marked ("Alert Override2"));
+ App.Screenshot ("Display Alert");
+ App.WaitForElement (c => c.Marked ("TheAlertTitle"));
+ App.WaitForElement (c => c.Marked ("TheAlertMessage"));
+ App.WaitForElement (c => c.Marked ("TheAcceptButton"));
+ App.WaitForElement (c => c.Marked ("TheCancelButton"));
+ App.Tap (c => c.Marked ("TheCancelButton"));
+ App.Screenshot ("Display Alert Closed");
+ App.WaitForNoElement (c => c.Marked ("TheAlertTitle"));
+ }
+
+ [Test]
+ public void TestOkAndCancelResults ()
+ {
+ App.Tap (c => c.Marked ("Alert Override2"));
+ App.Screenshot ("Display Alert");
+ App.WaitForElement (c => c.Marked ("TheCancelButton"));
+ App.Tap (c => c.Marked ("TheCancelButton"));
+ App.Screenshot ("Display Alert Closed with cancel");
+ App.WaitForElement (c => c.Marked ("Result: False"));
+ App.Tap (c => c.Marked ("test2"));
+ App.Screenshot ("Display Alert");
+ App.WaitForElement (c => c.Marked ("TheAcceptButton"));
+ App.Tap (c => c.Marked ("TheAcceptButton"));
+ App.Screenshot ("Display Alert Closed with True");
+ App.WaitForElement (c => c.Marked ("Result: True"));
+ }
+
+// [Test]
+// public void TestRotation ()
+// {
+// App.SetOrientationLandscape ();
+//
+// //App.Tap (c => c.Marked ("Alert Override1"));
+// // 27-01-2015 14:30:02.125 -08:00 - 28524 - Tapping first element (2 total) matching Marked("Alert Override1") at coordinates [ 512, 113 ].
+//
+// App.TapCoordinates (665, 512);
+//
+// App.WaitForElement (c => c.Marked ("TheAlertTitle"));
+//
+// App.Screenshot ("Display Alert After Rotation");
+// App.WaitForElement (c => c.Marked ("TheAlertTitle"));
+// App.Tap (c => c.Marked("TheCancelButton"));
+// App.WaitForNoElement (c => c.Marked("TheCancelButton"));
+// App.SetOrientationPortrait ();
+//
+// }
+
+ }
+}