summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/TabbedPageTests.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/TabbedPageTests.cs')
-rw-r--r--Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/TabbedPageTests.cs64
1 files changed, 64 insertions, 0 deletions
diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/TabbedPageTests.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/TabbedPageTests.cs
new file mode 100644
index 00000000..d2c4de71
--- /dev/null
+++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/TabbedPageTests.cs
@@ -0,0 +1,64 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Xamarin.Forms.CustomAttributes;
+
+#if UITEST
+using NUnit.Framework;
+using Xamarin.UITest;
+#endif
+
+namespace Xamarin.Forms.Controls
+{
+ [Preserve (AllMembers = true)]
+ [Issue (IssueTracker.None, 0,"TabbedPage nav tests", PlatformAffected.All)]
+ public class TabbedPageTests : TestTabbedPage
+ {
+ protected override void Init ()
+ {
+ var popButton1 = new Button () { Text = "Pop", BackgroundColor = Color.Blue };
+ popButton1.Clicked += (s, a) => Navigation.PopModalAsync ();
+
+ var popButton2 = new Button () { Text = "Pop 2", BackgroundColor = Color.Blue };
+ popButton2.Clicked += (s, a) => Navigation.PopModalAsync ();
+
+ Children.Add (new ContentPage () { Title = "Page 1", Content = popButton1 });
+ Children.Add (new ContentPage () { Title = "Page 2", Content = popButton2 });
+ }
+
+#if UITEST
+ [Test]
+ public void TabbedPageWithModalIssueTestsAllElementsPresent ()
+ {
+ RunningApp.WaitForElement (q => q.Marked ("Page 1"));
+ RunningApp.WaitForElement (q => q.Marked ("Page 2"));
+ RunningApp.WaitForElement (q => q.Button ("Pop"));
+
+ RunningApp.Screenshot ("All elements present");
+ }
+
+ [Test]
+ public void TabbedPageWithModalIssueTestsPopFromFirstTab ()
+ {
+ RunningApp.Tap (q => q.Button ("Pop"));
+ RunningApp.WaitForElement (q => q.Marked ("Bug Repro's"));
+
+ RunningApp.Screenshot ("Popped from first tab");
+ }
+
+ [Test]
+ public void TabbedPageWithModalIssueTestsPopFromSecondTab ()
+ {
+ RunningApp.Tap (q => q.Marked ("Page 2"));
+ RunningApp.WaitForElement (q => q.Button ("Pop 2"));
+ RunningApp.Screenshot ("On second tab");
+
+ RunningApp.Tap (q => q.Button ("Pop 2"));
+ RunningApp.WaitForElement (q => q.Marked ("Bug Repro's"));
+ RunningApp.Screenshot ("Popped from second tab");
+ }
+#endif
+ }
+}