Run multiple UI tests without restarting ControlGallery (#539)
authorE.Z. Hart <hartez@users.noreply.github.com>
Wed, 16 Nov 2016 21:07:30 +0000 (14:07 -0700)
committerJason Smith <jason.smith@xamarin.com>
Wed, 16 Nov 2016 21:07:30 +0000 (13:07 -0800)
* Allow UI tests to bypass "manual" navigation to isses pages

* Add missing Preserve attribute

* Make Issue198 test work with direct navigation

* Remove empty UI tests

* Fix error handling for iOS

* Use navigation which works for subsequent TestNavigationPages on iOS

* Fix race condition in 39530 test
Remove master page nesting when doing direct nav for UI tests

* Set up and run a single instance of Control Gallery for UI tests

* Force NavigateToIssue to wait for main page appearing to deal with iOS timing

* Move remaining UI tests into Issues namespace

* Change the connection check URL so it'll work on iOS

* Make Appearing Gallery tests work without restarting app

* Prevent ContextActions tests from stepping on each other

* Make context menu test more robust

* Move ButtonExtensions back to Controls namespace

* Have test 774 dismiss the action sheet before ending

* Update UITest package to 2.0.0 stable

* Make 2948 restore orientation when it's done

* Null check on PageController before calling SendDisappearing

* Adding a wait for the root page in the core tests

* Add consecutive tests reset to prevent memory slog on older iOS devices

176 files changed:
Xamarin.Forms.ControlGallery.Android/Activity1.cs
Xamarin.Forms.ControlGallery.Android/CustomRenderers.cs
Xamarin.Forms.ControlGallery.Android/Xamarin.Forms.ControlGallery.Android.csproj
Xamarin.Forms.ControlGallery.iOS/AppDelegate.cs
Xamarin.Forms.ControlGallery.iOS/CustomRenderers.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/AddingMultipleItemsListView.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla21177.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla22401.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla24574.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla25979.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla26032.xaml
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla26032.xaml.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla26171.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla26233.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla26501.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla26993.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla27085.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla27779.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla28001.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla28240.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla28498.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla28570.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla28575.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla28709.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla29017.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla29128.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla29247.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla29257.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla29363.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla29453.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla30317.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla30324.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla30353.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla30651.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla30935.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla31114.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla31255.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla31330.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla31333.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla31366.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla31395.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla31602.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla32040.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla32148.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla32230.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla32462.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla32615.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla32801.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla32898.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla32902.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla33578.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla33612.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla34007.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla34061.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla34561.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla34632.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla34912.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla35157.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla35472.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla35477.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla35733.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla35738.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla36009.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla36171.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla36393.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla36559.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla36681.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla36788.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla37462.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla37625.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla37841.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla38112.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla38658.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla38978.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla39331.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla39458.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla39489.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla39530.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla39668.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla39829.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla39963.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla40173.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla40333.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla40704.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla40911.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla41038.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla41153.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla41424.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla41842.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla42277.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla43161.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla44129.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla44166.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/CarouselAsync.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/IsInvokeRequiredRaceCondition.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue1146.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue1461.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue1691.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue181.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue1891.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue198.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue206.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue2222.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue2241.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue2259.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue2272.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue2289.xaml
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue2289.xaml.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue2354.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue2411.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue2414.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue2470.xaml
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue2470.xaml.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue264.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue2775.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue2777.xaml
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue2777.xaml.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue2809.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue2883.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue2923.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue2927.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue2948.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue2951.xaml
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue2951.xaml.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue2953.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue2954.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue2961.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue2963.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue2964.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue2965.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue2976.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue2981.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue2983.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue3276.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue3292.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue3319.xaml
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue3319.xaml.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue342.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue416.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue417.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue465.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue488.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue530.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue55555.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue764.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue773.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue774.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue852.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue889.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue892.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue935.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue968.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue973.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/ListViewViewCellBinding.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/StackLayoutIssue.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/SwipeBackNavCrash.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/TabbedPageTests.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/TabbedPageWithList.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/TestPages/TestPages.cs
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/_Template.cs
Xamarin.Forms.Controls/App.cs
Xamarin.Forms.Controls/ControlGalleryPages/AppearingGalleryPage.cs
Xamarin.Forms.Controls/GalleryPages/MasterDetailPageTabletPage.cs
Xamarin.Forms.Core.Android.UITests/Xamarin.Forms.Core.Android.UITests.csproj
Xamarin.Forms.Core.Android.UITests/packages.config
Xamarin.Forms.Core.Windows.UITests/Xamarin.Forms.Core.Windows.UITests.csproj
Xamarin.Forms.Core.Windows.UITests/packages.config
Xamarin.Forms.Core.iOS.UITests/BaseTestFixture.cs
Xamarin.Forms.Core.iOS.UITests/Tests/AppearingUITests.cs
Xamarin.Forms.Core.iOS.UITests/Tests/ContextActionsUITests.cs
Xamarin.Forms.Core.iOS.UITests/Tests/Legacy-UnevenListTests.cs
Xamarin.Forms.Core.iOS.UITests/Xamarin.Forms.Core.iOS.UITests.csproj
Xamarin.Forms.Core.iOS.UITests/packages.config
Xamarin.Forms.Core/Application.cs
Xamarin.Forms.Platform.iOS/Renderers/PhoneMasterDetailRenderer.cs
Xamarin.Forms.Platform.iOS/Renderers/TabletMasterDetailRenderer.cs

index ad3945e..cfd8350 100644 (file)
@@ -21,7 +21,8 @@ using System.IO.IsolatedStorage;
 
 using Droid = Android;
 using System.Globalization;
-
+using Java.Interop;
+using Xamarin.Forms.Controls.Issues;
 
 [assembly: Dependency (typeof (CacheService))]
 [assembly: Dependency (typeof (TestCloudService))]
@@ -274,6 +275,12 @@ namespace Xamarin.Forms.ControlGallery.Android
                {
                        base.OnDestroy();
                }
+
+               [Export("NavigateToTest")]
+               public bool NavigateToTest(string test)
+               {
+                       return _app.NavigateToTestPage(test);
+               }
        }
 #else
 
@@ -297,6 +304,8 @@ namespace Xamarin.Forms.ControlGallery.Android
        ]
        public class Activity1 : FormsAppCompatActivity
        {
+               App _app;
+
                protected override void OnCreate (Bundle bundle)
                {
                        ToolbarResource = Resource.Layout.Toolbar;
@@ -319,6 +328,7 @@ namespace Xamarin.Forms.ControlGallery.Android
                        //Forms.SetTitleBarVisibility (AndroidTitleBarVisibility.Never);
 
                        var app = new App();
+                       _app = app;
 
                        // When the native control gallery loads up, it'll let us know so we can add the nested native controls
                        MessagingCenter.Subscribe<NestedNativeControlGalleryPage>(this, NestedNativeControlGalleryPage.ReadyForNativeControlsMessage, AddNativeControls);
@@ -446,6 +456,18 @@ namespace Xamarin.Forms.ControlGallery.Android
                                return null;
                        }
                }
+
+               [Export("NavigateToTest")]
+               public bool NavigateToTest(string test)
+               {
+                       return _app.NavigateToTestPage(test);
+               }
+
+               [Export("Reset")]
+               public void Reset()
+               {
+                       _app.Reset();
+               }
        }
 #endif
 }
index 0530fc3..86876a3 100644 (file)
@@ -19,6 +19,7 @@ using AButton = Android.Widget.Button;
 using AView = Android.Views.View;
 using Android.OS;
 using System.Reflection;
+using Xamarin.Forms.Controls.Issues;
 
 [assembly: ExportRenderer(typeof(Bugzilla31395.CustomContentView), typeof(CustomContentRenderer))]
 [assembly: ExportRenderer(typeof(NativeListView), typeof(NativeListViewRenderer))]
index 199e16d..32f92ec 100644 (file)
   </PropertyGroup>
   <ItemGroup>
     <Reference Include="Mono.Android" />
+    <Reference Include="Mono.Android.Export" />
     <Reference Include="mscorlib" />
     <Reference Include="System" />
     <Reference Include="System.Core" />
index 71c5e0c..4ea9b30 100644 (file)
@@ -9,6 +9,7 @@ using UIKit;
 using Xamarin.Forms;
 using Xamarin.Forms.ControlGallery.iOS;
 using Xamarin.Forms.Controls;
+using Xamarin.Forms.Controls.Issues;
 using Xamarin.Forms.Platform.iOS;
 
 [assembly: Dependency(typeof(TestCloudService))]
@@ -132,6 +133,7 @@ namespace Xamarin.Forms.ControlGallery.iOS
        [Register("AppDelegate")]
        public partial class AppDelegate : FormsApplicationDelegate
        {
+               App _app;
 
                public override bool FinishedLaunching(UIApplication uiApplication, NSDictionary launchOptions)
                {
@@ -150,6 +152,7 @@ namespace Xamarin.Forms.ControlGallery.iOS
                        };
 
                        var app = new App();
+                       _app = app;
 
                        // When the native control gallery loads up, it'll let us know so we can add the nested native controls
                        MessagingCenter.Subscribe<NestedNativeControlGalleryPage>(this, NestedNativeControlGalleryPage.ReadyForNativeControlsMessage, AddNativeControls);
@@ -352,6 +355,21 @@ namespace Xamarin.Forms.ControlGallery.iOS
                }
 
                #endregion
+
+               [Export("navigateToTest:")]
+               public string NavigateToTest(string test)
+               {
+                       // According to https://developer.xamarin.com/guides/testcloud/uitest/working-with/backdoors/
+                       // this method has to return a string
+                       return _app.NavigateToTestPage(test).ToString();
+               }
+
+               [Export("reset:")]
+               public string Reset(string str)
+               {
+                       _app.Reset();
+                       return String.Empty;
+               }
        }
 
        [Register("KVOUISlider")]
index 87ede16..5654fa3 100644 (file)
@@ -7,6 +7,7 @@ using UIKit;
 using Xamarin.Forms;
 using Xamarin.Forms.ControlGallery.iOS;
 using Xamarin.Forms.Controls;
+using Xamarin.Forms.Controls.Issues;
 using Xamarin.Forms.Platform.iOS;
 using RectangleF = CoreGraphics.CGRect;
 
index ea758fa..56a714a 100644 (file)
@@ -16,7 +16,6 @@ using Xamarin.UITest;
 
 namespace Xamarin.Forms.Controls
 {
-
        public class PropertyChangedBase : INotifyPropertyChanged
        {
                Dictionary<string, object> _properties = new Dictionary<string, object>();
@@ -312,11 +311,16 @@ namespace Xamarin.Forms.Controls
                }
        }
 
