diff options
author | E.Z. Hart <hartez@users.noreply.github.com> | 2016-05-11 08:21:41 -0600 |
---|---|---|
committer | kingces95 <kingces95@users.noreply.github.com> | 2016-05-11 07:21:41 -0700 |
commit | 846c1dc0ecb70920f15f4884b69396cc52ba3e96 (patch) | |
tree | 5c99c116418e36ada4c72cdc8ee9cc0ac1fad9c1 /Xamarin.Forms.Core.iOS.UITests | |
parent | ad3a6f68f009555387847efc37b324187b24212a (diff) | |
download | xamarin-forms-846c1dc0ecb70920f15f4884b69396cc52ba3e96.tar.gz xamarin-forms-846c1dc0ecb70920f15f4884b69396cc52ba3e96.tar.bz2 xamarin-forms-846c1dc0ecb70920f15f4884b69396cc52ba3e96.zip |
Make RunningApp.Screenshot do nothing unless SCREENSHOTS symbol defined (#169)
* Make RunningApp.Screenshot do nothing unless SCREENSHOTS symbol is defined
* Replace IApp casts with conditional compilation directives
* Fix warning
* Remove EnableLocalScreenshots
* Add Ignore attributes to keep tests from "failing" in Test Cloud
Diffstat (limited to 'Xamarin.Forms.Core.iOS.UITests')
11 files changed, 173 insertions, 185 deletions
diff --git a/Xamarin.Forms.Core.iOS.UITests/BaseTestFixture.cs b/Xamarin.Forms.Core.iOS.UITests/BaseTestFixture.cs index 36f3977b..66d19ee0 100644 --- a/Xamarin.Forms.Core.iOS.UITests/BaseTestFixture.cs +++ b/Xamarin.Forms.Core.iOS.UITests/BaseTestFixture.cs @@ -5,7 +5,7 @@ using System.Text; using System.Threading.Tasks; using NUnit.Framework; - +using Xamarin.Forms.Controls; using Xamarin.UITest; using Xamarin.UITest.Queries; @@ -70,7 +70,9 @@ namespace Xamarin.Forms.Core.UITests // if at first you dont succeed RunningApp.Restart (); } - App = RunningApp.App; + + // Wrap the app in ScreenshotConditional so it only takes screenshots if the SCREENSHOTS symbol is specified + App = new ScreenshotConditionalApp(RunningApp.App); App.SetOrientationPortrait (); ScreenBounds = App.RootViewRect (); diff --git a/Xamarin.Forms.Core.iOS.UITests/Remotes/BaseViewContainerRemote.cs b/Xamarin.Forms.Core.iOS.UITests/Remotes/BaseViewContainerRemote.cs index 5b47297d..1c9d6c49 100644 --- a/Xamarin.Forms.Core.iOS.UITests/Remotes/BaseViewContainerRemote.cs +++ b/Xamarin.Forms.Core.iOS.UITests/Remotes/BaseViewContainerRemote.cs @@ -136,9 +136,9 @@ namespace Xamarin.Forms.Core.UITests bool found = false; bool isEdgeCase = false; - if (App is AndroidApp && formProperty == View.ScaleProperty) - isEdgeCase = true; - +#if __ANDROID__ + isEdgeCase = (formProperty == View.ScaleProperty); +#endif if (!isEdgeCase) { found = MaybeGetProperty<string> (App, query, propertyPath, out prop) || @@ -147,8 +147,8 @@ namespace Xamarin.Forms.Core.UITests MaybeGetProperty<object> (App, query, propertyPath, out prop); } - - if (App is AndroidApp && formProperty == View.ScaleProperty) { +#if __ANDROID__ + if (formProperty == View.ScaleProperty) { var matrix = new Matrix (); matrix.M00 = App.Query (q => q.Raw (query).Invoke (propertyPath[0]).Value<float> ()).First (); matrix.M11 = App.Query (q => q.Raw (query).Invoke (propertyPath[1]).Value<float> ()).First (); @@ -156,6 +156,7 @@ namespace Xamarin.Forms.Core.UITests matrix.M33 = 1.0f; return (T)((object)matrix); } +#endif if (!found || prop == null) { throw new NullReferenceException ("null property"); @@ -170,24 +171,22 @@ namespace Xamarin.Forms.Core.UITests } if (typeof(T) == typeof(Color)) { - if (App is iOSApp) { - Color color = ParsingUtils.ParseUIColor ((string)prop); - return (T)((object)color); - } else { - uint intColor = (uint)((float)prop); - Color color = Color.FromUint (intColor); - return (T)((object)color); - } +#if __IOS__ + Color color = ParsingUtils.ParseUIColor ((string)prop); + return (T)((object)color); +#else + uint intColor = (uint)((float)prop); + Color color = Color.FromUint (intColor); + return (T)((object)color); +#endif } +#if __IOS__ if (prop.GetType () == typeof (string) && typeof(T) == typeof(Font)) { - if (App is iOSApp) { - Font font = ParsingUtils.ParseUIFont ((string)prop); - return (T)((object)font); - } else { - - } + Font font = ParsingUtils.ParseUIFont ((string)prop); + return (T)((object)font); } +#endif T result = default(T); diff --git a/Xamarin.Forms.Core.iOS.UITests/Tests/ButtonUITests.cs b/Xamarin.Forms.Core.iOS.UITests/Tests/ButtonUITests.cs index 5ae8f506..47bb45cb 100644 --- a/Xamarin.Forms.Core.iOS.UITests/Tests/ButtonUITests.cs +++ b/Xamarin.Forms.Core.iOS.UITests/Tests/ButtonUITests.cs @@ -64,11 +64,11 @@ namespace Xamarin.Forms.Core.UITests var remote = new ViewContainerRemote (App, Test.Button.BorderRadius, PlatformViewType); remote.GoTo (); - if (App is iOSApp) { - var borderRadius = remote.GetProperty<float> (Button.BorderRadiusProperty); - Assert.AreEqual (20.0f, borderRadius); - } - +#if __IOS__ + var borderRadius = remote.GetProperty<float> (Button.BorderRadiusProperty); + Assert.AreEqual (20.0f, borderRadius); +#endif + } [Test] @@ -79,10 +79,10 @@ namespace Xamarin.Forms.Core.UITests var remote = new ViewContainerRemote (App, Test.Button.BorderWidth, PlatformViewType); remote.GoTo (); - if (App is iOSApp) { - var borderWidth = remote.GetProperty<float> (Button.BorderWidthProperty); +#if __IOS__ + var borderWidth = remote.GetProperty<float> (Button.BorderWidthProperty); Assert.AreEqual (15.0f, borderWidth); - } +#endif } @@ -124,14 +124,13 @@ namespace Xamarin.Forms.Core.UITests var remote = new ViewContainerRemote (App, Test.Button.Font, PlatformViewType); remote.GoTo (); - if (App is AndroidApp) { - var isBold = remote.GetProperty<bool> (Button.FontProperty); - Assert.True (isBold); - } else { - var font = remote.GetProperty<Font> (Button.FontProperty); - Assert.True (font.FontAttributes.HasFlag (FontAttributes.Bold)); - } - +#if __ANDROID__ + var isBold = remote.GetProperty<bool> (Button.FontProperty); + Assert.True (isBold); +#else + var font = remote.GetProperty<Font> (Button.FontProperty); + Assert.True (font.FontAttributes.HasFlag (FontAttributes.Bold)); +#endif } [Test] @@ -155,19 +154,20 @@ namespace Xamarin.Forms.Core.UITests Assert.AreEqual ("Text", buttonText); } + //TODO iOS + +#if __ANDROID__ [Test] [UiTest (typeof (Button), "TextColor")] public void TextColor () { - //TODO iOS - if (App is AndroidApp) { - var remote = new ViewContainerRemote (App, Test.Button.TextColor, PlatformViewType); - remote.GoTo (); + var remote = new ViewContainerRemote (App, Test.Button.TextColor, PlatformViewType); + remote.GoTo (); - var buttonTextColor = remote.GetProperty<Color> (Button.TextColorProperty); - Assert.AreEqual (Color.Pink, buttonTextColor); - } + var buttonTextColor = remote.GetProperty<Color> (Button.TextColorProperty); + Assert.AreEqual (Color.Pink, buttonTextColor); } +#endif protected override void FixtureTeardown () { diff --git a/Xamarin.Forms.Core.iOS.UITests/Tests/ContextActionsUITests.cs b/Xamarin.Forms.Core.iOS.UITests/Tests/ContextActionsUITests.cs index 7691dd46..fc80937f 100644 --- a/Xamarin.Forms.Core.iOS.UITests/Tests/ContextActionsUITests.cs +++ b/Xamarin.Forms.Core.iOS.UITests/Tests/ContextActionsUITests.cs @@ -31,58 +31,56 @@ namespace Xamarin.Forms.Core.UITests const string clear = "Clear Items"; const string mark = "Mark"; + +#if __ANDROID__ [Test] public void ContextActionsShow () { - if (App is AndroidApp) { - // mark is an icon on android - App.TouchAndHold (q => q.Marked (cell0)); - App.WaitForElement (q => q.Marked (delete)); - App.Screenshot ("I have actions!"); - } else if (App is iOSApp) { - Assert.Inconclusive ("Not tested on iOS yet"); - } + // mark is an icon on android + App.TouchAndHold (q => q.Marked (cell0)); + App.WaitForElement (q => q.Marked (delete)); + App.Screenshot ("I have actions!"); } [Test] public void ContextActionsDelete () { - if (App is AndroidApp) { - // mark is an icon on android - App.TouchAndHold (q => q.Marked (cell0)); - App.WaitForElement (q => q.Marked (delete)); - App.Screenshot ("I have actions!"); - - App.Tap (q => q.Marked (delete)); - App.WaitForNoElement (q => q.Marked (cell0)); - App.Screenshot ("Deleted cell 0"); - - } else if (App is iOSApp) { - Assert.Inconclusive ("Not tested on iOS yet"); - } + // mark is an icon on android + App.TouchAndHold (q => q.Marked (cell0)); + App.WaitForElement (q => q.Marked (delete)); + App.Screenshot ("I have actions!"); + + App.Tap (q => q.Marked (delete)); + App.WaitForNoElement (q => q.Marked (cell0)); + App.Screenshot ("Deleted cell 0"); } +#endif +#if __IOS__ [Test] public void PopoverDismiss() { - if (App is iOSApp) { - var app = ((iOSApp)App); - if (app.Device.IsTablet) { - var screenBounds = App.Query (PlatformQueries.Root)[0].Rect; - var cellBounds = App.Query (q => q.Marked (cell0))[0].Rect; - App.DragCoordinates (screenBounds.Width - 10, cellBounds.CenterY, 10, cellBounds.CenterY); - App.Screenshot("I see context actions"); - App.Tap (q => q.Marked ("More")); - App.Screenshot ("Should see Popover"); - App.TapCoordinates (50, 50); - App.Screenshot ("I should not crash"); - } else { - Assert.Inconclusive("Not testing iOS Phone"); - } + var device = App.Device as iOSDevice; + + if (device == null) + { + return; + } + + if (device.IsTablet) { + var screenBounds = App.Query (PlatformQueries.Root)[0].Rect; + var cellBounds = App.Query (q => q.Marked (cell0))[0].Rect; + App.DragCoordinates (screenBounds.Width - 10, cellBounds.CenterY, 10, cellBounds.CenterY); + App.Screenshot("I see context actions"); + App.Tap (q => q.Marked ("More")); + App.Screenshot ("Should see Popover"); + App.TapCoordinates (50, 50); + App.Screenshot ("I should not crash"); } else { - Assert.Inconclusive ("Not testing on Android"); + Assert.Inconclusive("Not testing iOS Phone"); } } +#endif } [TestFixture] @@ -107,23 +105,20 @@ namespace Xamarin.Forms.Core.UITests const string mark = "Mark"; const string cellWithNoContextActions = "I have no ContextActions"; +#if __ANDROID__ [Test] public void ContextActionsShowAndReset () { - if (App is AndroidApp) { - // mark is an icon on android - App.TouchAndHold (q => q.Marked (cell0)); - App.WaitForElement (q => q.Marked (delete)); - App.Screenshot ("I have actions!"); + // mark is an icon on android + App.TouchAndHold (q => q.Marked (cell0)); + App.WaitForElement (q => q.Marked (delete)); + App.Screenshot ("I have actions!"); - App.Tap (q => q.Marked (cellWithNoContextActions)); - App.WaitForNoElement (q => q.Marked (delete)); - App.Screenshot ("Actions should be gone"); - - } else if (App is iOSApp) { - Assert.Inconclusive ("Not tested on iOS yet"); - } + App.Tap (q => q.Marked (cellWithNoContextActions)); + App.WaitForNoElement (q => q.Marked (delete)); + App.Screenshot ("Actions should be gone"); } +#endif } } diff --git a/Xamarin.Forms.Core.iOS.UITests/Tests/EntryUITests.cs b/Xamarin.Forms.Core.iOS.UITests/Tests/EntryUITests.cs index 45b73374..6d498b59 100644 --- a/Xamarin.Forms.Core.iOS.UITests/Tests/EntryUITests.cs +++ b/Xamarin.Forms.Core.iOS.UITests/Tests/EntryUITests.cs @@ -53,11 +53,7 @@ namespace Xamarin.Forms.Core.UITests App.EnterText (q=> q.Raw (remote.ViewQuery), "Test"); - if (App is AndroidApp) { - ((AndroidApp)App).PressUserAction (UserAction.Done); - } else { - App.PressEnter (); - } + App.PressEnter (); var eventLabelText = remote.GetEventLabel ().Text; Assert.AreEqual (eventLabelText, "Event: Completed (fired 1)"); diff --git a/Xamarin.Forms.Core.iOS.UITests/Tests/Legacy-CellsUITests.cs b/Xamarin.Forms.Core.iOS.UITests/Tests/Legacy-CellsUITests.cs index 77daff1f..d143b414 100644 --- a/Xamarin.Forms.Core.iOS.UITests/Tests/Legacy-CellsUITests.cs +++ b/Xamarin.Forms.Core.iOS.UITests/Tests/Legacy-CellsUITests.cs @@ -248,11 +248,8 @@ namespace Xamarin.Forms.Core.UITests App.Tap (PlatformQueries.EntryCellWithPlaceholder ("I am a placeholder")); App.EnterText (PlatformQueries.EntryCellWithPlaceholder ("I am a placeholder"), "Hi"); App.Screenshot ("Entered Text"); - if (App is AndroidApp) { - ((AndroidApp)App).PressUserAction (UserAction.Done); - } else { - App.PressEnter (); - } + App.PressEnter (); + App.WaitForElement (q => q.Marked ("Entered: 1")); App.Screenshot ("Completed should have changed label's text"); } diff --git a/Xamarin.Forms.Core.iOS.UITests/Tests/RootGalleryUITests.cs b/Xamarin.Forms.Core.iOS.UITests/Tests/RootGalleryUITests.cs index 764c3a69..e597809f 100644 --- a/Xamarin.Forms.Core.iOS.UITests/Tests/RootGalleryUITests.cs +++ b/Xamarin.Forms.Core.iOS.UITests/Tests/RootGalleryUITests.cs @@ -78,8 +78,15 @@ namespace Xamarin.Forms.Core.UITests var scrollViewArea = App.Query (q => q.Marked ("ChoosePageScrollView")).First ().Rect; App.ScrollForElement (string.Format("* marked:'{0}'", page.ButtonId), new Drag (scrollViewArea, Drag.Direction.BottomToTop, Drag.DragLength.Long)); App.Tap (q => q.Marked (page.ButtonId)); - if(!page.IsModal || App is iOSApp) + + var ios = false; +#if __IOS__ + ios = true; +#endif + + if (!page.IsModal || ios) App.WaitForElement (q => q.Marked (page.PageId)); + App.Screenshot ("Page: " + page.PageId); } } diff --git a/Xamarin.Forms.Core.iOS.UITests/Tests/ToolbarItemTests.cs b/Xamarin.Forms.Core.iOS.UITests/Tests/ToolbarItemTests.cs index 522cd4b6..eddc20c2 100644 --- a/Xamarin.Forms.Core.iOS.UITests/Tests/ToolbarItemTests.cs +++ b/Xamarin.Forms.Core.iOS.UITests/Tests/ToolbarItemTests.cs @@ -12,32 +12,35 @@ namespace Xamarin.Forms.Core.UITests { string btn1Id = "tb1"; string btn4Id = "tb4"; - +#if __ANDROID__ static bool isSecondaryMenuOpen = false; +#endif static void ShouldShowMenu () { - if (App is AndroidApp) { - isSecondaryMenuOpen = true; - //show secondary menu - App.Tap (c => c.Class ("android.support.v7.widget.ActionMenuPresenter$OverflowMenuButton")); - } +#if __ANDROID__ + isSecondaryMenuOpen = true; + //show secondary menu + App.Tap (c => c.Class ("android.support.v7.widget.ActionMenuPresenter$OverflowMenuButton")); +#endif } static void ShouldHideMenu () { - if (App is AndroidApp && isSecondaryMenuOpen) { +#if __ANDROID__ + if (isSecondaryMenuOpen) { isSecondaryMenuOpen = false; App.Back (); } +#endif } protected override void NavigateToGallery () { App.NavigateToGallery (GalleryQueries.ToolbarItemGallery); - if (App is iOSApp) { - btn1Id = "menuIcon"; - btn4Id = "tb4"; - } +#if __IOS__ + btn1Id = "menuIcon"; + btn4Id = "tb4"; +#endif } [Test] @@ -51,12 +54,11 @@ namespace Xamarin.Forms.Core.UITests public void ToolbarButtonsCommand () { ShouldShowMenu (); - if (App is AndroidApp) { - //App.Query (c => c.Marked (btn4Id))[0]; - } - else { - App.Tap (c => c.Marked (btn4Id)); - } +#if __ANDROID__ + //App.Query (c => c.Marked (btn4Id))[0]; +#else + App.Tap (c => c.Marked (btn4Id)); +#endif } [Test] @@ -93,8 +95,9 @@ namespace Xamarin.Forms.Core.UITests var btn1 = App.Query (c => c.Marked (btn1Id)) [0]; ShouldShowMenu (); var btn2 = App.Query (c => c.Marked ("tb4")) [0]; - if(App is iOSApp) - Assert.True (btn1.Rect.CenterY < btn2.Rect.CenterY); +#if __IOS__ + Assert.True (btn1.Rect.CenterY < btn2.Rect.CenterY); +#endif } } diff --git a/Xamarin.Forms.Core.iOS.UITests/Tests/ViewUITests.cs b/Xamarin.Forms.Core.iOS.UITests/Tests/ViewUITests.cs index 9d6f08f6..7cfbe550 100644 --- a/Xamarin.Forms.Core.iOS.UITests/Tests/ViewUITests.cs +++ b/Xamarin.Forms.Core.iOS.UITests/Tests/ViewUITests.cs @@ -20,20 +20,7 @@ namespace Xamarin.Forms.Core.UITests //[UiTest (Test.VisualElement.AnchorX)] public virtual void _AnchorX () { - //var remote = RemoteFactory.CreateRemote<StateViewContainerRemote> (App, "AnchorX", PlatformViewType); - //remote.GoTo (); - - ////App.LogPropertiesForView (remote.ViewQuery, true); - - //if (App is AndroidApp) { - // var anchorX = remote.GetProperty<float> (View.AnchorXProperty); - // var viewWidth = remote.GetView ().Rect.Width; - // Assert.AreEqual (anchorX, 0.25 * viewWidth); - //} else if (App is iOSApp) { - // var anchorXMatrix = remote.GetProperty<Matrix> (View.AnchorXProperty); - // var viewWidth = remote.GetView ().Rect.Width; - // Assert.AreEqual (anchorXMatrix.M30, 0 - (viewWidth * 0.25f)); - //} + } // [Test] @@ -41,18 +28,7 @@ namespace Xamarin.Forms.Core.UITests // TODO: working on some views, others not public virtual void _AnchorY () { - //var remote = RemoteFactory.CreateRemote<StateViewContainerRemote> (App, "AnchorY", PlatformViewType); - //remote.GoTo (); - - //if (App is AndroidApp) { - // var anchorY = remote.GetProperty<float> (View.AnchorYProperty); - // var viewHeight = remote.GetView ().Rect.Height; - // Assert.AreEqual (anchorY, viewHeight); - //} else if (App is iOSApp) { - // var anchorYMatrix = remote.GetProperty<Matrix> (View.AnchorYProperty); - // var viewHeight = remote.GetView ().Rect.Height; - // Assert.AreEqual (anchorYMatrix.M31, viewHeight / 2.0f); - //} + } // [Test] @@ -175,16 +151,17 @@ namespace Xamarin.Forms.Core.UITests { var remote = new ViewContainerRemote (App, Test.VisualElement.Rotation, PlatformViewType); remote.GoTo (); - - if (App is AndroidApp) { - var rotation = remote.GetProperty<float> (View.RotationProperty); - Assert.AreEqual (10.0f, rotation); - } else if (App is iOSApp) { - var rotationMatrix = remote.GetProperty<Matrix> (View.RotationProperty); - Matrix generatedMatrix = NumericExtensions.CalculateRotationMatrixForDegrees (10, Axis.Z); - Assert.AreEqual (generatedMatrix, rotationMatrix); - } - } + +#if __ANDROID__ + var rotation = remote.GetProperty<float> (View.RotationProperty); + Assert.AreEqual (10.0f, rotation); +#endif +#if __IOS__ + var rotationMatrix = remote.GetProperty<Matrix> (View.RotationProperty); + Matrix generatedMatrix = NumericExtensions.CalculateRotationMatrixForDegrees (10, Axis.Z); + Assert.AreEqual (generatedMatrix, rotationMatrix); +#endif +} [Test] [UiTest (typeof (VisualElement), "RotationX")] @@ -193,14 +170,15 @@ namespace Xamarin.Forms.Core.UITests var remote = new ViewContainerRemote (App, Test.VisualElement.RotationX, PlatformViewType); remote.GoTo (); - if (App is AndroidApp) { - var rotationX = remote.GetProperty<float> (View.RotationXProperty); - Assert.AreEqual (33.0f, rotationX); - } else if (App is iOSApp) { - var rotationXMatrix = remote.GetProperty<Matrix> (View.RotationXProperty); - Matrix matrix = NumericExtensions.CalculateRotationMatrixForDegrees (33.0f, Axis.X); - Assert.AreEqual (matrix, rotationXMatrix); - } +#if __ANDROID__ + var rotationX = remote.GetProperty<float> (View.RotationXProperty); + Assert.AreEqual (33.0f, rotationX); +#endif +#if __IOS__ + var rotationXMatrix = remote.GetProperty<Matrix> (View.RotationXProperty); + Matrix matrix = NumericExtensions.CalculateRotationMatrixForDegrees (33.0f, Axis.X); + Assert.AreEqual (matrix, rotationXMatrix); +#endif } [Test] @@ -210,14 +188,15 @@ namespace Xamarin.Forms.Core.UITests var remote = new ViewContainerRemote (App, Test.VisualElement.RotationY, PlatformViewType); remote.GoTo (); - if (App is AndroidApp) { - var rotationY = remote.GetProperty<float> (View.RotationYProperty); - Assert.AreEqual (10.0f, rotationY); - } else if (App is iOSApp) { - var rotationYMatrix = remote.GetProperty<Matrix> (View.RotationYProperty); - Matrix matrix = NumericExtensions.CalculateRotationMatrixForDegrees (10.0f, Axis.Y); - Assert.AreEqual (matrix, rotationYMatrix); - } +#if __ANDROID__ + var rotationY = remote.GetProperty<float> (View.RotationYProperty); + Assert.AreEqual (10.0f, rotationY); +#endif +#if __IOS__ + var rotationYMatrix = remote.GetProperty<Matrix> (View.RotationYProperty); + Matrix matrix = NumericExtensions.CalculateRotationMatrixForDegrees (10.0f, Axis.Y); + Assert.AreEqual (matrix, rotationYMatrix); +#endif } [Test] diff --git a/Xamarin.Forms.Core.iOS.UITests/Tests/WebViewUITests.cs b/Xamarin.Forms.Core.iOS.UITests/Tests/WebViewUITests.cs index d4233cba..c52693a0 100644 --- a/Xamarin.Forms.Core.iOS.UITests/Tests/WebViewUITests.cs +++ b/Xamarin.Forms.Core.iOS.UITests/Tests/WebViewUITests.cs @@ -38,6 +38,7 @@ namespace Xamarin.Forms.Core.UITests [Test] [Category ("ManualReview")] + [Ignore("Keep empty test from failing in Test Cloud")] public override void _IsVisible () {} [UiTestExempt (ExemptReason.CannotTest, "Invalid interaction with Label")] @@ -51,31 +52,38 @@ namespace Xamarin.Forms.Core.UITests [Test] [Category ("ManualReview")] + [Ignore("Keep empty test from failing in Test Cloud")] public override void _Opacity () {} [Test] [Category ("ManualReview")] + [Ignore("Keep empty test from failing in Test Cloud")] public override void _Rotation () {} [Test] [Category ("ManualReview")] + [Ignore("Keep empty test from failing in Test Cloud")] public override void _RotationX () {} [Test] [Category ("ManualReview")] + [Ignore("Keep empty test from failing in Test Cloud")] public override void _RotationY () {} [Test] [Category ("ManualReview")] + [Ignore("Keep empty test from failing in Test Cloud")] public override void _TranslationX () {} [Test] [Category ("ManualReview")] + [Ignore("Keep empty test from failing in Test Cloud")] public override void _TranslationY () {} [Test] [Category ("ManualReview")] + [Ignore("Keep empty test from failing in Test Cloud")] public override void _Scale () {} [UiTestExempt (ExemptReason.CannotTest, "Invalid interaction with Label")] diff --git a/Xamarin.Forms.Core.iOS.UITests/Utilities/ViewInspector.cs b/Xamarin.Forms.Core.iOS.UITests/Utilities/ViewInspector.cs index c7eee049..9bc5347b 100644 --- a/Xamarin.Forms.Core.iOS.UITests/Utilities/ViewInspector.cs +++ b/Xamarin.Forms.Core.iOS.UITests/Utilities/ViewInspector.cs @@ -12,15 +12,17 @@ namespace Xamarin.Forms.Core.UITests { public static void LogPropertiesForView (this IApp app, string query, bool isOnParent = false) { - if (app is AndroidApp) { - LogPropertiesForAndroidView ((AndroidApp)app, query, isOnParent); - } else { - LogPropertiesForUIView ((iOSApp)app, query, isOnParent); - LogPropertiesForCALayer ((iOSApp)app, query, isOnParent); - } - } +#if __ANDROID__ + LogPropertiesForAndroidView (app, query, isOnParent); +#endif +#if __IOS__ - static void LogPropertiesForUIView (this iOSApp app, string query, bool isOnParent = false) { + LogPropertiesForUIView(app, query, isOnParent); + LogPropertiesForCALayer (app, query, isOnParent); +#endif + } + + static void LogPropertiesForUIView (this IApp app, string query, bool isOnParent = false) { //Logger.LogLine ("--- UIView Properties ---"); @@ -75,7 +77,7 @@ namespace Xamarin.Forms.Core.UITests } - static void LogPropertiesForCALayer(this iOSApp app, string query, bool isOnParent = false) + static void LogPropertiesForCALayer(this IApp app, string query, bool isOnParent = false) { // Logger.LogLine ("--- UIView.Layer Properties ---"); @@ -150,7 +152,7 @@ namespace Xamarin.Forms.Core.UITests } - static void LogPropertiesForAndroidView (this AndroidApp app, string query, bool isOnParent = false) + static void LogPropertiesForAndroidView (this IApp app, string query, bool isOnParent = false) { // Logger.LogLine( "--- Android View Properties ---"); @@ -317,7 +319,7 @@ namespace Xamarin.Forms.Core.UITests } - static bool MaybeGetLayerProperty<T> (iOSApp app, string query, string property, out object result) + static bool MaybeGetLayerProperty<T> (IApp app, string query, string property, out object result) { try { |