summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue774.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue774.cs')
-rw-r--r--Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue774.cs77
1 files changed, 77 insertions, 0 deletions
diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue774.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue774.cs
new file mode 100644
index 00000000..7eec0f6c
--- /dev/null
+++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue774.cs
@@ -0,0 +1,77 @@
+´╗┐using System.Diagnostics;
+
+using Xamarin.Forms.CustomAttributes;
+
+#if UITEST
+using Xamarin.UITest;
+using NUnit.Framework;
+using Xamarin.UITest.iOS;
+#endif
+
+namespace Xamarin.Forms.Controls
+{
+ [Preserve (AllMembers = true)]
+ [Issue (IssueTracker.Github, 774, "ActionSheet won't dismiss after rotation to landscape", PlatformAffected.Android, NavigationBehavior.PushModalAsync)]
+ public class Issue774 : TestContentPage
+ {
+ protected override void Init ()
+ {
+ Content = new StackLayout {
+ Children = {
+ new Label {
+ Text = "Hi"
+ },
+ new Button {
+ Text = "Show ActionSheet",
+ Command = new Command (async () => await DisplayActionSheet ("What's up", "Dismiss", "Destroy"))
+ }
+ }
+ };
+ }
+
+#if UITEST
+ [Test]
+ public void Issue774TestsDismissActionSheetAfterRotation ()
+ {
+
+ RunningApp.Tap (q => q.Button ("Show ActionSheet"));
+ RunningApp.Screenshot ("Show ActionSheet");
+
+ RunningApp.SetOrientationLandscape ();
+ RunningApp.Screenshot ("Rotate Device");
+
+ var app = (RunningApp as iOSApp);
+
+ if (app != null) {
+
+ if (!app.Device.IsTablet)
+ RunningApp.Tap (q => q.Marked ("Dismiss"));
+ else // iPad does not have dismiss option
+ RunningApp.Tap (q => q.Marked ("Destroy"));
+
+ if(app.Device.IsTablet)
+ RunningApp.WaitForNoElement (q => q.Marked ("Destroy"));
+ else
+ RunningApp.WaitForNoElement (q => q.Marked ("Dismiss"));
+ RunningApp.Screenshot ("Dismiss ActionSheet");
+
+// App.SetOrientationPortrait ();
+// App.Tap (q => q.Button ("Show ActionSheet"));
+// App.Screenshot ("Rotate and show ActionSheet");
+//
+// if (!app.Device.IsTablet)
+// App.Tap (q => q.Button ("Dismiss"));
+// else // iPad does not have dismiss option
+// App.Tap (q => q.Marked ("Destroy"));
+//
+// if (app.Device.IsTablet)
+// App.WaitForNoElement (q => q.Marked ("Destroy"));
+// else // iPad does not have dismiss option
+// App.WaitForNoElement (q => q.Marked ("Dismiss"));
+
+ }
+ }
+#endif
+
+ }
+}