-       [Preserve (AllMembers = true)]
-       [Issue (IssueTracker.None, 0, "Adding Multiple Items to a ListView", PlatformAffected.All)]
+       
+}
+
+namespace Xamarin.Forms.Controls.Issues
+{
+       [Preserve(AllMembers = true)]
+       [Issue(IssueTracker.None, 0, "Adding Multiple Items to a ListView", PlatformAffected.All)]
        public class AddingMultipleItemsListView : TestContentPage
        {
-               protected override void Init ()
+               protected override void Init()
                {
                        Title = "Hours";
                        var exampleViewModel = new ExampleViewModel();
@@ -351,18 +355,19 @@ namespace Xamarin.Forms.Controls
                                Children = {
                                        listView,
                                        addOneJobButton,
-                                       addTwoJobsButton 
+                                       addTwoJobsButton
                                }
                        };
                        Content = layout;
                }
 
-               [Preserve (AllMembers = true)]
+               [Preserve(AllMembers = true)]
                public class CustomViewCell : ViewCell
                {
-                       public CustomViewCell ()
+                       public CustomViewCell()
                        {
-                               var jobId = new Label {
+                               var jobId = new Label
+                               {
 #pragma warning disable 618
                                        Font = Font.SystemFontOfSize(20),
 #pragma warning restore 618
@@ -370,17 +375,19 @@ namespace Xamarin.Forms.Controls
                                        VerticalOptions = LayoutOptions.Center,
 
                                        HorizontalOptions = LayoutOptions.StartAndExpand
-                               };                    
+                               };
                                jobId.SetBinding(Label.TextProperty, "JobId");
 
-                               var jobName = new Label {
+                               var jobName = new Label
+                               {
                                        VerticalOptions = LayoutOptions.Center,
                                        WidthRequest = 175,
                                        HorizontalOptions = LayoutOptions.CenterAndExpand,
                                };
                                jobName.SetBinding(Label.TextProperty, "JobName");
 
-                               var hours = new Label {
+                               var hours = new Label
+                               {
                                        WidthRequest = 45,
                                        VerticalOptions = LayoutOptions.Center,
 #pragma warning disable 618
@@ -391,8 +398,9 @@ namespace Xamarin.Forms.Controls
                                };
                                hours.SetBinding(Label.TextProperty, new Binding("Hours", BindingMode.OneWay, new DoubleStringConverter()));
 
-                               var hlayout = new StackLayout {
-                                       Children  = {
+                               var hlayout = new StackLayout
+                               {
+                                       Children = {
                                                jobId,
                                                jobName,
                                                hours
@@ -403,45 +411,45 @@ namespace Xamarin.Forms.Controls
                                View = hlayout;
                        }
                }
-       
+
 #if UITEST
                [Test]
-               public void AddingMultipleListViewTests1AllElementsPresent ()
+               public void AddingMultipleListViewTests1AllElementsPresent()
                {
-                       RunningApp.WaitForElement (q => q.Marked ("Big Job"));
-                       RunningApp.WaitForElement (q => q.Marked ("Smaller Job"));
-                       RunningApp.WaitForElement (q => q.Marked ("Add On Job"));
-                       RunningApp.WaitForElement (q => q.Marked ("Add One"));
-                       RunningApp.WaitForElement (q => q.Marked ("Add Two"));
-                       RunningApp.WaitForElement (q => q.Marked ("3672"));
-                       RunningApp.WaitForElement (q => q.Marked ("6289"));
-                       RunningApp.WaitForElement (q => q.Marked ("3672-41"));
-                       RunningApp.WaitForElement (q => q.Marked ("2"));
-                       RunningApp.WaitForElement (q => q.Marked ("2"));
-                       RunningApp.WaitForElement (q => q.Marked ("23"));
-
-                       RunningApp.Screenshot ("All elements are present");
+                       RunningApp.WaitForElement(q => q.Marked("Big Job"));
+                       RunningApp.WaitForElement(q => q.Marked("Smaller Job"));
+                       RunningApp.WaitForElement(q => q.Marked("Add On Job"));
+                       RunningApp.WaitForElement(q => q.Marked("Add One"));
+                       RunningApp.WaitForElement(q => q.Marked("Add Two"));
+                       RunningApp.WaitForElement(q => q.Marked("3672"));
+                       RunningApp.WaitForElement(q => q.Marked("6289"));
+                       RunningApp.WaitForElement(q => q.Marked("3672-41"));
+                       RunningApp.WaitForElement(q => q.Marked("2"));
+                       RunningApp.WaitForElement(q => q.Marked("2"));
+                       RunningApp.WaitForElement(q => q.Marked("23"));
+
+                       RunningApp.Screenshot("All elements are present");
                }
 
                [Test]
-               public void AddingMultipleListViewTests2AddOneElementToList ()
+               public void AddingMultipleListViewTests2AddOneElementToList()
                {
-                       RunningApp.Tap (q => q.Marked ("Add One"));
+                       RunningApp.Tap(q => q.Marked("Add One"));
 
-                       RunningApp.WaitForElement (q => q.Marked ("1234"), timeout: TimeSpan.FromSeconds (2));
-                       RunningApp.Screenshot ("One more element exists");
+                       RunningApp.WaitForElement(q => q.Marked("1234"), timeout: TimeSpan.FromSeconds(2));
+                       RunningApp.Screenshot("One more element exists");
                }
 
                [Test]
-               public void AddingMultipleListViewTests3AddTwoElementToList ()
+               public void AddingMultipleListViewTests3AddTwoElementToList()
                {
-                       RunningApp.Screenshot ("Click 'Add Two'");
-                       RunningApp.Tap (q => q.Marked ("Add Two"));
+                       RunningApp.Screenshot("Click 'Add Two'");
+                       RunningApp.Tap(q => q.Marked("Add Two"));
 
-                       RunningApp.WaitForElement (q => q.Marked ("9999"), timeout: TimeSpan.FromSeconds (2));
-                       RunningApp.WaitForElement (q => q.Marked ("8888"), timeout: TimeSpan.FromSeconds (2));
-                       RunningApp.Screenshot ("Two more element exist");
+                       RunningApp.WaitForElement(q => q.Marked("9999"), timeout: TimeSpan.FromSeconds(2));
+                       RunningApp.WaitForElement(q => q.Marked("8888"), timeout: TimeSpan.FromSeconds(2));
+                       RunningApp.Screenshot("Two more element exist");
                }
 #endif
        }
-}
+}
\ No newline at end of file
index f97934f..e5403f9 100644 (file)
@@ -11,7 +11,7 @@ using Xamarin.UITest;
 using NUnit.Framework;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve(AllMembers = true)]
        [Issue(IssueTracker.Bugzilla, 21177, "Using a UICollectionView in a ViewRenderer results in issues with selection")]
index 3e0add0..af34e02 100644 (file)
@@ -1,6 +1,6 @@
 using System.Collections.Generic;
 using System.Linq;
-
+using Xamarin.Forms.Controls.Issues;
 using Xamarin.Forms.CustomAttributes;
 using Xamarin.Forms.Internals;
 
index ae8df7d..30916a8 100644 (file)
@@ -7,7 +7,7 @@ using Xamarin.UITest;
 using NUnit.Framework;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers = true)]
        [Issue (IssueTracker.Bugzilla, 24574, "Tap Double Tap")]
index 38c1316..dc07c04 100644 (file)
@@ -7,7 +7,7 @@ using Xamarin.UITest;
 using NUnit.Framework;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers = true)]
        [Issue (IssueTracker.Bugzilla, 25979, "https://bugzilla.xamarin.com/show_bug.cgi?id=25979")]
index 748942a..41cac85 100644 (file)
@@ -2,7 +2,7 @@
 <local:TestContentPage xmlns="http://xamarin.com/schemas/2014/forms"
                                 xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
                                 xmlns:local="clr-namespace:Xamarin.Forms.Controls"
-                                x:Class="Xamarin.Forms.Controls.Bugzilla26032">
+                                x:Class="Xamarin.Forms.Controls.Issues.Bugzilla26032">
        <RelativeLayout>
                <ListView x:Name="List1"
                                  RelativeLayout.XConstraint="{ConstraintExpression Type=Constant, Constant=0}"
index abfbf26..737d4b4 100644 (file)
@@ -10,7 +10,7 @@ using Xamarin.Forms.Core.UITests;
 using NUnit.Framework;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
 #if UITEST
        [Category(UITestCategories.ListView)]
index 29bbe4a..af42b2a 100644 (file)
@@ -9,7 +9,7 @@ using Xamarin.UITest;
 using NUnit.Framework;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers = true)]
        [Issue (IssueTracker.Bugzilla, 26171, "Xamarin.Forms.Maps is not updating VisibleRegion property when layout is changed")]
index 4b4d859..05b756e 100644 (file)
@@ -8,7 +8,7 @@ using NUnit.Framework;
 using Xamarin.Forms.Core.UITests;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
 #if UITEST
        [Category(UITestCategories.ListView)]
index 54c634b..56ccec8 100644 (file)
@@ -7,7 +7,7 @@ using NUnit.Framework;
 using Xamarin.UITest;
 #endif
 
-namespace Xamarin.Forms.Controls.TestCasesPages
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers = true)]
        public class FamilyViewModel
index f01184b..5ba0de1 100644 (file)
@@ -8,7 +8,7 @@ using Xamarin.UITest;
 using NUnit.Framework;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers = true)]
        [Issue (IssueTracker.Bugzilla, 26993, "https://bugzilla.xamarin.com/show_bug.cgi?id=26993")]
@@ -17,7 +17,7 @@ namespace Xamarin.Forms.Controls
                [Preserve (AllMembers = true)]
                public class Bz26993ViewCell : ViewCell 
                {
-                       static int s_id = 0;
+                       public static int s_id = 0;
 
                        public Bz26993ViewCell ()
                        {
@@ -33,6 +33,8 @@ namespace Xamarin.Forms.Controls
 
                protected override void Init ()
                {
+                       Bz26993ViewCell.s_id = 0;
+
                        var itemSource = new List<string> {
                                "",
                                "",
index 875d83b..f4dcfe8 100644 (file)
@@ -28,9 +28,5 @@ namespace Xamarin.Forms.Controls
                                
                        Content = tableview;
                }
-
-#if UITEST
-               
-#endif
        }
 }
index c341f36..7135778 100644 (file)
@@ -2,6 +2,7 @@
 
 using Xamarin.Forms.CustomAttributes;
 using System.Collections.Generic;
+using Xamarin.Forms.Controls.Issues;
 using Xamarin.Forms.Internals;
 #if UITEST
 using Xamarin.UITest;
index ec80ee0..7cfbc0c 100644 (file)
@@ -6,7 +6,7 @@ using Xamarin.UITest;
 using NUnit.Framework;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers = true)]
        [Issue (IssueTracker.Bugzilla, 28001, "[Android] TabbedPage: invisible tabs are not Disposed", PlatformAffected.Android)]
index 7109bf6..e23975d 100644 (file)
@@ -19,20 +19,13 @@ namespace Xamarin.Forms.Controls
                        Master = new NavigationPage( new ContentPage { Title = "MasterPage", BackgroundColor = Color.Blue }) { Title =" Master" };
                }
 
-               protected override async void OnAppearing ()
+               protected override async void OnAppearing()
                {
-                       var btn = new Button () { Text = "GO Back" };
-                       btn.Clicked+= async (object sender, EventArgs e) => await (Master as NavigationPage).PopAsync ();
+                       var btn = new Button() { Text = "GO Back" };
+                       btn.Clicked += async (object sender, EventArgs e) => await (Master as NavigationPage).PopAsync();
 
-                       await (Master as NavigationPage).PushAsync (new ContentPage { Title = "New MasterPage", Content = btn , BackgroundColor = Color.Pink  });
-                       base.OnAppearing ();
+                       await (Master as NavigationPage).PushAsync(new ContentPage { Title = "New MasterPage", Content = btn, BackgroundColor = Color.Pink });
+                       base.OnAppearing();
                }
-#if UITEST
-               [Test]
-               public void Bugzilla28240Test ()
-               {
-
-               }
-#endif
        }
 }
index 6007e72..3d19846 100644 (file)
@@ -1,5 +1,5 @@
 using System;
-
+using System.Threading.Tasks;
 using Xamarin.Forms.CustomAttributes;
 using Xamarin.Forms.Internals;
 #if UITEST
@@ -7,7 +7,7 @@ using Xamarin.UITest;
 using NUnit.Framework;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers = true)]
        [Issue (IssueTracker.Bugzilla, 28498, "App crashes when switching between NavigationPages on a MasterDetailPage when In-Call Status Bar is visible")]
@@ -59,11 +59,13 @@ namespace Xamarin.Forms.Controls
 
 #if UITEST
                [Test]
+               [Ignore("This test doesn't make a lot of sense and crashes 50% of the time; need to re-investigate it.")]
                public void Bugzilla28498Test ()
                {
-                       RunningApp.SetOrientationPortrait ();
+                       RunningApp.SetOrientationPortrait();
                        RunningApp.Tap (q => q.Marked ("btnOpen"));
                        RunningApp.Tap (q => q.Marked ("btnOther"));
+
                        RunningApp.SetOrientationLandscape ();
                        RunningApp.Tap (q => q.Marked ("btnOpen"));
                        RunningApp.Screenshot ("Detail open");
@@ -73,6 +75,12 @@ namespace Xamarin.Forms.Controls
                        else
                                Assert.Inconclusive ("Should be button here, but rotation could take some time on XTC");
                }
+
+               [TearDown]
+               public void TearDown()
+               {
+                       RunningApp.SetOrientationPortrait ();
+               }
 #endif
        }
 }
index f7f8bbf..ef0b533 100644 (file)
@@ -8,7 +8,7 @@ using Xamarin.UITest;
 using NUnit.Framework;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers = true)]
        [Issue (IssueTracker.Bugzilla, 28570, "https://bugzilla.xamarin.com/show_bug.cgi?id=28570")]
index e311ea3..582d30b 100644 (file)
@@ -7,7 +7,7 @@ using Xamarin.UITest;
 using NUnit.Framework;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers = true)]
        [Issue (IssueTracker.Bugzilla, 28575, "listview header set to null")]
index bfc45cf..917b519 100644 (file)
@@ -8,7 +8,7 @@ using Xamarin.UITest;
 using NUnit.Framework;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers = true)]
        [Issue (IssueTracker.Bugzilla, 28709, "Application.Properties saving crash ")]
index eea9295..af0adf0 100644 (file)
@@ -70,13 +70,5 @@ namespace Xamarin.Forms.Controls
                {
                        _lbl.Text = "Click " + DateTime.Now.ToLocalTime ();
                }
-
-#if UITEST
-               [Test]
-               public void Issue1Test ()
-               {
-
-               }
-#endif
        }
 }
index d7222f9..954af17 100644 (file)
@@ -7,7 +7,7 @@ using Xamarin.UITest;
 using NUnit.Framework;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers = true)]
        [Issue (IssueTracker.Bugzilla, 29128, "Slider background lays out wrong Android")]
