diff options
Diffstat (limited to 'Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue198.cs')
-rw-r--r-- | Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue198.cs | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue198.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue198.cs new file mode 100644 index 00000000..099ea3f9 --- /dev/null +++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue198.cs @@ -0,0 +1,78 @@ +using Xamarin.Forms.CustomAttributes; + +#if UITEST +using NUnit.Framework; +using Xamarin.UITest; +#endif + +namespace Xamarin.Forms.Controls +{ + [Preserve (AllMembers=true)] + [Issue (IssueTracker.Github, 198, "TabbedPage shouldn't proxy content of NavigationPage", PlatformAffected.iOS)] + public class Issue198 : TestTabbedPage + { + protected override void Init () + { + Title = "Tabbed Navigation Page"; + + var leavePageBtn = new Button { + Text = "Leave" + }; + + // Should work as expected, however, causes NRE + leavePageBtn.Clicked += (s, e) => Navigation.PopModalAsync (); + + var navigationPageOne = new NavigationPage (new ContentPage { + Icon = "calculator.png", + Content = leavePageBtn + }) { + Title = "Page One", + }; + var navigationPageTwo = new NavigationPage (new ContentPage { + Icon = "calculator.png", + }) { + Title = "Page Two", + }; + var navigationPageThree = new NavigationPage (new ContentPage { + Title = "No Crash", + }) { + Title = "Page Three", + Icon = "calculator.png" + }; + var navigationPageFour = new NavigationPage (new ContentPage ()) { + Title = "Page Four", + Icon = "calculator.png" + }; + + Children.Add (navigationPageOne); + Children.Add (navigationPageTwo); + Children.Add (navigationPageThree); + Children.Add (navigationPageFour); + } + +#if UITEST + [Test] + [UiTest (typeof(TabbedPage))] + public void Issue198TestsNREWithPopModal () + { + RunningApp.WaitForElement (q => q.Marked ("Page One")); + RunningApp.WaitForElement (q => q.Button ("Leave")); + RunningApp.Screenshot ("All Elements Present"); + + RunningApp.Tap (q => q.Marked ("Leave")); + RunningApp.Screenshot ("Clicked Leave"); + + RunningApp.WaitForElement (q => q.Marked ("Bug Repro's")); + RunningApp.Tap (q => q.Marked ("SearchButton")); + RunningApp.Screenshot ("Navigate into gallery again"); + + RunningApp.WaitForElement (q => q.Marked ("Page Three")); + RunningApp.Tap (q => q.Marked ("Page Three")); + + RunningApp.WaitForElement (q => q.Marked ("No Crash")); + RunningApp.Screenshot ("App did not crash"); + } +#endif + + } +} |