Attempt to get UI test for 44166 working on iOS (#485)
authorE.Z. Hart <hartez@users.noreply.github.com>
Mon, 31 Oct 2016 15:22:54 +0000 (09:22 -0600)
committerRui Marinho <me@ruimarinho.net>
Mon, 31 Oct 2016 15:22:54 +0000 (15:22 +0000)
* Attempt to get UI test for 44166 working on iOS

* Another attempt to get this running consistently on iOS

* Adding screenshots so I can figure out why this doesn't work when XTC runs it

* Maybe there's confusion between the back buttons?

* Hey, it works now! Removing the debugging stuff.

* Clean up extra build constants

Xamarin.Forms.ControlGallery.iOS/Xamarin.Forms.ControlGallery.iOS.csproj
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla44166.cs

index 471c1d5..b8e3c8d 100644 (file)
@@ -27,7 +27,8 @@
     <MtouchLink>None</MtouchLink>
     <MtouchDebug>True</MtouchDebug>
     <CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
-    <MtouchSdkVersion></MtouchSdkVersion>
+    <MtouchSdkVersion>
+    </MtouchSdkVersion>
     <MtouchProfiling>False</MtouchProfiling>
     <MtouchFastDev>False</MtouchFastDev>
     <MtouchEnableGenericValueTypeSharing>True</MtouchEnableGenericValueTypeSharing>
@@ -60,7 +61,7 @@
     <DebugType>full</DebugType>
     <Optimize>false</Optimize>
     <OutputPath>bin\iPhone\Debug</OutputPath>
-    <DefineConstants>DEBUG</DefineConstants>
+    <DefineConstants>DEBUG;__UNIFIED__;__MOBILE__;__IOS__</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
     <ConsolePause>false</ConsolePause>
@@ -69,7 +70,8 @@
     <MtouchDebug>True</MtouchDebug>
     <CodesignEntitlements>
     </CodesignEntitlements>
-    <MtouchSdkVersion></MtouchSdkVersion>
+    <MtouchSdkVersion>
+    </MtouchSdkVersion>
     <MtouchLink>SdkOnly</MtouchLink>
     <MtouchProfiling>False</MtouchProfiling>
     <MtouchExtraArgs />
     </XamarinComponentReference>
   </ItemGroup>
   <Import Project="..\packages\Xamarin.Insights.1.12.3\build\Xamarin.iOS10\Xamarin.Insights.targets" Condition="Exists('..\packages\Xamarin.Insights.1.12.3\build\Xamarin.iOS10\Xamarin.Insights.targets')" />
-</Project>
+</Project>
\ No newline at end of file
index 40264f0..fbbd68a 100644 (file)
@@ -1,9 +1,9 @@
 using System;
-using System.Diagnostics;
-using System.Threading;
-using System.Threading.Tasks;
+using System.Collections.ObjectModel;
 using Xamarin.Forms.CustomAttributes;
 using Xamarin.Forms.Internals;
+using System.Threading;
+using System.Diagnostics;
 
 #if UITEST
 using Xamarin.UITest;
@@ -20,10 +20,10 @@ namespace Xamarin.Forms.Controls
                {
                        var label = new Label() { Text = "Testing..." };
 
-                       var goButton = new Button { Text = "Go" };
+                       var goButton = new Button { Text = "Go", AutomationId = "Go" };
                        goButton.Clicked += (sender, args) => Application.Current.MainPage = new _44166MDP();
 
-                       var gcButton = new Button { Text = "GC" };
+                       var gcButton = new Button { Text = "GC", AutomationId = "GC" };
                        gcButton.Clicked += (sender, args) =>
                        {
                                GC.Collect();
@@ -68,12 +68,13 @@ namespace Xamarin.Forms.Controls
                        RunningApp.WaitForElement(q => q.Marked("Go"));
                        RunningApp.Tap(q => q.Marked("Go"));
 
-                       RunningApp.WaitForElement(q => q.Marked("Back"));
-                       RunningApp.Tap(q => q.Marked("Back"));
+                       RunningApp.WaitForElement(q => q.Marked("Previous"));
+                       RunningApp.Tap(q => q.Marked("Previous"));
+
+                       RunningApp.WaitForElement(q => q.Marked("GC"));
 
                        for (var n = 0; n < 10; n++)
                        {
-                               RunningApp.WaitForElement(q => q.Marked("GC"));
                                RunningApp.Tap(q => q.Marked("GC"));
 
                                if (RunningApp.Query(q => q.Marked("Success")).Length > 0)
@@ -141,7 +142,7 @@ namespace Xamarin.Forms.Controls
                        Debug.WriteLine($"++++++++ {nameof(_44166Master)} constructor, {Counter} allocated");
 
                        Title = "Master";
-                       var goButton = new Button { Text = "Back" };
+                       var goButton = new Button { Text = "Return", AutomationId = "Return"};
                        goButton.Clicked += (sender, args) => Application.Current.MainPage = new Bugzilla44166();
 
                        Content = new StackLayout
@@ -188,7 +189,7 @@ namespace Xamarin.Forms.Controls
                        Interlocked.Increment(ref Counter);
                        Debug.WriteLine($"++++++++ {nameof(_44166NavContent)} constructor, {Counter} allocated");
 
-                       var goButton = new Button { Text = "Back" };
+                       var goButton = new Button { Text = "Previous", AutomationId = "Previous" };
                        goButton.Clicked += (sender, args) => Application.Current.MainPage = new Bugzilla44166();
 
                        Content = new StackLayout