index d7f5dcb..fb5cb67 100644 (file)
@@ -7,7 +7,7 @@ using Xamarin.UITest;
 using NUnit.Framework;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers = true)]
        [Issue (IssueTracker.Bugzilla, 29247, "iOS Device.OpenUri breaks with encoded params", PlatformAffected.iOS )]
index e20a7d4..35503f9 100644 (file)
@@ -8,7 +8,7 @@ using Xamarin.UITest;
 using NUnit.Framework;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers = true)]
        [Issue (IssueTracker.Bugzilla, 29257, "CarouselPage.CurrentPage Does Not Work Properly When Used Inside a NavigationPage ")]
index dd3f645..e36099b 100644 (file)
@@ -10,7 +10,7 @@ using Xamarin.Forms.Core.UITests;
 #endif
 
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
 #if UITEST
        [Category(UITestCategories.LifeCycle)]
@@ -46,8 +46,9 @@ namespace Xamarin.Forms.Controls
                public void PushButton ()
                {
                        RunningApp.Tap (q => q.Marked ("Modal Push Pop Test"));
-                       System.Threading.Thread.Sleep (5);
+                       System.Threading.Thread.Sleep (2000);
                        // if it didn't crash, yay
+                       RunningApp.WaitForElement(q => q.Marked("Modal Push Pop Test"));
                }
 #endif
     }
index 3170a76..1b888e0 100644 (file)
@@ -7,7 +7,7 @@ using NUnit.Framework;
 using Xamarin.Forms.Core.UITests;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
 #if UITEST
        [Category(UITestCategories.LifeCycle)]
index 0af7d5f..f508929 100644 (file)
@@ -9,7 +9,7 @@ using Xamarin.UITest.Android;
 using System.Collections.Generic;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers = true)]
        [Issue (IssueTracker.Bugzilla, 30317, "https://bugzilla.xamarin.com/show_bug.cgi?id=30137")]
index 1a4bed7..1887063 100644 (file)
@@ -7,7 +7,7 @@ using Xamarin.UITest;
 using NUnit.Framework;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers = true)]
        [Issue (IssueTracker.Bugzilla, 30324, "Detail view of MasterDetailPage does not get appearance events on Android when whole MasterDetailPage disappears/reappears")]
index 4e1069f..cde2fad 100644 (file)
@@ -8,7 +8,7 @@ using Xamarin.UITest;
 using NUnit.Framework;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers = true)]
        [Issue (IssueTracker.Bugzilla, 30353, "MasterDetailPage.IsPresentedChanged is not raised")]
@@ -101,6 +101,12 @@ namespace Xamarin.Forms.Controls
                        RunningApp.SetOrientationLandscape ();
                }
 
+               [TearDown]
+               public void TearDown() 
+               {
+                       RunningApp.SetOrientationPortrait ();
+               }
+
                void Back()
                {
 #if __IOS__
index bba1bd2..4ca08fc 100644 (file)
@@ -4,7 +4,7 @@ using System.Collections.ObjectModel;
 using System.Linq;
 using Xamarin.Forms.Internals;
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers = true)]
        [Issue (IssueTracker.Bugzilla, 30651, "ListView jumps around while scrolling after items are added to its source")]
index 3953f63..c134407 100644 (file)
@@ -1,14 +1,15 @@
 using System;
 
 using Xamarin.Forms.CustomAttributes;
-
+using Xamarin.Forms.Internals;
 #if UITEST
 using Xamarin.UITest;
 using NUnit.Framework;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
+       [Preserve(AllMembers = true)]
        [Issue (IssueTracker.Bugzilla, 30935, "NullReferenceException in ViewRenderer<TView, TNativeView> (Xamarin.Forms.Platform.Android)")]
        public class Bugzilla30935 : TestContentPage
        {
index 6aa0031..71e5d05 100644 (file)
@@ -10,7 +10,7 @@ using Xamarin.UITest;
 using NUnit.Framework;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
 #if UITEST
        [Category(UITestCategories.ListView)]
index 1b596dc..896039c 100644 (file)
@@ -9,7 +9,7 @@ using Xamarin.UITest;
 using NUnit.Framework;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers = true)]
        [Issue (IssueTracker.Bugzilla, 31255, "Master's page Icon cause memory leak after MasterDetailPage is popped out by holding on page")]
index d609c94..75e30b1 100644 (file)
@@ -11,7 +11,7 @@ using Xamarin.UITest;
 using NUnit.Framework;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers = true)]
        [Issue (IssueTracker.Bugzilla, 31330, "Disabled context actions appear enabled")]
@@ -131,6 +131,7 @@ namespace Xamarin.Forms.Controls
                [Test]
                public void Bugzilla31330Test ()
                {
+                       RunningApp.WaitForElement (c => c.Marked ("Something 2"));
                        var screenBounds = RunningApp.Query (q => q.Raw ("* index:0"))[0].Rect;
 
                        var cell = RunningApp.Query (c => c.Marked ("Something 1")) [0];
index 9462e33..52c9f57 100644 (file)
@@ -12,7 +12,7 @@ using Xamarin.UITest;
 
 #endif
 
-namespace Xamarin.Forms.Controls.TestCasesPages
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers=true)]
        [Issue (IssueTracker.Bugzilla, 31333,
@@ -218,6 +218,7 @@ namespace Xamarin.Forms.Controls.TestCasesPages
                        RunningApp.EnterText ("Entry in ListView Success");
                        Assert.True(RunningApp.Query(query => query.Text("Entry in ListView Success")).Length > 0);
                        RunningApp.Screenshot ("Entry in ListView Success");
+                       RunningApp.Tap(q => q.Marked("Focus Entry in ListView"));
                }
 
                [Test]
@@ -229,6 +230,7 @@ namespace Xamarin.Forms.Controls.TestCasesPages
                        RunningApp.EnterText ("Editor in ListView Success");
                        Assert.True(RunningApp.Query(query => query.Text("Editor in ListView Success")).Length > 0);
                        RunningApp.Screenshot ("Editor in ListView Success");
+                       RunningApp.Tap(q => q.Marked("Focus Editor in ListView"));
                }
 
                
@@ -241,6 +243,7 @@ namespace Xamarin.Forms.Controls.TestCasesPages
                        RunningApp.EnterText ("Entry in TableView Success");
                        Assert.True(RunningApp.Query(query => query.Text("Entry in TableView Success")).Length > 0);
                        RunningApp.Screenshot ("Entry in TableView Success");
+                       RunningApp.Tap(q => q.Marked("Focus Entry in Table"));
                }
 
                [Test]
@@ -252,6 +255,7 @@ namespace Xamarin.Forms.Controls.TestCasesPages
                        RunningApp.EnterText ("Editor in TableView Success");
                        Assert.True(RunningApp.Query(query => query.Text("Editor in TableView Success")).Length > 0);
                        RunningApp.Screenshot ("Editor in TableView Success");
+                       RunningApp.Tap(q => q.Marked("Focus Editor in Table"));
                }
 #endif
        }
index 9cd95e2..e6a62ca 100644 (file)
@@ -8,7 +8,7 @@ using Xamarin.UITest;
 
 #endif
 
-namespace Xamarin.Forms.Controls.TestCasesPages
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers = true)]
        [Issue (IssueTracker.Bugzilla, 31366, "Pushing and then popping a page modally causes ArgumentOutOfRangeException",
index 0033be9..55e9138 100644 (file)
@@ -8,9 +8,8 @@ using Xamarin.UITest;
 using NUnit.Framework;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
-       // don't forget to update C:\Users\chrisk\Documents\git\DuploBuddy\Xamarin.Forms.ControlGallery.Android\LinkerRoots.cs
        [Preserve (AllMembers = true)]
        [Issue (IssueTracker.Bugzilla, 31395, "Crash when switching MainPage and using a Custom Render")]
        public class Bugzilla31395 : TestContentPage // or TestMasterDetailPage, etc ...
index c2a2346..0603028 100644 (file)
@@ -11,7 +11,7 @@ using Xamarin.UITest.iOS;
 using NUnit.Framework;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
 #if UITEST
        [NUnit.Framework.Category(UITestCategories.MasterDetailPage)]
@@ -129,6 +129,12 @@ namespace Xamarin.Forms.Controls
                                RunningApp.WaitForElement (q => q.Marked ("SideMenu"));
                        }
                }
+
+               [TearDown]
+               public void TearDown() 
+               {
+                       RunningApp.SetOrientationPortrait ();
+               }
 #endif
        }
 }
index b92a8d1..c36efca 100644 (file)
@@ -8,7 +8,7 @@ using Xamarin.UITest;
 using NUnit.Framework;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
 #if UITEST
        [Category(UITestCategories.Cells)]
index 6121a2c..00e1073 100644 (file)
@@ -13,7 +13,7 @@ using Xamarin.UITest;
 using NUnit.Framework;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
 #if UITEST
        [Category(UITestCategories.ListView)]
index 74633b0..220b4d1 100644 (file)
@@ -8,7 +8,7 @@ using Xamarin.UITest;
 using NUnit.Framework;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers = true)]
        [Issue (IssueTracker.Bugzilla, 32230, "isPresentedChanged raises multiple times")]
index 9a29fac..29cc9f8 100644 (file)
@@ -9,7 +9,7 @@ using Xamarin.UITest;
 using NUnit.Framework;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
 #if UITEST
        [Category(UITestCategories.ListView)]
index 861664a..d159bbb 100644 (file)
@@ -9,7 +9,7 @@ using Xamarin.UITest;
 using NUnit.Framework;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers = true)]
        [Issue (IssueTracker.Bugzilla, 32615, "OnAppearing is not called on previous page when modal page is popped")]
index 4c48102..8002867 100644 (file)
@@ -9,7 +9,7 @@ using NUnit.Framework;
 using Xamarin.UITest.iOS;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers = true)]
        [Issue (IssueTracker.Bugzilla, 32801, "Memory Leak in TabbedPage + NavigationPage")]
@@ -85,6 +85,12 @@ namespace Xamarin.Forms.Controls
                        RunningApp.Tap (c => c.Marked ("btnStack"));
                        RunningApp.WaitForElement (c => c.Marked ("Stack 1"));
                }
+
+               [TearDown]
+               public void TearDown() 
+               {
+                       RunningApp.SetOrientationPortrait ();
+               }
 #endif
        }
 }
index cebc49d..af13c6f 100644 (file)
@@ -9,7 +9,7 @@ using Xamarin.UITest;
 using NUnit.Framework;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers = true)]
        [Issue (IssueTracker.Bugzilla, 32898, "Memory leak when TabbedPage is popped out ")]
index d19ee8d..8d0acc9 100644 (file)
@@ -9,7 +9,7 @@ using Xamarin.UITest;
 using NUnit.Framework;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers = true)]
        [Issue (IssueTracker.Bugzilla, 32902, "[iOS | iPad] App Crashes (without debug log) when Master Detail isPresented and navigation being popped")]
index 54cf50f..055cb11 100644 (file)
@@ -9,7 +9,7 @@ using Xamarin.UITest.iOS;
 using NUnit.Framework;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers = true)]
        [Issue (IssueTracker.Bugzilla, 33578, "TableView EntryCell shows DefaultKeyboard, but after scrolling down and back a NumericKeyboard (")]
index 3cee8a3..625de5d 100644 (file)
@@ -8,7 +8,7 @@ using NUnit.Framework;
 using Xamarin.UITest;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers = true)]
        [Issue (IssueTracker.Bugzilla, 33612,
index 4311f7a..82b0dbb 100644 (file)
@@ -9,7 +9,7 @@ using Xamarin.UITest;
 
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers = true)]
        [Issue (IssueTracker.Bugzilla, 34007, "Z order drawing of children views are different on Android, iOS, Win", PlatformAffected.Android | PlatformAffected.iOS)]
index 1f12627..90d2c0d 100644 (file)
@@ -8,7 +8,7 @@ using Xamarin.UITest;
 using NUnit.Framework;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers = true)]
        [Issue (IssueTracker.Bugzilla, 34061, "RelativeLayout - First child added after page display does not appear")]
index 4522c9b..83e7de2 100644 (file)
@@ -11,7 +11,7 @@ using NUnit.Framework;
 using Xamarin.UITest.iOS;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers = true)]
        [Issue (IssueTracker.Bugzilla, 34561, "[A] Navigation.PushAsync crashes when used in Context Actions (legacy)", PlatformAffected.Android)]
index 2e9d479..bf26bdb 100644 (file)
@@ -8,7 +8,7 @@ using NUnit.Framework;
 using Xamarin.UITest.iOS;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers = true)]
        [Issue (IssueTracker.Bugzilla, 34632, "Can't change IsPresented when setting SplitOnLandscape ")]
