diff options
author | Jason Smith <jason.smith@xamarin.com> | 2016-03-22 13:02:25 -0700 |
---|---|---|
committer | Jason Smith <jason.smith@xamarin.com> | 2016-03-22 16:13:41 -0700 |
commit | 17fdde66d94155fc62a034fa6658995bef6fd6e5 (patch) | |
tree | b5e5073a2a7b15cdbe826faa5c763e270a505729 /Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue2923.cs | |
download | xamarin-forms-17fdde66d94155fc62a034fa6658995bef6fd6e5.tar.gz xamarin-forms-17fdde66d94155fc62a034fa6658995bef6fd6e5.tar.bz2 xamarin-forms-17fdde66d94155fc62a034fa6658995bef6fd6e5.zip |
Initial import
Diffstat (limited to 'Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue2923.cs')
-rw-r--r-- | Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue2923.cs | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue2923.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue2923.cs new file mode 100644 index 00000000..68768459 --- /dev/null +++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue2923.cs @@ -0,0 +1,83 @@ +using System.Collections.ObjectModel; +using Xamarin.Forms.CustomAttributes; + +#if UITEST +using Xamarin.UITest; +using NUnit.Framework; +#endif + +namespace Xamarin.Forms.Controls +{ + [Preserve (AllMembers = true)] + [Issue (IssueTracker.Github, 2923, "First tab does not load until navigating", PlatformAffected.WinRT)] + public class Issue2923 : TestTabbedPage + { + protected override void Init() + { + var tabOne = new ContentPage { + Title = "Page One", + BackgroundColor = Color.Blue, + }; + + var tabTwo = new ContentPage { + Title = "Page Two", + BackgroundColor = Color.Red, + Content = new Label { + AutomationId = "SecondPageLabel", + Text = "Second Page" + } + }; + + var buttonResetTabbedPage = new Button { + Text = "Reset", + AutomationId = "ResetButton", + Command = new Command (() => { + + Children.Remove (tabOne); + Children.Remove (tabTwo); + + Children.Add (new ContentPage { + Title = "Reset page", + BackgroundColor = Color.Green, + Content = new Label { + AutomationId = "ResetPageLabel", + Text = "I was reset" + } + }); + + }) + }; + + tabOne.Content = new StackLayout { + Children = { + new Label { + AutomationId = "FirstPageLabel", + Text = "First Page" + }, + buttonResetTabbedPage + } + }; + + Children.Add (tabOne); + Children.Add (tabTwo); + } + +#if UITEST + [Test] + public void Issue2923TestOne () + { + RunningApp.WaitForElement (q => q.Marked ("FirstPageLabel")); + RunningApp.Screenshot ("First Tab is showing"); + } + + [Test] + public void Issue2923TestTwo () + { + RunningApp.Tap (q => q.Marked ("ResetButton")); + RunningApp.Screenshot ("Tabs Reset"); + RunningApp.WaitForElement (q => q.Marked ("ResetPageLabel")); + } +#endif + + } +} |