@@ -75,6 +75,12 @@ namespace Xamarin.Forms.Controls
                                RunningApp.Tap (q => q.Marked ("btnMaster"));
                        }
                }
+
+               [TearDown]
+               public void TearDown() 
+               {
+                       RunningApp.SetOrientationPortrait ();
+               }
                #endif
        }
 }
index 0b14c12..0f2940a 100644 (file)
@@ -10,7 +10,7 @@ using Xamarin.UITest;
 using NUnit.Framework;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
 #if UITEST
        [Category(UITestCategories.ListView)]
index 0a62fd7..ec71bd8 100644 (file)
@@ -6,7 +6,7 @@ using Xamarin.UITest;
 using NUnit.Framework;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers = true)]
        [Issue (IssueTracker.Bugzilla, 35157, "CarouselPage inside NavPage inside TabbedPage gets laid out incorrectly", NavigationBehavior.PushModalAsync)]
index 53fb56b..8dee013 100644 (file)
@@ -10,7 +10,7 @@ using Xamarin.UITest;
 
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers = true)]
        [Issue (IssueTracker.Bugzilla, 35472, "PopAsync during ScrollToAsync throws NullReferenceException")]
index 1ec76e4..5fc92ce 100644 (file)
@@ -6,7 +6,7 @@ using NUnit.Framework;
 using Xamarin.UITest.Queries;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers = true)]
        [Issue (IssueTracker.Bugzilla, 35477, "Tapped event does not fire when added to Frame in Android AppCompat",
index 7157ccb..f0733a3 100644 (file)
@@ -9,7 +9,7 @@ using Xamarin.UITest;
 using NUnit.Framework;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers = true)]
        [Issue (IssueTracker.Bugzilla, 35733, "iOS WebView crashes when loading an URL with encoded parameters", PlatformAffected.iOS)]
index ea34195..5b8132f 100644 (file)
@@ -8,7 +8,7 @@ using Xamarin.UITest;
 using NUnit.Framework;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
     [Preserve (AllMembers = true)]
     public class CustomButton : Button
index 2ef5afa..ab7d490 100644 (file)
@@ -8,7 +8,7 @@ using Xamarin.UITest;
 using NUnit.Framework;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers = true)]
        [Issue (IssueTracker.Bugzilla, 36009, "Children of Layouts with data bound IsVisible are not displayed")]
index 22a7a12..6bcd16b 100644 (file)
@@ -7,7 +7,7 @@ using NUnit.Framework;
 using Xamarin.UITest.Queries;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers = true)]
        [Issue (IssueTracker.Bugzilla, 36171, "WinRT Entry UI not updating on TextChanged",
index a18b32d..0a2aecd 100644 (file)
@@ -8,7 +8,7 @@ using Xamarin.UITest;
 using NUnit.Framework;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve(AllMembers = true)]
        [Issue(IssueTracker.Bugzilla, 36393, "[A] Default Entry/Editor/SearchBar Font Size is 14 instead of 18")]
index 3d8c642..bd07a66 100644 (file)
@@ -8,7 +8,7 @@ using Xamarin.UITest;
 using NUnit.Framework;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
     [Preserve(AllMembers = true)]
     [Issue(IssueTracker.Bugzilla, 36559, "[WP] Navigating to a ContentPage with a Grid inside a TableView affects Entry heights")]
index 1d402d0..3851183 100644 (file)
@@ -9,7 +9,7 @@ using Xamarin.UITest;
 using NUnit.Framework;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers = true)]
        [Issue (IssueTracker.Bugzilla, 36681, "[A] NRE when Picker Replaces Page Content (pre-AppCompat only)", PlatformAffected.Android)]
index e81dea7..339bd6e 100644 (file)
@@ -8,7 +8,7 @@ using Xamarin.UITest;
 using NUnit.Framework;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers = true)]
        [Issue (IssueTracker.Bugzilla, 36788, "Truncation Issues with Relative Layouts")]
index 89c3b03..65ae058 100644 (file)
@@ -9,7 +9,7 @@ using NUnit.Framework;
 #endif
 
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers = true)]
        [Issue (IssueTracker.Bugzilla, 37462, "Using App Compat/App Compat theme breaks Navigation.RemovePage on Android ",PlatformAffected.Android )]
index 082329c..06d59c5 100644 (file)
@@ -9,7 +9,7 @@ using Xamarin.UITest;
 using NUnit.Framework;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
     [Preserve (AllMembers = true)]
     [Issue (IssueTracker.Bugzilla, 37625, "App crashes when quickly adding/removing Image views (Windows UWP)")]
index 1a3245e..d5d69f6 100644 (file)
@@ -10,7 +10,7 @@ using Xamarin.UITest;
 using NUnit.Framework;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve(AllMembers = true)]
        [Issue(IssueTracker.Bugzilla, 37841, "TableView EntryCells and TextCells cease to update after focus change", PlatformAffected.Android)]
index 194c07b..cb8fe4a 100644 (file)
@@ -7,7 +7,7 @@ using Xamarin.UITest;
 using NUnit.Framework;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers = true)]
        [Issue (IssueTracker.Bugzilla, 38112, "Switch becomes reenabled when previous ViewCell is removed from TableView", PlatformAffected.Android)]
index 4b7dec0..68fdaad 100644 (file)
@@ -7,7 +7,7 @@ using Xamarin.UITest;
 using NUnit.Framework;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers = true)]
        [Issue (IssueTracker.Bugzilla, 38658, "Rotation causes app containing CarouselPage to freeze", PlatformAffected.iOS)]
@@ -69,6 +69,12 @@ namespace Xamarin.Forms.Controls
                        RunningApp.Back ();
                        RunningApp.WaitForElement (q => q.Marked ("btn"));
                }
+
+               [TearDown]
+               public void TearDown() 
+               {
+                       RunningApp.SetOrientationPortrait ();
+               }
 #endif
        }
 }
\ No newline at end of file
index c9ab491..fae0340 100644 (file)
@@ -8,7 +8,7 @@ using Xamarin.UITest;
 using NUnit.Framework;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers = true)]
        [Issue (IssueTracker.Bugzilla, 38978, "Cell.ForceUpdateSize issues with row selection/deselection (ViewCell)", PlatformAffected.Android)]
index b4af008..fd3275d 100644 (file)
@@ -8,7 +8,7 @@ using NUnit.Framework;
 using Xamarin.Forms.Core.UITests;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
 #if UITEST
        [Category(UITestCategories.BoxView)]
index ced7ff1..b8ba1e1 100644 (file)
@@ -8,7 +8,7 @@ using Xamarin.UITest;
 using NUnit.Framework;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve(AllMembers = true)]
        [Issue(IssueTracker.Bugzilla, 39458, "[UWP/WinRT] Cannot Set CarouselPage.CurrentPage Inside Constructor", PlatformAffected.WinRT)]
index 01897ba..3fe4468 100644 (file)
@@ -10,7 +10,7 @@ using Xamarin.UITest;
 using NUnit.Framework;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve(AllMembers = true)]
        [Issue(IssueTracker.Bugzilla, 39489, "Memory leak when using NavigationPage with Maps", PlatformAffected.Android)]
@@ -23,6 +23,9 @@ namespace Xamarin.Forms.Controls
 
 #if UITEST
 #if !__IOS__ // Temporarily disabling this test on iOS
+
+               protected override bool Isolate => true;
+
                [Test]
                public async Task Bugzilla39489Test()
                {
index 19b7a35..735b719 100644 (file)
@@ -59,6 +59,9 @@ namespace Xamarin.Forms.Controls.Issues
                [Test]
                public void Bugzilla39530PanTest()
                {
+                       // Got to wait for the element to be visible to the UI test framework, otherwise we get occasional 
+                       // index out of bounds exceptions if the query for the frame and its Rect run quickly enough
+                       RunningApp.WaitForElement(q => q.Marked("frame"));
                        AppRect frameBounds = RunningApp.Query (q => q.Marked ("frame"))[0].Rect;
                        RunningApp.Pan (new Drag (frameBounds, frameBounds.X + 10, frameBounds.Y + 10, frameBounds.X + 100, frameBounds.Y + 100, Drag.Direction.LeftToRight));
 
index 585c533..7684fe5 100644 (file)
@@ -9,7 +9,7 @@ using NUnit.Framework;
 using Xamarin.Forms.Core.UITests;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
 #if UITEST
        [Category(UITestCategories.ListView)]
index d679fa2..d7f7aa6 100644 (file)
@@ -8,7 +8,7 @@ using Xamarin.UITest;
 using NUnit.Framework;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve(AllMembers = true)]
        [Issue(IssueTracker.Bugzilla, 39829, "RowHeight of ListView is not working for UWP", PlatformAffected.WinRT)]
index ad43822..114b3eb 100644 (file)
@@ -8,7 +8,7 @@ using Xamarin.UITest;
 using NUnit.Framework;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve(AllMembers = true)]
        [Issue(IssueTracker.Bugzilla, 39963, "iOS WebView has wrong scrolling size when loading local html content with images")]
index 9d8f9fb..054a68c 100644 (file)
@@ -6,7 +6,7 @@ using NUnit.Framework;
 using Xamarin.Forms.Core.UITests;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
 #if UITEST
        [Category(UITestCategories.BoxView)]
index df5c905..5d42253 100644 (file)
@@ -5,7 +5,7 @@ using Xamarin.Forms.Internals;
 using NUnit.Framework;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve(AllMembers = true)]
        [Issue(IssueTracker.Bugzilla, 40333, "[Android] IllegalStateException: Recursive entry to executePendingTransactions", PlatformAffected.Android)]
index 46123df..1298110 100644 (file)
@@ -12,7 +12,7 @@ using Xamarin.UITest;
 using NUnit.Framework;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
 #if UITEST
        [Category(UITestCategories.ListView)]
index 09035e8..e8163c9 100644 (file)
@@ -5,7 +5,7 @@ using Xamarin.Forms.Internals;
 using Xamarin.UITest;
 using NUnit.Framework;
 #endif
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers = true)]
        [Issue (IssueTracker.Bugzilla, 40911, "NRE with Facebook Login", PlatformAffected.iOS)]
index 6b3fb91..6826673 100644 (file)
@@ -8,7 +8,7 @@ using Xamarin.UITest;
 using NUnit.Framework;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve(AllMembers = true)]
        [Issue(IssueTracker.Bugzilla, 41038, "MasterDetailPage loses menu icon on iOS after reusing NavigationPage as Detail")]
index 7c8a162..7617418 100644 (file)
@@ -9,7 +9,7 @@ using Xamarin.UITest;
 using NUnit.Framework;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve(AllMembers = true)]
        [Issue(IssueTracker.Bugzilla, 41153, "jobject must not be IntPtr.Zero with TabbedPage and ToolbarItems")]
index 8738696..f8f48ae 100644 (file)
@@ -8,7 +8,7 @@ using Xamarin.UITest;
 using NUnit.Framework;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve(AllMembers = true)]
        [Issue(IssueTracker.Bugzilla, 41424, "[Android] Clicking cancel on a DatePicker does not cause it to unfocus", PlatformAffected.Android)]
index f571423..2224c16 100644 (file)
@@ -8,7 +8,7 @@ using Xamarin.UITest;
 using NUnit.Framework;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve(AllMembers = true)]
        [Issue(IssueTracker.Bugzilla, 41842, "Set MasterDetailPage.Detail = New Page() twice will crash the application when set MasterBehavior = MasterBehavior.Split", PlatformAffected.WinRT)]
index 1a7624a..d40444b 100644 (file)
@@ -9,7 +9,7 @@ using Xamarin.UITest;
 using NUnit.Framework;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve(AllMembers = true)]
        [Issue(IssueTracker.Bugzilla, 42277, "DataTemplate System.InvalidCastException crash in 2.3.1-pre1")]
index 3a45cc8..7055c2c 100644 (file)
@@ -7,7 +7,7 @@ using Xamarin.UITest;
 using NUnit.Framework;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
 
        [Preserve(AllMembers = true)]
index e1755ef..2b2899d 100644 (file)
@@ -8,7 +8,7 @@ using Xamarin.UITest;
 using NUnit.Framework;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve(AllMembers = true)]
        [Issue(IssueTracker.Bugzilla, 44129, "Crash when adding tabbed page after removing all pages using DataTemplates")]
index fbbd68a..e38da02 100644 (file)
@@ -10,7 +10,7 @@ using Xamarin.UITest;
 using NUnit.Framework;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve(AllMembers = true)]
        [Issue(IssueTracker.Bugzilla, 44166, "MasterDetailPage instances do not get disposed upon GC")]
index 46065a3..d28fa32 100644 (file)
@@ -10,7 +10,7 @@ using NUnit.Framework;
 using Xamarin.UITest;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers=true)]
        [Issue (IssueTracker.None, 0, "Carousel Async Add Page Issue", PlatformAffected.All, NavigationBehavior.PushModalAsync)]
index 7a2f6df..980d8e9 100644 (file)
@@ -9,7 +9,7 @@ using NUnit.Framework;
 #endif
 
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve(AllMembers = true)]
        [Issue(IssueTracker.None, 0, "Device.IsInvokeRequired race condition causes crash")]
index 7f47cf9..126cfb8 100644 (file)
@@ -10,7 +10,7 @@ using NUnit.Framework;
 using Xamarin.UITest;
 #endif
 
-namespace Xamarin.Forms.Controls.TestCasesPages
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers=true)]
        [Issue(IssueTracker.Github, 1146, "Disabled Switch in Button Gallery not rendering on all devices", PlatformAffected.Android)]
index 9604d17..6c222ab 100644 (file)
@@ -11,7 +11,7 @@ using NUnit.Framework;
 using System.Diagnostics;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers = true)]
        [Issue (IssueTracker.Github, 1691, "CarouselPage iOS CurrentPage bug")]
index e55c093..3cdfbfe 100644 (file)
@@ -7,7 +7,7 @@ using Xamarin.UITest;
 using Xamarin.Forms.Core.UITests;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers=true)]
        [Issue (IssueTracker.Github, 181, "Color not initialized for Label", PlatformAffected.Android, NavigationBehavior.PushModalAsync)]
index 523c563..7594ed5 100644 (file)
@@ -11,7 +11,8 @@ using NUnit.Framework;
 using Xamarin.UITest;
 #endif
 
-namespace Xamarin.Forms.Controls {
+namespace Xamarin.Forms.Controls.Issues
+{
        [Preserve (AllMembers = true)]
        [Issue (IssueTracker.Github, 1891, "Modal dialog scrolls to far when focusing input boxes", PlatformAffected.iOS)]
        public class Issue1891 : TestContentPage
index 7839e97..b0e3011 100644 (file)
@@ -6,7 +6,7 @@ using NUnit.Framework;
 using Xamarin.UITest;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers=true)]
        [Issue (IssueTracker.Github, 198, "TabbedPage shouldn't proxy content of NavigationPage", PlatformAffected.iOS)]
@@ -64,6 +64,10 @@ namespace Xamarin.Forms.Controls
                        RunningApp.Screenshot ("Clicked Leave");
 
                        RunningApp.WaitForElement (q => q.Marked ("Bug Repro's"));
+
+                       RunningApp.ClearText(q => q.Raw("* marked:'SearchBarGo'"));
+                       RunningApp.EnterText(q => q.Raw("* marked:'SearchBarGo'"), "G198");
+
                        RunningApp.Tap (q => q.Marked ("SearchButton"));
                        RunningApp.Screenshot ("Navigate into gallery again");
 
index e7264ce..cb3831a 100644 (file)
@@ -9,7 +9,7 @@ using NUnit.Framework;
 using Xamarin.UITest;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers = true)]
        [Issue (IssueTracker.Github, 206, "ViewCell with Label's text does not resize when value is changed", PlatformAffected.iOS)]
index fc3fa81..60e635a 100644 (file)
@@ -8,7 +8,7 @@ using NUnit.Framework;
 using Xamarin.UITest;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers = true)]
        [Issue (IssueTracker.Github, 2222, "NavigationBar.ToolbarItems.Add() crashes / breaks app in iOS7. works fine in iOS8", PlatformAffected.iOS)]
index ed090c2..971b537 100644 (file)
@@ -10,7 +10,7 @@ using Xamarin.UITest;
 using Xamarin.UITest.Android;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers = true)]
        [Issue (IssueTracker.Github, 2241, "ScrollView content can become stuck on orientation change (iOS)", PlatformAffected.iOS)]
index 073aa96..d59ef24 100644 (file)
@@ -10,7 +10,7 @@ using NUnit.Framework;
 using Xamarin.UITest;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers=true)]
        [Issue (IssueTracker.Github, 2259, "ListView.ScrollTo crashes app", PlatformAffected.iOS)]
index 8571b43..d084de9 100644 (file)
@@ -9,7 +9,7 @@ using NUnit.Framework;
 using Xamarin.UITest.Android;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers=true)]
        [Issue (IssueTracker.Github, 2272, "Entry text updating set focus on the beginning of text not the end of it", PlatformAffected.Android)]
index c4d4574..ae2f794 100644 (file)
@@ -1,8 +1,8 @@
-<?xml version="1.0" encoding="UTF-8"?>
+<?xml version="1.0" encoding="UTF-8"?>
 <local:TestContentPage xmlns="http://xamarin.com/schemas/2014/forms"
                                           xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
                                           xmlns:local="clr-namespace:Xamarin.Forms.Controls"
-                                          x:Class="Xamarin.Forms.Controls.Issue2289">
+                                          x:Class="Xamarin.Forms.Controls.Issues.Issue2289">
        <local:TestContentPage.Content>
                <TableView HasUnevenRows="true">
                        <TableView.Root>
index 6fdc257..bd6abeb 100644 (file)
@@ -13,7 +13,7 @@ using Xamarin.UITest;
 using Xamarin.UITest.iOS;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers = true)]
        [Issue (IssueTracker.Github, 2289, "TextCell IsEnabled property not disabling element in TableView", PlatformAffected.iOS)]
index aeabbfe..9b7f77d 100644 (file)
@@ -10,7 +10,7 @@ using NUnit.Framework;
 using Xamarin.UITest;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers = true)]
        [Issue(IssueTracker.Github, 2354, "ListView, ImageCell and disabled source cache and same image url",PlatformAffected.iOS | PlatformAffected.Android)]
index 70e8119..f323797 100644 (file)
@@ -13,7 +13,7 @@ using NUnit.Framework;
 using Xamarin.UITest;
 #endif
 
-namespace Xamarin.Forms.Controls.TestCasesPages
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve(AllMembers = true)]
        [Issue(IssueTracker.Github, 2411, "ListView.ScrollTo not working in TabbedPage", PlatformAffected.Android)]
index 3b2c151..622ed14 100644 (file)
@@ -9,7 +9,7 @@ using NUnit.Framework;
 using Xamarin.UITest.iOS;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers = true)]
        [Issue (IssueTracker.Github, 2414, "NullReferenceException when swiping over Context Actions", PlatformAffected.WinPhone)]
@@ -60,9 +60,11 @@ namespace Xamarin.Forms.Controls
                [Test]
                public void TestDoesntCrashShowingContextMenu ()
                {
+                       RunningApp.WaitForElement(c => c.Marked("Swipe ME"));
+
                        var screenBounds = RunningApp.Query (q => q.Raw ("* index:0"))[0].Rect;
 
-                       var cell = RunningApp.Query (c => c.Marked ("Swipe ME")) [0];
+                       var cell = RunningApp.Query(c => c.Marked("Swipe ME")) [0];
 #if __IOS__
                        RunningApp.DragCoordinates (screenBounds.Width - 10, cell.Rect.CenterY, 0, cell.Rect.CenterY);
                        //TODO: fix this when context menu bug is fixed
@@ -73,11 +75,18 @@ namespace Xamarin.Forms.Controls
 #endif
                        RunningApp.Screenshot ("Didn't crash");
                        RunningApp.TapCoordinates (screenBounds.CenterX, screenBounds.CenterY);
+
+#if __ANDROID__
+                       RunningApp.Tap(c => c.Marked("Text0"));
+#endif
+
                }
 
                [Test]
                public void TestShowContextMenuItemsInTheRightOrder ()
                {
+                       RunningApp.WaitForElement(c => c.Marked("Swipe ME"));
+
                        var screenBounds = RunningApp.Query (q => q.Raw ("* index:0"))[0].Rect;
 
                        var cell = RunningApp.Query (c => c.Marked ("Swipe ME")) [0];
@@ -89,10 +98,14 @@ namespace Xamarin.Forms.Controls
                        RunningApp.WaitForElement (c => c.Marked ("Text0"));
                        RunningApp.Screenshot ("Are the menuitems in the right order?");
 
-               }
+#if __ANDROID__
+                       RunningApp.Tap(c => c.Marked("Text0"));
 #endif
 
                }
+#endif
+
+       }
 }
 
 
index b462f8b..8acf235 100644 (file)
@@ -2,7 +2,7 @@
 <local:TestTabbedPage xmlns="http://xamarin.com/schemas/2014/forms"
              xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
              xmlns:local="clr-namespace:Xamarin.Forms.Controls"
-             x:Class="Xamarin.Forms.Controls.Issue2470">
+             x:Class="Xamarin.Forms.Controls.Issues.Issue2470">
   <local:TestTabbedPage.Children>
     <ContentPage Title="Generate">
       <StackLayout>
index 9027ecb..de0602e 100644 (file)
@@ -15,7 +15,7 @@ using NUnit.Framework;
 using Xamarin.UITest;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers = true)]
        public class Issue2470ViewModelBase : INotifyPropertyChanged
index 084dd45..b77412b 100644 (file)
@@ -9,7 +9,7 @@ using NUnit.Framework;
 using Xamarin.UITest;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers = true)]
        [Issue (IssueTracker.Github, 264, "PopModal NRE", PlatformAffected.Android | PlatformAffected.iOS)]
index 8452079..a32417f 100644 (file)
@@ -9,7 +9,7 @@ using Xamarin.UITest;
 using NUnit.Framework;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers = true)]
        [Issue (IssueTracker.Github, 2775, "ViewCell background conflicts with ListView Semi-Transparent and Transparent backgrounds")]
index b595951..1f344bc 100644 (file)
@@ -2,7 +2,7 @@
 <local:TestContentPage xmlns="http://xamarin.com/schemas/2014/forms"
                                 xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
                                 xmlns:local="clr-namespace:Xamarin.Forms.Controls"
-                                x:Class="Xamarin.Forms.Controls.Issue2777">
+                                x:Class="Xamarin.Forms.Controls.Issues.Issue2777">
        <local:TestContentPage.Content>
                <ListView x:Name="itemListView" IsGroupingEnabled="true" ItemTapped="OnItemTapped">
                        <ListView.GroupHeaderTemplate>
index c2ba5fb..590598f 100644 (file)
@@ -12,7 +12,7 @@ using NUnit.Framework;
 #endif
 
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers = true)]
        [Issue (IssueTracker.Github, 2777, "When add GroupHeaderTemplate in XAML the group header does not show up")]
index 57165d1..f9f227c 100644 (file)
@@ -8,7 +8,7 @@ using Xamarin.UITest;
 using Xamarin.UITest.Android;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers=true)]
        [Issue (IssueTracker.Github, 2809, "Secondary ToolbarItems cause app to hang during PushAsync", PlatformAffected.iOS)]
index 331793d..a83602d 100644 (file)
@@ -11,7 +11,7 @@ using Xamarin.UITest.iOS;
 
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers = true)]
        [Issue (IssueTracker.Github, 2883, "ViewCell IsEnabled set to false does not disable a cell in a TableView")]
index b5926d1..68c5122 100644 (file)
@@ -7,7 +7,7 @@ using Xamarin.UITest;
 using NUnit.Framework;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers = true)]
        [Issue (IssueTracker.Github, 2923, "First tab does not load until navigating", PlatformAffected.WinRT)]
index 348fc43..d0dbccf 100644 (file)
@@ -9,7 +9,7 @@ using Xamarin.UITest;
 using NUnit.Framework;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers = true)]
        [Issue (IssueTracker.Github, 2927, "ListView item tapped not firing multiple times")]
index 3a9ac3f..20cdd96 100644 (file)
@@ -12,7 +12,7 @@ using Xamarin.UITest.Android;
 using NUnit.Framework;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers = true)]
        [Issue (IssueTracker.Github, 2948, "MasterDetailPage Detail is interactive even when Master is open when in Landscape")]
@@ -217,6 +217,12 @@ namespace Xamarin.Forms.Controls
                        }
                }
 
+               [TearDown]
+               public void TestTearDown()
+               {
+                       RunningApp.SetOrientationPortrait();
+               }
+
                public bool ShouldRunTest() {
                        var isMasterVisible = RunningApp.Query (q => q.Marked ("Leads")).Length > 0;
                        return !isMasterVisible;
index a494251..d44dca1 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<controls:TestContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:controls="clr-namespace:Xamarin.Forms.Controls;assembly=Xamarin.Forms.Controls" x:Name="ThePageIssue2951" x:Class="Xamarin.Forms.Controls.Issue2951">
+<controls:TestContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:controls="clr-namespace:Xamarin.Forms.Controls;assembly=Xamarin.Forms.Controls" x:Name="ThePageIssue2951" x:Class="Xamarin.Forms.Controls.Issues.Issue2951">
        <controls:TestContentPage.Resources>
                <ResourceDictionary>
                        <Style x:Key="ButtonStyle" TargetType="Button">
index dd93c12..3e08281 100644 (file)
@@ -12,7 +12,7 @@ using NUnit.Framework;
 #endif
 
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers = true)]
        [Issue (IssueTracker.Github, 2951, "On Android, button background is not updated when color changes ")]
@@ -113,32 +113,32 @@ namespace Xamarin.Forms.Controls
        
                #endif
        }
+}
 
-
-       
-
-       [Preserve (AllMembers = true)]
+namespace Xamarin.Forms.Controls
+{
+       [Preserve(AllMembers = true)]
        public class ButtonExtensions
        {
 #pragma warning disable 618
-               public static readonly BindableProperty IsPrimaryProperty = BindableProperty.CreateAttached<ButtonExtensions, bool> (
+               public static readonly BindableProperty IsPrimaryProperty = BindableProperty.CreateAttached<ButtonExtensions, bool>(
 #pragma warning restore 618
-                                                                                   bindable => GetIsPrimary (bindable),
-                                                                                   false,
-                                                                                   BindingMode.TwoWay,
-                                                                                   null,
-                                                                                   null,
-                                                                                   null,
-                                                                                   null);
-
-               public static bool GetIsPrimary (BindableObject bo)
+                                                                                                                                               bindable => GetIsPrimary(bindable),
+                                                                                                                                               false,
+                                                                                                                                               BindingMode.TwoWay,
+                                                                                                                                               null,
+                                                                                                                                               null,
+                                                                                                                                               null,
+                                                                                                                                               null);
+
+               public static bool GetIsPrimary(BindableObject bo)
                {
-                       return (bool)bo.GetValue (IsPrimaryProperty);
+                       return (bool)bo.GetValue(IsPrimaryProperty);
                }
 
-               public static void SetIsPrimary (BindableObject bo, bool value)
+               public static void SetIsPrimary(BindableObject bo, bool value)
                {
-                       bo.SetValue (IsPrimaryProperty, value);
+                       bo.SetValue(IsPrimaryProperty, value);
                }
        }
-}
+}
\ No newline at end of file
index 8b2cfee..c4bc092 100644 (file)
@@ -9,7 +9,7 @@ using Xamarin.UITest;
 using NUnit.Framework;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers = true)]
        [Issue (IssueTracker.Github, 2953, "GroupHeaderCells disappear when item is removed from a group in ListView (iOS only) ")]
index 0102c43..74cad7a 100644 (file)
@@ -8,7 +8,7 @@ using Xamarin.UITest;
 using NUnit.Framework;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers = true)]
        [Issue (IssueTracker.Github, 2954, "Cell becomes empty after adding a new one with context actions (TableView) ")]
index 1da04dc..a0e2772 100644 (file)
@@ -10,7 +10,7 @@ using NUnit.Framework;
 using Xamarin.UITest.iOS;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
 #if UITEST
        [Ignore("This test is looking for an invalid behavior; the second tap *should* keep the drawer open.")] 
index 67afecb..964b70e 100644 (file)
@@ -8,7 +8,7 @@ using Xamarin.UITest;
 using NUnit.Framework;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers = true)]
        [Issue (IssueTracker.Github, 2963, "Disabling Editor in iOS does not disable entry of text")]
index 2b95eef..22a661e 100644 (file)
@@ -11,7 +11,7 @@ using Xamarin.UITest;
 using NUnit.Framework;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers = true)]
        [Issue (IssueTracker.Github, 2964, "TabbedPage toolbar item crash")]
index 0b05504..84727ae 100644 (file)
@@ -10,7 +10,7 @@ using NUnit.Framework;
 using Xamarin.UITest.iOS;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers = true)]
        [Issue (IssueTracker.Github, 2965, "CarouselPage Disappearing event does not fire on Android")]
index f7ef434..7e90314 100644 (file)
@@ -9,7 +9,7 @@ using Xamarin.UITest;
 using NUnit.Framework;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers = true)]
        [Issue (IssueTracker.Github, 2976, "Sample 'WorkingWithListviewNative' throw Exception on Xam.Android project.", PlatformAffected.Android)]
index a3693f3..7534c2d 100644 (file)
@@ -8,7 +8,7 @@ using Xamarin.UITest;
 using NUnit.Framework;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers = true)]
        [Issue (IssueTracker.Github, 2981, "Long Press on ListView causes crash")]
index 81d7a83..e146ffc 100644 (file)
@@ -5,7 +5,7 @@ using Xamarin.Forms.Internals;
 using NUnit.Framework;
 #endif
 
-namespace Xamarin.Forms.Controls.TestCasesPages
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers = true)]
        [Issue(IssueTracker.Github, 2983, "ListView.Footer can cause NullReferenceException", PlatformAffected.iOS)]
index 9829fb9..d1a1558 100644 (file)
@@ -12,7 +12,7 @@ using Xamarin.UITest;
 using NUnit.Framework;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers = true)]
        [Issue (IssueTracker.Github, 3276, "Crashing Unknown cell parent type on ContextAction Bindings")]
index a6daf24..46ba0b3 100644 (file)
@@ -11,7 +11,7 @@ using Xamarin.UITest;
 using NUnit.Framework;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers = true)]
        [Issue (IssueTracker.Github, 3292, "TableSection.Title property binding fails in XAML")]
index 7df9559..296c917 100644 (file)
@@ -2,7 +2,7 @@
 <local:TestContentPage xmlns="http://xamarin.com/schemas/2014/forms"
                                 xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
                                 xmlns:local="clr-namespace:Xamarin.Forms.Controls"
-                                x:Class="Xamarin.Forms.Controls.Issue3319">
+                                x:Class="Xamarin.Forms.Controls.Issues.Issue3319">
         <StackLayout Orientation="Vertical">
     <ListView x:Name="listView"
           ItemsSource="{Binding FavoriteArticles}"
index 234248d..c023e07 100644 (file)
@@ -13,7 +13,7 @@ using Xamarin.UITest;
 using NUnit.Framework;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers = true)]
        [Issue (IssueTracker.Github, 3319, "[iOS] Clear and adding rows exception")]
index 6bac963..b02ec03 100644 (file)
@@ -9,7 +9,7 @@ using Xamarin.UITest;
 using Xamarin.Forms.Core.UITests;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers=true)]
        [Issue (IssueTracker.Github, 342, "NRE when Image is not assigned source", PlatformAffected.WinPhone)]
index f09f587..448a06a 100644 (file)
@@ -9,7 +9,7 @@ using NUnit.Framework;
 using Xamarin.UITest;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers = true)]
        [Issue (IssueTracker.Github, 416, "NavigationPage in PushModal does not show NavigationBar", PlatformAffected.Android, NavigationBehavior.PushModalAsync)]
index 4496be3..32391f4 100644 (file)
@@ -11,7 +11,7 @@ using NUnit.Framework;
 using Xamarin.UITest;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers = true)]
        [Issue (IssueTracker.Github, 417, "Navigation.PopToRootAsync does nothing", PlatformAffected.Android)]
index c6b3c43..80028b5 100644 (file)
@@ -13,7 +13,7 @@ using NUnit.Framework;
 using Xamarin.UITest;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers = true)]
        [Issue (IssueTracker.Github, 465, "Change in Navigation.PushModal", PlatformAffected.All)]
index a01a1e8..964bf24 100644 (file)
@@ -7,7 +7,7 @@ using Xamarin.UITest;
 using Xamarin.Forms.Core.UITests;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers = true)]
        [Issue (IssueTracker.Github, 488, "Resizing the Label results in wrapped text being cropped on iOS", PlatformAffected.iOS)]
index 03e587b..34d8f22 100644 (file)
@@ -11,7 +11,7 @@ using NUnit.Framework;
 using Xamarin.UITest;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers = true)]
        [Issue (IssueTracker.Github, 530, "ListView does not render if source is async", PlatformAffected.iOS)]
index 0aefc55..4aa0cbc 100644 (file)
@@ -8,7 +8,7 @@ using Xamarin.UITest;
 using NUnit.Framework;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve(AllMembers = true)]
        [Issue(IssueTracker.None, 55555, "Header problem")]
index 5bad4e4..5336f2f 100644 (file)
@@ -9,7 +9,7 @@ using Xamarin.UITest;
 using Xamarin.Forms.Core.UITests;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers = true)]
        [Issue (IssueTracker.Github, 764, "Keyboard does not dismiss on SearchBar", PlatformAffected.Android)]
index 4386ab7..f8c2233 100644 (file)
@@ -8,7 +8,7 @@ using Xamarin.UITest.Queries;
 #endif
 
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers=true)]
        [Issue (IssueTracker.Github, 773, "Horizontal ScrollView locks after rotation", PlatformAffected.iOS)]
index 2b30095..76e2480 100644 (file)
@@ -9,7 +9,7 @@ using NUnit.Framework;
 using Xamarin.UITest.iOS;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers = true)]
        [Issue (IssueTracker.Github, 774, "ActionSheet won't dismiss after rotation to landscape", PlatformAffected.Android, NavigationBehavior.PushModalAsync)]
@@ -54,6 +54,7 @@ namespace Xamarin.Forms.Controls
                                        RunningApp.WaitForNoElement (q => q.Marked ("Destroy"));
                                else
                                        RunningApp.WaitForNoElement (q => q.Marked ("Dismiss"));
+
                                RunningApp.Screenshot ("Dismiss ActionSheet");
 
 //                             App.SetOrientationPortrait ();
@@ -71,6 +72,16 @@ namespace Xamarin.Forms.Controls
 //                                     App.WaitForNoElement (q => q.Marked ("Dismiss"));
                        
                        } 
+                       else
+                       {
+                               RunningApp.Tap(q => q.Marked("Dismiss"));
+                       }
+               }
+
+               [TearDown]
+               public void TearDown()
+               {
+                       RunningApp.SetOrientationPortrait();
                }
 #endif
 
index b65668d..d902241 100644 (file)
@@ -11,7 +11,7 @@ using NUnit.Framework;
 using Xamarin.UITest;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers=true)]
        [Issue (IssueTracker.Github, 852, "Async loading of Content causes UI element to be unclickable", PlatformAffected.Android | PlatformAffected.iOS)]
index b621f10..75b08a1 100644 (file)
@@ -8,7 +8,7 @@ using NUnit.Framework;
 using Xamarin.UITest;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers=true)]
        [Issue (IssueTracker.Github, 889, "Assigning to MasterDetailPage.Detail after construction doesn't work", PlatformAffected.Android | PlatformAffected.iOS)]
index 681329b..33402ee 100644 (file)
@@ -8,7 +8,7 @@ using NUnit.Framework;
 using Xamarin.UITest;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
 
        public class NavPageNameObject
index e78de0e..fdd5c0a 100644 (file)
@@ -7,7 +7,7 @@ using NUnit.Framework;
 using Xamarin.UITest;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        public class Person 
        {
index 9d85420..5a78900 100644 (file)
@@ -7,7 +7,7 @@ using NUnit.Framework;
 using Xamarin.UITest;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers = true)]
        [Issue (IssueTracker.Github, 968, "StackLayout does not relayout on device rotation", PlatformAffected.iOS, NavigationBehavior.PushModalAsync)]
index 890bf50..f7d0aec 100644 (file)
@@ -9,7 +9,7 @@ using NUnit.Framework;
 using Xamarin.UITest;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        internal class PageNameObject
        {
index fcb5e19..f0b0025 100644 (file)
@@ -11,28 +11,30 @@ using Xamarin.UITest;
 
 namespace Xamarin.Forms.Controls
 {
-
        public class GenericValueConverter : IValueConverter
        {
                Func<object, object> _convert;
                Func<object, object> _back;
-               public GenericValueConverter (Func<object, object> convert, Func<object, object> back = null)
+               public GenericValueConverter(Func<object, object> convert, Func<object, object> back = null)
                {
                        _convert = convert;
                        _back = back;
                }
 
-               public object Convert (object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
+               public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
                {
-                       return _convert (value);
+                       return _convert(value);
                }
 
-               public object ConvertBack (object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
+               public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
                {
-                       return _back (value);
+                       return _back(value);
                }
        }
+}
 
+namespace Xamarin.Forms.Controls.Issues
+{
        [Preserve (AllMembers = true)]
        public class Expense
        {
index d8cbec7..e2210ea 100644 (file)
@@ -7,7 +7,7 @@ using NUnit.Framework;
 using Xamarin.UITest;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers = true)]
        [Issue (IssueTracker.None, 0, "StackLayout issue", PlatformAffected.All, NavigationBehavior.PushModalAsync)]
index af5d7b1..e0306df 100644 (file)
@@ -12,7 +12,7 @@ using Xamarin.UITest.iOS;
 #endif
 
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers = true)]
        [Issue (IssueTracker.None, 0, "Swipe back nav crash", PlatformAffected.iOS)]
index fb3b737..4b957ad 100644 (file)
@@ -11,7 +11,7 @@ using NUnit.Framework;
 using Xamarin.UITest;
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers = true)]
        [Issue (IssueTracker.None, 0,"TabbedPage nav tests", PlatformAffected.All)]
index b2d1ba4..d9a70db 100644 (file)
@@ -7,7 +7,7 @@ using Xamarin.UITest;
 #endif
 
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve (AllMembers = true)]
        public class TabbedPageWithListName {
index 352cb74..0439c79 100644 (file)
@@ -29,12 +29,12 @@ namespace Xamarin.Forms.Controls
                {
                        IApp app = null;
 #if __ANDROID__
-                       app = ConfigureApp.Android.ApkFile (AppPaths.ApkPath).Debug ().StartApp ();
-#elif __IOS__ 
-                       app = ConfigureApp.iOS.InstalledApp (AppPaths.BundleId).Debug ()
-                               //Uncomment to run from a specific iOS SIM, get the ID from XCode -> Devices
-                               //.DeviceIdentifier("55555555-5555-5555-5555-555555555555")
-                               .StartApp ();
+
+                       app = InitializeAndroidApp();
+
+#elif __IOS__
+
+                       app = InitializeiOSApp();
 #endif
                        if (app == null)
                                throw new NullReferenceException ("App was not initialized.");
@@ -43,7 +43,33 @@ namespace Xamarin.Forms.Controls
                        return new ScreenshotConditionalApp(app);
                }
 
-               static void NavigateToIssue (Type type, IApp app)
+#if __ANDROID__
+               static IApp InitializeAndroidApp()
+               {
+                       return ConfigureApp.Android.ApkFile(AppPaths.ApkPath).Debug().StartApp();
+               }
+#endif
+
+#if __IOS__
+               static IApp InitializeiOSApp() 
+               { 
+                       // Running on a device
+                       var app = ConfigureApp.iOS.InstalledApp(AppPaths.BundleId).Debug()
+                               //Uncomment to run from a specific iOS SIM, get the ID from XCode -> Devices
+                               .StartApp();
+
+                       // Running on the simulator
+                       //var app = ConfigureApp.iOS
+                       //                                .PreferIdeSettings()
+                       //                                .AppBundle("../../../Xamarin.Forms.ControlGallery.iOS/bin/iPhoneSimulator/Debug/XamarinFormsControlGalleryiOS.app")
+                       //                                .Debug()
+                       //                                .StartApp();
+
+                       return app;
+               }
+#endif
+
+               public static void NavigateToIssue (Type type, IApp app)
                {
                        var typeIssueAttribute = type.GetTypeInfo ().GetCustomAttribute <IssueAttribute> ();
 
@@ -56,6 +82,29 @@ namespace Xamarin.Forms.Controls
                                cellName = typeIssueAttribute.Description;
                        }
 
+                       try
+                       {
+                               // Attempt the direct way of navigating to the test page
+#if __ANDROID__
+
+                               if (bool.Parse((string)app.Invoke("NavigateToTest", cellName)))
+                               {
+                                       return;
+                               }
+#endif
+#if __IOS__
+                               if (bool.Parse(app.Invoke("navigateToTest:", cellName).ToString()))
+                               {
+                                       return;
+                               }
+#endif
+                       }
+                       catch (Exception ex)
+                       {
+                               System.Diagnostics.Debug.WriteLine($"Could not directly invoke test, using UI navigation. {ex}");
+                       }
+                       
+                       // Fall back to the "manual" navigation method
                        app.Tap (q => q.Button ("Go to Test Cases"));
                        app.WaitForElement (q => q.Raw ("* marked:'TestCasesIssueList'"));
 
@@ -79,13 +128,71 @@ namespace Xamarin.Forms.Controls
 
                        return runningApp;
                }
+
+               // Make sure the server on the device is still up and running;
+               // if not, restart the app
+               public static void EnsureConnection()
+               {
+                       if (RunningApp != null)
+                       {
+                               try
+                               {
+                                       RunningApp.TestServer.Get("version");
+                                       return;
+                               }
+                               catch (Exception ex)
+                               {
+                               }
+
+                               RunningApp = InitializeApp();
+                       }
+               }
+
+               static int s_testsrun;
+               const int ConsecutiveTestLimit = 40;
+
+               // Until we get more of our memory leak issues worked out, restart the app 
+               // after a specified number of tests so we don't get bogged down in GC
+               public static void EnsureMemory()
+               {
+                       if (RunningApp != null)
+                       {
+                               s_testsrun += 1;
+
+                               if (s_testsrun >= ConsecutiveTestLimit)
+                               {
+                                       s_testsrun = 0;
+                                       RunningApp = InitializeApp();
+                               }
+                       }
+               }
+
+               // For tests which just don't play well with others, we can ensure
+               // that they run in their own instance of the application
+               public static void BeginIsolate()
+               {
+                       if (RunningApp != null && s_testsrun > 0)
+                       {
+                               s_testsrun = 0;
+                               RunningApp = InitializeApp();
+                       }
+               }
+
+               public static void EndIsolate()
+               {
+                       s_testsrun = ConsecutiveTestLimit;
+               }
+
+               public static IApp RunningApp { get; set; }
        }
 #endif
 
        public abstract class TestPage : Page
        {
 #if UITEST
-               public IApp RunningApp { get; private set; }
+               public IApp RunningApp => AppSetup.RunningApp;
+
+               protected virtual bool Isolate => false;
 #endif
 
                protected TestPage ()
@@ -97,9 +204,28 @@ namespace Xamarin.Forms.Controls
 
 #if UITEST
                [SetUp]
-               public void Setup ()
+               public void Setup()
                {
-                       RunningApp = AppSetup.Setup (GetType ());
+                       if (Isolate)
+                       {
+                               AppSetup.BeginIsolate();
+                       }
+                       else
+                       {
+                               AppSetup.EnsureMemory();
+                               AppSetup.EnsureConnection();
+                       }
+
+                       AppSetup.NavigateToIssue(GetType(), RunningApp);
+               }
+
+               [TearDown]
+               public void TearDown()
+               {
+                       if (Isolate)
+                       {
+                               AppSetup.EndIsolate();
+                       }
                }
 #endif
 
@@ -110,7 +236,9 @@ namespace Xamarin.Forms.Controls
        public abstract class TestContentPage : ContentPage
        {
 #if UITEST
-               public IApp RunningApp { get; private set; }
+               public IApp RunningApp => AppSetup.RunningApp;
+
+               protected virtual bool Isolate => false;
 #endif
 
                protected TestContentPage ()
@@ -124,7 +252,26 @@ namespace Xamarin.Forms.Controls
                [SetUp]
                public void Setup ()
                {
-                       RunningApp = AppSetup.Setup (GetType ());
+                       if (Isolate)
+                       {
+                               AppSetup.BeginIsolate();
+                       }
+                       else
+                       {
+                               AppSetup.EnsureMemory();
+                               AppSetup.EnsureConnection();
+                       }
+
+                       AppSetup.NavigateToIssue(GetType(), RunningApp);
+               }
+
+               [TearDown]
+               public void TearDown()
+               {
+                       if (Isolate)
+                       {
+                               AppSetup.EndIsolate();
+                       }
                }
 #endif
 
@@ -134,7 +281,9 @@ namespace Xamarin.Forms.Controls
        public abstract class TestCarouselPage : CarouselPage
        {
 #if UITEST
-               public IApp RunningApp { get; private set; }
+               public IApp RunningApp => AppSetup.RunningApp;
+
+               protected virtual bool Isolate => false;
 #endif
 
                protected TestCarouselPage ()
@@ -146,9 +295,28 @@ namespace Xamarin.Forms.Controls
 
 #if UITEST
                [SetUp]
-               public void Setup ()
+               public void Setup()
                {
-                       RunningApp = AppSetup.Setup (GetType ());
+                       if (Isolate)
+                       {
+                               AppSetup.BeginIsolate();
+                       }
+                       else
+                       {
+                               AppSetup.EnsureMemory();
+                               AppSetup.EnsureConnection();
+                       }
+
+                       AppSetup.NavigateToIssue(GetType(), RunningApp);
+               }
+
+               [TearDown]
+               public void TearDown()
+               {
+                       if (Isolate)
+                       {
+                               AppSetup.EndIsolate();
+                       }
                }
 #endif
 
@@ -158,7 +326,9 @@ namespace Xamarin.Forms.Controls
        public abstract class TestMasterDetailPage : MasterDetailPage
        {
 #if UITEST
-               public IApp RunningApp { get; private set; }
+               public IApp RunningApp => AppSetup.RunningApp;
+
+               protected virtual bool Isolate => false;
 #endif
 
                protected TestMasterDetailPage ()
@@ -170,9 +340,28 @@ namespace Xamarin.Forms.Controls
 
 #if UITEST
                [SetUp]
-               public void Setup ()
+               public void Setup()
                {
-                       RunningApp = AppSetup.Setup (GetType ());
+                       if (Isolate)
+                       {
+                               AppSetup.BeginIsolate();
+                       }
+                       else
+                       {
+                               AppSetup.EnsureMemory();
+                               AppSetup.EnsureConnection();
+                       }
+
+                       AppSetup.NavigateToIssue(GetType(), RunningApp);
+               }
+
+               [TearDown]
+               public void TearDown()
+               {
+                       if (Isolate)
+                       {
+                               AppSetup.EndIsolate();
+                       }
                }
 #endif
 
@@ -182,7 +371,9 @@ namespace Xamarin.Forms.Controls
        public abstract class TestNavigationPage : NavigationPage
        {
 #if UITEST
-               public IApp RunningApp { get; private set; }
+               public IApp RunningApp => AppSetup.RunningApp;
+
+               protected virtual bool Isolate => false;
 #endif
 
                protected TestNavigationPage ()
@@ -194,9 +385,28 @@ namespace Xamarin.Forms.Controls
 
 #if UITEST
                [SetUp]
-               public void Setup ()
+               public void Setup()
                {
-                       RunningApp = AppSetup.Setup (GetType ());
+                       if (Isolate)
+                       {
+                               AppSetup.BeginIsolate();
+                       }
+                       else
+                       {
+                               AppSetup.EnsureMemory();
+                               AppSetup.EnsureConnection();
+                       }
+
+                       AppSetup.NavigateToIssue(GetType(), RunningApp);
+               }
+
+               [TearDown]
+               public void TearDown()
+               {
+                       if (Isolate)
+                       {
+                               AppSetup.EndIsolate();
+                       }
                }
 #endif
 
@@ -206,7 +416,9 @@ namespace Xamarin.Forms.Controls
        public abstract class TestTabbedPage : TabbedPage
        {
 #if UITEST
-               public IApp RunningApp { get; private set; }
+               public IApp RunningApp => AppSetup.RunningApp;
+
+               protected virtual bool Isolate => false;
 #endif
 
                protected TestTabbedPage ()
@@ -218,12 +430,51 @@ namespace Xamarin.Forms.Controls
 
 #if UITEST
                [SetUp]
-               public void Setup ()
+               public void Setup()
                {
-                       RunningApp = AppSetup.Setup (GetType ());
+                       if (Isolate)
+                       {
+                               AppSetup.BeginIsolate();
+                       }
+                       else
+                       {
+                               AppSetup.EnsureMemory();
+                               AppSetup.EnsureConnection();
+                       }
+
+                       AppSetup.NavigateToIssue(GetType(), RunningApp);
+               }
+
+               [TearDown]
+               public void TearDown()
+               {
+                       if (Isolate)
+                       {
+                               AppSetup.EndIsolate();
+                       }
                }
 #endif
 
                protected abstract void Init ();
        }
 }
+
+#if UITEST
+namespace Xamarin.Forms.Controls.Issues
+{
+       using System;
+       using NUnit.Framework;
+
+       // Run setup once for all tests in the Xamarin.Forms.Controls.Issues namespace
+       // (instead of once for each test)
+       [SetUpFixture]
+       public class IssuesSetup
+       {
+               [SetUp]
+               public void RunBeforeAnyTests()
+               {
+                       AppSetup.RunningApp = AppSetup.Setup(null);
+               }
+       }
+}
+#endif
index a38e9f4..7c94876 100644 (file)
@@ -12,7 +12,7 @@ using NUnit.Framework;
 [assembly: NUnit.Framework.Category("Issues")]
 #endif
 
-namespace Xamarin.Forms.Controls
+namespace Xamarin.Forms.Controls.Issues
 {
        [Preserve(AllMembers = true)]
        [Issue(IssueTracker.Bugzilla, 1, "Issue Description", PlatformAffected.Default)]
index 3af36ee..fcf0b1f 100644 (file)
@@ -22,16 +22,14 @@ namespace Xamarin.Forms.Controls
                static Dictionary<string, string> s_config;
                readonly ITestCloudService _testCloudService;
 
+               public const string DefaultMainPageId = "ControlGalleryMainPage";
+
                public App()
                {
                        _testCloudService = DependencyService.Get<ITestCloudService>();
                        InitInsights();
 
-                       MainPage = new MasterDetailPage
-                       {
-                               Master = new ContentPage { Title = "Master", BackgroundColor = Color.Red },
-                               Detail = CoreGallery.GetMainPage()
-                       };
+                       SetMainPage(CreateDefaultMainPage());
 
                        //// Uncomment to verify that there is no gray screen displayed between the blue splash and red MasterDetailPage.
                        //MainPage = new Bugzilla44596SplashPage(() =>
@@ -46,6 +44,16 @@ namespace Xamarin.Forms.Controls
                        //});
                }
 
+               public Page CreateDefaultMainPage()
+               {
+                       return new MasterDetailPage
+                       {
+                               AutomationId = DefaultMainPageId,
+                               Master = new ContentPage { Title = "Master", BackgroundColor = Color.Red },
+                               Detail = CoreGallery.GetMainPage()
+                       };
+               }
+
                protected override void OnAppLinkRequestReceived(Uri uri)
                {
                        var appDomain = "http://" + AppName.ToLowerInvariant() + "/";
@@ -154,5 +162,43 @@ namespace Xamarin.Forms.Controls
                                text = await reader.ReadToEndAsync();
                        return text;
                }
+
+               public bool NavigateToTestPage(string test)
+               {
+                       try
+                       {
+                               // Create an instance of the main page
+                               var root = CreateDefaultMainPage();
+
+                               // Set up a delegate to handle the navigation to the test page
+                               EventHandler toTestPage = null;
+
+                               toTestPage = delegate(object sender, EventArgs e) 
+                               {
+                                       Current.MainPage.Navigation.PushModalAsync(TestCases.GetTestCases());
+                                       TestCases.TestCaseScreen.PageToAction[test]();
+                                       Current.MainPage.Appearing -= toTestPage;
+                               };
+
+                               // And set that delegate to run once the main page appears
+                               root.Appearing += toTestPage;
+
+                               SetMainPage(root);
+
+                               return true;
+                       }
+                       catch (Exception ex) 
+                       {
+                               Log.Warning("UITests", $"Error attempting to navigate directly to {test}: {ex}");
+
+                       }
+
+                       return false;
+               }
+               
+               public void Reset()
+               {
+                       SetMainPage(CreateDefaultMainPage());
+               }
        }
 }
\ No newline at end of file
index 0df2eeb..21d9190 100644 (file)
@@ -69,13 +69,13 @@ namespace Xamarin.Forms.Controls
                        {
                                page.Appearing += (object sender, EventArgs e) => {
                                        _isAppearingFired++;
-                                       App.AppearingMessages.Add ($"Appearing {page.Title}");
+                                       App.AppearingMessages.Insert (0, $"Appearing {page.Title}");
                                        Debug.WriteLine ($"Appearing {page.Title}");
                                };
 
                                page.Disappearing += (object sender, EventArgs e) => {
                                        _isDisappearingFired++;
-                                       App.AppearingMessages.Add ($"Disappearing {page.Title}");
+                                       App.AppearingMessages.Insert (0, $"Disappearing {page.Title}");
                                        Debug.WriteLine( $"Disappearing {page.Title}");
                                };
                        }
index a92c085..0a116d1 100644 (file)
@@ -57,8 +57,9 @@
     <Reference Include="nunit.framework">
       <HintPath>..\packages\NUnit.2.6.4\lib\nunit.framework.dll</HintPath>
     </Reference>
-    <Reference Include="Xamarin.UITest">
-      <HintPath>..\packages\Xamarin.UITest.2.0.0-beta05\lib\Xamarin.UITest.dll</HintPath>
+    <Reference Include="Xamarin.UITest, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
+      <HintPath>..\packages\Xamarin.UITest.2.0.0\lib\Xamarin.UITest.dll</HintPath>
+      <Private>True</Private>
     </Reference>
   </ItemGroup>
   <ItemGroup>
index 2f9ba9c..6b16f36 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
 <packages>
   <package id="NUnit" version="2.6.4" targetFramework="net45" />
-  <package id="Xamarin.UITest" version="2.0.0-beta05" targetFramework="net45" />
+  <package id="Xamarin.UITest" version="2.0.0" targetFramework="net45" />
 </packages>
\ No newline at end of file
index 76eb2d1..c2cf20c 100644 (file)
@@ -46,8 +46,9 @@
     <Reference Include="System.Data" />
     <Reference Include="System.Net.Http" />
     <Reference Include="System.Xml" />
-    <Reference Include="Xamarin.UITest">
-      <HintPath>..\packages\Xamarin.UITest.2.0.0-beta05\lib\Xamarin.UITest.dll</HintPath>
+    <Reference Include="Xamarin.UITest, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
+      <HintPath>..\packages\Xamarin.UITest.2.0.0\lib\Xamarin.UITest.dll</HintPath>
+      <Private>True</Private>
     </Reference>
   </ItemGroup>
   <ItemGroup>
index 2f9ba9c..6b16f36 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
 <packages>
   <package id="NUnit" version="2.6.4" targetFramework="net45" />
-  <package id="Xamarin.UITest" version="2.0.0-beta05" targetFramework="net45" />
+  <package id="Xamarin.UITest" version="2.0.0" targetFramework="net45" />
 </packages>
\ No newline at end of file
index b2f98e2..78fa2e3 100644 (file)
@@ -16,67 +16,90 @@ namespace Xamarin.Forms.Core.UITests
        {
                // TODO: Landscape tests
 
-               public static IApp App { get; private set; }
+               public static IApp App { get; set; }
                public string PlatformViewType { get; protected set; }
-               public bool ShouldResetPerFixture { get; protected set; }
-               public AppRect ScreenBounds { get; private set; }
+               public static AppRect ScreenBounds { get; set; }
 
-               protected BaseTestFixture()
+               [TestFixtureTearDown]
+               protected virtual void FixtureTeardown()
                {
-                       ShouldResetPerFixture = true;
                }
 
-               protected abstract void NavigateToGallery();
+               static int s_testsrun;
+               const int ConsecutiveTestLimit = 40;
 
-#pragma warning disable 618
-               [TestFixtureSetUp]
-#pragma warning restore 618
-               protected virtual void FixtureSetup()
+               // Until we get more of our memory leak issues worked out, restart the app 
+               // after a specified number of tests so we don't get bogged down in GC
+               public void EnsureMemory()
                {
-                       try
-                       {
-                               if (ShouldResetPerFixture)
-                               {
-                                       RelaunchApp();
-                               }
-                       }
-                       catch (Exception ex)
+                       s_testsrun += 1;
+
+                       if (s_testsrun >= ConsecutiveTestLimit)
                        {
-                               Debug.WriteLine(ex);
-                               throw;
-                       }
-               }
+                               s_testsrun = 0;
 
-#pragma warning disable 618
-               [TestFixtureTearDown]
-#pragma warning restore 618
-               protected virtual void FixtureTeardown()
-               {
+                               CoreUITestsSetup.LaunchApp();
+
+                               FixtureSetup();
+                       }
                }
 
                [SetUp]
                protected virtual void TestSetup()
                {
-                       if (!ShouldResetPerFixture)
-                       {
-
-                               RelaunchApp();
-                       }
+                       EnsureMemory();
                }
 
                [TearDown]
                protected virtual void TestTearDown()
                {
-
                }
 
-               void RelaunchApp()
+               protected abstract void NavigateToGallery();
+
+#pragma warning disable 618
+               [TestFixtureSetUp]
+#pragma warning restore 618
+               protected virtual void FixtureSetup()
                {
-                       App = null;
-                       App = AppSetup.Setup();
-                       App.SetOrientationPortrait();
-                       ScreenBounds = App.RootViewRect();
+                       ResetApp();
                        NavigateToGallery();
                }
+
+               protected void ResetApp()
+               {
+#if __IOS__
+                       App.Invoke("reset:", string.Empty);
+#endif
+#if __ANDROID__
+                       App.Invoke("Reset");
+#endif
+               }
+       }
+}
+
+#if UITEST
+namespace Xamarin.Forms.Core.UITests
+{
+       using NUnit.Framework;
+
+       [SetUpFixture]
+       public class CoreUITestsSetup
+       {
+               [SetUp]
+               public void RunBeforeAnyTests()
+               {
+                       LaunchApp();
+               }
+
+               public static void LaunchApp()
+               {
+                       BaseTestFixture.App = null;
+                       BaseTestFixture.App = AppSetup.Setup();
+
+                       BaseTestFixture.App.SetOrientationPortrait();
+                       BaseTestFixture.ScreenBounds = BaseTestFixture.App.RootViewRect();
+               }
        }
 }
+#endif
index 4b37ea9..1e62461 100644 (file)
@@ -6,9 +6,8 @@ namespace Xamarin.Forms.Core.UITests
        [Category(UITestCategories.LifeCycle)]
        internal class AppearingUITests : BaseTestFixture
        {
-               public AppearingUITests ()
+               public AppearingUITests()
                {
-                       ShouldResetPerFixture = false;
                }
 
                protected override void NavigateToGallery ()
@@ -16,6 +15,13 @@ namespace Xamarin.Forms.Core.UITests
                        App.NavigateToGallery (GalleryQueries.AppearingGallery);
                }
 
+               protected override void TestTearDown()
+               {
+                       base.TestTearDown();
+                       ResetApp();
+                       NavigateToGallery();
+               }
+
                [Test]
                public void AppearingNavigationPage ()
                {
index a3ae106..d681d47 100644 (file)
@@ -16,7 +16,6 @@ namespace Xamarin.Forms.Core.UITests
 
                public ContextActionsListUITests ()
                {
-                       ShouldResetPerFixture = false;
                }
 
                protected override void NavigateToGallery ()
@@ -46,12 +45,12 @@ namespace Xamarin.Forms.Core.UITests
                public void ContextActionsDelete ()
                {
                        // mark is an icon on android
-                       App.TouchAndHold (q => q.Marked (cell0));
+                       App.TouchAndHold (q => q.Marked (cell1));
                        App.WaitForElement (q => q.Marked (delete));
                        App.Screenshot ("I have actions!");
 
                        App.Tap (q => q.Marked (delete));
-                       App.WaitForNoElement (q => q.Marked (cell0));
+                       App.WaitForNoElement (q => q.Marked (cell1));
                        App.Screenshot ("Deleted cell 0");
                }
 #endif
@@ -89,7 +88,6 @@ namespace Xamarin.Forms.Core.UITests
        {
                public ContextActionsTableUITests ()
                {
-                       ShouldResetPerFixture = false;
                }
 
                protected override void NavigateToGallery ()
index 86a39ad..7e0cebf 100644 (file)
@@ -10,7 +10,6 @@ namespace Xamarin.Forms.Core.UITests
        {
                public UnevenListTests ()
                {
-                       ShouldResetPerFixture = false;
                }
 
                protected override void NavigateToGallery ()
index 42ac29e..e71867c 100644 (file)
@@ -58,8 +58,9 @@
     <Reference Include="nunit.framework">
       <HintPath>..\packages\NUnit.2.6.4\lib\nunit.framework.dll</HintPath>
     </Reference>
-    <Reference Include="Xamarin.UITest">
-      <HintPath>..\packages\Xamarin.UITest.2.0.0-beta05\lib\Xamarin.UITest.dll</HintPath>
+    <Reference Include="Xamarin.UITest, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
+      <HintPath>..\packages\Xamarin.UITest.2.0.0\lib\Xamarin.UITest.dll</HintPath>
+      <Private>True</Private>
     </Reference>
   </ItemGroup>
   <ItemGroup>
index 2f9ba9c..6b16f36 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
 <packages>
   <package id="NUnit" version="2.6.4" targetFramework="net45" />
-  <package id="Xamarin.UITest" version="2.0.0-beta05" targetFramework="net45" />
+  <package id="Xamarin.UITest" version="2.0.0" targetFramework="net45" />
 </packages>
\ No newline at end of file
index c694381..ac9aa1b 100644 (file)
@@ -1,6 +1,7 @@
 using System;
 using System.Collections.Generic;
 using System.Collections.ObjectModel;
+
 using System.Threading.Tasks;
 using Xamarin.Forms.Platform;
 
index 7add5eb..9eb9d4f 100644 (file)
@@ -107,7 +107,7 @@ namespace Xamarin.Forms.Platform.iOS
                public override void ViewDidDisappear(bool animated)
                {
                        base.ViewDidDisappear(animated);
-                       PageController.SendDisappearing();
+                       PageController?.SendDisappearing();
                }
 
                public override void ViewDidLayoutSubviews()
index 207282e..e72b243 100644 (file)
@@ -173,7 +173,7 @@ namespace Xamarin.Forms.Platform.iOS
                public override void ViewDidDisappear(bool animated)
                {
                        base.ViewDidDisappear(animated);
-                       PageController.SendDisappearing();
+                       PageController?.SendDisappearing();
                }
 
                public override void ViewDidLayoutSubviews()