From 004197380ae45d394fcf3b0e8cc53ab840135433 Mon Sep 17 00:00:00 2001 From: Rui Marinho Date: Fri, 27 Jan 2017 12:52:38 +0000 Subject: Add MacOS gallery and UITest (#721) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [MacOS] Cleanup * [Controls] Add Header support to ListView * [MacOS] NSView reuse on NSTableView * [MacOS] Some fix on layour order * [MacOS] Add CarouselPageRenderer * [MacOS] Implement EventTracker on PageRenderer * [MacOS] Cleanup CarouselPageRenderer * [MacOS] Add MasterDetailPage renderer * [MacOS] MDP renderer don't allow drag of splitter * [MacOS] Add TabbedPage renderer * [MacOS] Initial sketch of NavigationPageRenderer * [MacOS] Send disappearing of CurrentPage on Dispose on NavigationPageRenderer * [MacOS] Add Gallery page for Mac * [MacOS] Add MacOSExpressionSearch * [MacOS] Fix ColorExtension * [MacOS] Fix MDP renderer layout * [MacOS] Implement native selection on ListViewRenderer * [MacOS] Deselect a item on NSTableView * [MacOS] Remove previous SplitViewItems * [MacOS] Fix navigationpage height * [MacOS] Add toolbar for NavigationPageRenderer * [MacOS] Don't remove selection for now (crashing) * [MacOS] Refactor page and back button title on NavigationPageRenderer * [MacOS] Fix bug when native navigate back * [MacOS] Hide layer when transition * [MacOS] ListviewRenderer fix BbackgroundColor * [MacOS] Fix background on ScrollViewRenderer * [MacOS] Fix header measure on ListViewRenderer * [MacOS] Add Mac twitter demo * [Controls] Spaces for easy reading * [MacOS] More xaml cleanup * [Core] Add Mac as aTargetPlatform * [MacOS] Add alerts and actionsheets * [MacOS] Add GestureRecognizers * [MacOS] Fix Layout issues when adding children, enable transformations * [MacOS] Fix title on tab item, move to tabbed navigation based on segmented control * [MacOS] Hide toolbar when not needed, this allows to work with tabbed page, cleanup * [MacOS] Add NativeBindings and NativeViewWrapper * [MacOS] Fix AssemblyInfo * [MacOS] FIX NRE on SetBackgroundColor BoxView * [MacOS] Fix NavigationPageRenderer * [MacOS] Fix build * [MacOS] Also update page when it resizes * [MacOS] Add LayoutRenderer for handle items position when the bounds change. * [MacOS] Refactor/Cleanup * [MacOS] Add toolbar items support to NavigationPage * [MacOS] Resize images for TabViewITems * [MacOS] Fix TabbedPage resize issues , allow users to override some features when creating TVI * [MacOS] Fix hide/show Navigation toolbar * [MacOS] Redo CarouselPageRenderer with NSPageController * [MacOS] Add support for Modal pages * [MacOS] Refactor navigation from platform * [Nuget] Add nuget for MacOS * [Nuget]Fix nuspec * [Nuget] Add variables for CI * [Controls] Remove MainMenu from MacOS * [MacOS] Add TableView renderer (no headers yet) * [MacOS] Refactoring, marking extensions as internal * [MacOS] Add group headers for TableViewRenderer * [MacOS] Workaround for updates on listview collection * [MacOS] Handle updates of rows in the ListViewRenderer properly * [MacOS] Fix navigation animation * Fix navigation header issues with modal pages * [MacOS] Fix MDP issues with resizing * [MacOS] Fix general dispose * [MacOS] Add a ViewControllerWrapper for NSSplitView * [MacOS] MDP renderer fix animation * [MacOS] Fix ListView selection bug * [MacOS] Fix rendering MDP Layout inside wrappers * [MacOS] Re write the MainToolbar handler * [MacOS] Don't use Sierra new extensions so we can run in stable channel * [MacOS] Another way to hide the toolbar (smarter i think) * [MacOS] Fix MDP bug and remove debug color * [Controls] Add HanselForms sample * [MacOS] Fix NRE WebviewRenderer * [MacOS] Fix uneven rows on ListView renderer * [MacOS] Fix NRE on load (can+t find the reason this happens) * [MacOS] Fix uneven rows * [MacOS] Fix header sizing on ListViewRenderer * [Controls] More stuff on HanselForms * [MacOS] Remove warning from ListViewRenderer * [MacOS] Fix PageRenderer bug double init * [MacOS] Don't calculate height if RowHeight is provided * [Controls] More Hanselforms stuff * [MacOS] Once again a new implementation for the NavigationBar, this time using a custom view to support BackgroundColor * [MacOS] Fix build * [MacOS] Refactoring AwesomeBar related controls * Fix build * [MacOS] NavigationBar update background and t test colors * [MacOS] Fix when we remove navigation so it works when the NavigationRenderer wasn't removed from the parent controller like in a TabbedPage * [MacOS] Add support for ListView grouping * [MacOS] Fix image extension method. * [MacOS] Add base Maps project * [MacOS] Export MapRenderer * [MacOS] Add pin click and geocoderbacked for Maps * [MacOS] Add extra binding project for API not in stable. * [MacOS] Add MacOS Maps lib * [MacOS]Fix build on alpha * [MacOS] Remove MacOS Maps extra binding * [UITest] Basic macOS setup * [UITest] Add MacOSApp wrapper implementation * [MacOS] Set AutomationID * [UITests] Add ActionSheetUITests to MacOS UITest * [MacOS] Fix bug on Picker * [UITests] Link basic uitest basefixture and related files * [MacOS] Fix pickers reuse * [UItests] Fix MacOS app path * [UITest] Ignore UItest for appearing on macOS for now * [UITest] Update macOS for 2.0.3 * [UITest] Refactor EnterText MacOS app * [UITest]Fix ViewQuery on MacOS * [UITest]Fix IsEnabled UItest on macOS * [UITest] Implement Enter, mark some tests inconclusive fix others * [MacOS] Implement Entry Completed event * [UITests] Fix UITest for IsVisible, ignore ToolbarItem test for now * [UITests] Fix ISVisible again add extra category * [Controls] Cleanup macOS gallery * [MacOS] Fix Assembly info * [Docs] Fix docs * Fix build * [Nuget] Fix nuspec * [Controls] Link files on MacOS * [Core] Update Forms stack before firing a event saying page was removed, possible breaking change * [MacOS] Implement RemovePage on NavigationPAgeRenderer * [UItest] Ignore some , implement back on MacOS UITest app * [MacOS] Add default back button name (needs to be translated) * [MacOS] Fix dispose * [UITest] Make 29257 work on MacOS * [MacOS] Rename stuff * [MacOS] More renaming and cleanup * [MacOS] Share implementations for iOS * [MacOS] Reuse more IOS extensions * [MacOS] Reuse FontExtensions * [MacOS] Share NativeViewWrapper related stuff * [MAcOS] Share event args and ExportRenderer * [MacOS] Share platform effect * [MacOS] Fix build * [Docs]Fixing docs * [MacOS] Fix ViewCell reuse * [Core] Support ListView CachingStrategy on MacOS * [MacOS] Fix issues with TextCell and ImageCell (we can’t set null to a NSControl value) * [MacOS] Fix MDP child sizing bug [UITest] Query marked by id and text * [MacOS] Comment test related with context actions * [MacOS] Implement missing stuff on ticker * [MacOS] Make sure VisualElemenTracker calls the ticker update * [UITests]Ignore context actions and not possible to test * [MacOS] Fix Grouping bug on Listview * [MacOS] Fix selection on Listview when using grouping * [MacOS] Update navbar when page is popped * [MacOS] Cleanup NavigationBar * [Controls] More info on exceptions * [MacOS] Fix bug animation pop modal * [MacOS] Bring back BackgroundColor of NavigationBar * [MacOS] Fix UITest animation delay * [MacOS] Treat warnings as errors * [MacOS] Center title on toolbar * [Core] Add Platform configuration specific for MacOS * [MacOS] Implement TabbedPage platform specific to handle TabItems on NavigationPage bar * [MacOS] Fix warning * [MacOS] Fix bug on SearchBar color * [MacOS]Fix build * [MacOS] remove extra dll from maps * [Docs] Update docs * [MacOS]Cleanup and refactoring * Revert "[MacOS] remove extra dll from maps" This reverts commit 73b948937001fea3f28449a963d0b94943e07aa0. * [MacOS] Fix wrong refactoring * [MacOS] dix formatting * [MacOS] Fix build * [MacOS] Fix bug on TabbedPageRenderer no title * [MacOS,UITest] Update packages * [MacOS ,UITest] Add delay when tapping something, and focus with double click * [MacOS,UITest] Ignore UITest, not possible to test with current version * [MacOS,UITest] Ignore test that uses Frame, UITest doesn’t return it * [MacOS] Fix bug when no title on toolbar items * [MacOS] Remove FormsNSView * [MacOS] Cleanup on dispose on MDP renderer * [MacOS] Different way to test leak of MDP, need to look at this again after * [MacOS] Update current page when source changes * [MacOS] More cleanup * [MacOS,UITest] Implement ClearText * [MacOS,UITest] ClearText doesn’t work for now on MacOS uitest * [MacOS] Make sure we show the previous page when popping a Modal * [MacOS] Fix issue with sizing the Header and visibility, remove for now header renderer reuse * [MacOS] Clean CustomNSTableView * [MacOS] Share LabelRenderer with iOS * [MacOS,UITest] Don’t try to scroll for the element * [MacOS] Share ResourcesProvider with iOS * [MAcoS] Share VisualElementPackager with iOS * [MacOS] Share ViewRenderer with iOS * [MacOS] Merge with VisualElementTracker from iOS * [MacOS] Merge with EventTracker from iOS * [MacOS] Merge with VisualElementRenderer of iOS * [MacOS] Make sure we always have a layer * [MacOS] Fix Tracker merge with iOS version * [MacOS] Fix bug with tabbed page on modal without navigation * [Core] Rever change on core * [Controls] Add missing image * [MacOS] Clear renderers before setting them MDP * [MacOS] Update tabbedPage ContainerArea * [Controls] Add Custom renderers tests * [MacOS] Fix ListViewRenderer * [MacOS,UITest] Refactoring, implement index * [MacOS] Make sure we don’t pass null to TextField string value * [MacOS] Support for multiple clicks in same selected item on NSTableView * [MacOS, UITest] Fix bug on Back because of refactoring * [MacOS,UITest] Ignore UITest because we’d-not have ScrollDownTo yet * [MacOS] Support Focus on EntryRenderer * [MacOS,UITest] Ignore more a couple of tests that we can’t test on UITest Desktop * [MacOS,UITest] MacOSApp looks for StaticText fields too * [MacOS, UITest] Fix EnterText for marked Entry * [MacOS] Fix index bug on TablevIewDataSource * [MacOS] Fix SelectedItem TableViewDataSource * [Nuget] Add Mac to Maps nuspec * [Nuget]Fix path * [Controls] Add basic FormsGallery sample * [macOS] Fixed Tab NSImage crash in TabbedPageRenderer (#705) * [macOS] Fixed Tab NSImage crash in TabbedPageRenderer * Coding Style * Coding Style * [MacOS] Fix previous merge with master * [MacOS] Possible simple fix for click on views overlapping * [UItest] Ignore this part of the test we can’t click on NSViews yet * [MacOS] Rename to IsOnViewCell * fix docs * [MacOS] Cleanup, Address feedback from Samantha’s review * [MacOS] Add ContextActions * [Controls] Remove FormsGalery for now * [Docs] Update docs * [MacOS] Implement ContextActions * [MacOS,UITests] Enable and support UITests of ContextActions --- .../Remotes/BaseViewContainerRemote.cs | 46 ++++-- .../Tests/ActionSheetUITests.cs | 164 ++++++++++----------- .../Tests/ActivityIndicatorUITests.cs | 9 +- .../Tests/AppearingUITests.cs | 3 + .../Tests/AutomationIDUITests.cs | 4 +- .../Tests/BoxViewUITests.cs | 3 + .../Tests/ButtonUITests.cs | 2 + .../Tests/ContextActionsUITests.cs | 5 +- .../Tests/FrameUITests.cs | 3 + .../Tests/Legacy-CellsUITests.cs | 3 + .../Tests/ToolbarItemTests.cs | 3 + .../Tests/ViewUITests.cs | 29 ++-- .../Utilities/AppExtensions.cs | 9 -- 13 files changed, 164 insertions(+), 119 deletions(-) (limited to 'Xamarin.Forms.Core.iOS.UITests') diff --git a/Xamarin.Forms.Core.iOS.UITests/Remotes/BaseViewContainerRemote.cs b/Xamarin.Forms.Core.iOS.UITests/Remotes/BaseViewContainerRemote.cs index 1c9d6c49..b0fc8f79 100644 --- a/Xamarin.Forms.Core.iOS.UITests/Remotes/BaseViewContainerRemote.cs +++ b/Xamarin.Forms.Core.iOS.UITests/Remotes/BaseViewContainerRemote.cs @@ -78,11 +78,17 @@ namespace Xamarin.Forms.Core.UITests } - while (true) { + while (true) + { +#if __MACOS__ + var result = App.Query(o => o.Raw(ViewQuery)); +#else var result = App.Query (o => o.Raw(ContainerQuery)); - if (result.Any ()) +#endif + + if (result.Any()) break; - App.Tap (o => o.Raw ("* marked:'MoveNextButton'")); + App.Tap(o => o.Raw("* marked:'MoveNextButton'")); } //Assert.True (App.ScrollForElement ( @@ -139,13 +145,33 @@ namespace Xamarin.Forms.Core.UITests #if __ANDROID__ isEdgeCase = (formProperty == View.ScaleProperty); #endif - if (!isEdgeCase) { - found = - MaybeGetProperty (App, query, propertyPath, out prop) || - MaybeGetProperty (App, query, propertyPath, out prop) || - MaybeGetProperty (App, query, propertyPath, out prop) || - MaybeGetProperty (App, query, propertyPath, out prop); - } + if (!isEdgeCase) + { + found = + MaybeGetProperty(App, query, propertyPath, out prop) || + MaybeGetProperty(App, query, propertyPath, out prop) || + MaybeGetProperty(App, query, propertyPath, out prop) || + MaybeGetProperty(App, query, propertyPath, out prop); + } +#if __MACOS__ + if (!found) + { + + if (formProperty == View.IsEnabledProperty) + { + var view = App.Query((arg) => arg.Raw(query)).FirstOrDefault(); + found = view != null; + prop = view.Enabled; + } + + if (formProperty == Button.TextProperty) + { + var view = App.Query((arg) => arg.Raw(query)).FirstOrDefault(); + found = view != null; + prop = view.Text; + } + } +#endif #if __ANDROID__ if (formProperty == View.ScaleProperty) { diff --git a/Xamarin.Forms.Core.iOS.UITests/Tests/ActionSheetUITests.cs b/Xamarin.Forms.Core.iOS.UITests/Tests/ActionSheetUITests.cs index 0f74d6de..88d280e5 100644 --- a/Xamarin.Forms.Core.iOS.UITests/Tests/ActionSheetUITests.cs +++ b/Xamarin.Forms.Core.iOS.UITests/Tests/ActionSheetUITests.cs @@ -1,7 +1,4 @@ using NUnit.Framework; -using Xamarin.UITest; -using System; -using System.Threading; using Xamarin.UITest.Queries; namespace Xamarin.Forms.Core.UITests @@ -12,158 +9,157 @@ namespace Xamarin.Forms.Core.UITests { AppRect screenSize; - public ActionSheetUITests () + protected override void NavigateToGallery() { - + App.NavigateToGallery(GalleryQueries.ActionSheetGallery); } - protected override void NavigateToGallery () - { - App.NavigateToGallery (GalleryQueries.ActionSheetGallery); - } - - static void CheckExtras () + static void CheckExtras() { App.WaitForElement(c => c.Marked("Extra One")); App.WaitForElement(c => c.Marked("Extra Six")); } - protected override void TestSetup () + protected override void TestSetup() { - base.TestSetup (); - screenSize = App.Query (q => q.Marked ("ActionSheetPage"))[0].Rect; + base.TestSetup(); +#if !__MACOS__ + screenSize = App.Query(q => q.Marked("ActionSheetPage"))[0].Rect; +#endif } [Test] - public void TestDisplayActionSheet () + public void TestDisplayActionSheet() { - ScrollAndTap ("ActionSheet Extras"); - CheckExtras (); - App.Tap (c => c.Marked ("Extra One")); + ScrollAndTap("ActionSheet Extras"); + CheckExtras(); + App.Tap(c => c.Marked("Extra One")); } - + [Test] - public void TestDisplayActionSheetCancel () + public void TestDisplayActionSheetCancel() { - ScrollAndTap ("ActionSheet Cancel"); + ScrollAndTap("ActionSheet Cancel"); // iPad does not have a Cancel button for action sheet - if (App.Query (q => q.Marked ("Cancel")).Length > 0) - App.Tap (c => c.Marked ("Cancel")); + if (App.Query(q => q.Marked("Cancel")).Length > 0) + App.Tap(c => c.Marked("Cancel")); else - App.TapCoordinates (20, screenSize.Height / 2); + App.TapCoordinates(20, screenSize.Height / 2); } [Test] - public void TestDisplayActionSheetCancelDestruction () + public void TestDisplayActionSheetCancelDestruction() { - ScrollAndTap ("ActionSheet Cancel Destruction"); - App.WaitForNoElement (c => c.Marked ("Extra One")); - App.WaitForElement (c => c.Marked ("Destruction")); - if (App.Query (q => q.Marked ("Cancel")).Length > 0) - App.Tap (c => c.Marked ("Cancel")); + ScrollAndTap("ActionSheet Cancel Destruction"); + App.WaitForNoElement(c => c.Marked("Extra One")); + App.WaitForElement(c => c.Marked("Destruction")); + if (App.Query(q => q.Marked("Cancel")).Length > 0) + App.Tap(c => c.Marked("Cancel")); else - App.TapCoordinates (20, screenSize.Height / 2); + App.TapCoordinates(20, screenSize.Height / 2); } [Test] - public void TestDisplayActionSheetCancelExtras () + public void TestDisplayActionSheetCancelExtras() { - ScrollAndTap ("ActionSheet Cancel Extras"); - CheckExtras (); - if (App.Query (q => q.Marked ("Cancel")).Length > 0) - App.Tap (c => c.Marked ("Cancel")); + ScrollAndTap("ActionSheet Cancel Extras"); + CheckExtras(); + if (App.Query(q => q.Marked("Cancel")).Length > 0) + App.Tap(c => c.Marked("Cancel")); else - App.TapCoordinates (20, screenSize.Height / 2); + App.TapCoordinates(20, screenSize.Height / 2); } [Test] - public void TestDisplayActionSheetCancelExtrasDestruction () + public void TestDisplayActionSheetCancelExtrasDestruction() { - ScrollAndTap ("ActionSheet Cancel Destruction Extras"); - CheckExtras (); - App.WaitForElement (c => c.Marked ("Destruction")); - if (App.Query (q => q.Marked ("Cancel")).Length > 0) - App.Tap (c => c.Marked ("Cancel")); + ScrollAndTap("ActionSheet Cancel Destruction Extras"); + CheckExtras(); + App.WaitForElement(c => c.Marked("Destruction")); + if (App.Query(q => q.Marked("Cancel")).Length > 0) + App.Tap(c => c.Marked("Cancel")); else - App.TapCoordinates (20, screenSize.Height / 2); + App.TapCoordinates(20, screenSize.Height / 2); } [Test] - public void TestDisplayActionSheetDestruction () + public void TestDisplayActionSheetDestruction() { - ScrollAndTap ("ActionSheet Destruction"); - App.WaitForNoElement (c => c.Marked ("Extra One")); - App.Tap (c => c.Marked ("Destruction")); + ScrollAndTap("ActionSheet Destruction"); + App.WaitForNoElement(c => c.Marked("Extra One")); + App.Tap(c => c.Marked("Destruction")); } [Test] - public void TestDisplayActionSheetDestructionExtras () + public void TestDisplayActionSheetDestructionExtras() { - ScrollAndTap ("ActionSheet Destruction Extras"); - CheckExtras (); - App.Tap (c => c.Marked ("Extra One")); + ScrollAndTap("ActionSheet Destruction Extras"); + CheckExtras(); + App.Tap(c => c.Marked("Extra One")); } [Test] - public void TestDisplayActionSheetTitleCancel () + public void TestDisplayActionSheetTitleCancel() { - ScrollAndTap ("ActionSheet Title Cancel"); - App.WaitForElement (c => c.Marked ("Title")); - if (App.Query (q => q.Marked ("Cancel")).Length > 0) - App.Tap (c => c.Marked ("Cancel")); + ScrollAndTap("ActionSheet Title Cancel"); + App.WaitForElement(c => c.Marked("Title")); + if (App.Query(q => q.Marked("Cancel")).Length > 0) + App.Tap(c => c.Marked("Cancel")); else - App.TapCoordinates (20, screenSize.Height / 2); + App.TapCoordinates(20, screenSize.Height / 2); } [Test] - public void TestDisplayActionSheetTitleCancelDestruction () + public void TestDisplayActionSheetTitleCancelDestruction() { - ScrollAndTap ("ActionSheet Title Cancel Destruction"); - App.WaitForElement (c => c.Marked ("Title")); - App.WaitForNoElement (c => c.Marked ("Extra One")); - App.Tap (c => c.Marked ("Destruction")); + ScrollAndTap("ActionSheet Title Cancel Destruction"); + App.WaitForElement(c => c.Marked("Title")); + App.WaitForNoElement(c => c.Marked("Extra One")); + App.Tap(c => c.Marked("Destruction")); } [Test] - public void TestDisplayActionSheetTitleCancelDestructionExtras () + public void TestDisplayActionSheetTitleCancelDestructionExtras() { - ScrollAndTap ("ActionSheet Title Cancel Destruction Extras"); - App.WaitForElement (c => c.Marked ("Title")); - CheckExtras (); - App.Tap (c => c.Marked ("Destruction")); + ScrollAndTap("ActionSheet Title Cancel Destruction Extras"); + App.WaitForElement(c => c.Marked("Title")); + CheckExtras(); + App.Tap(c => c.Marked("Destruction")); } [Test] - public void TestDisplayActionSheetTitleDestruction () + public void TestDisplayActionSheetTitleDestruction() { - ScrollAndTap ("ActionSheet Title Destruction"); - App.WaitForElement (c => c.Marked ("Title")); - App.WaitForNoElement (c => c.Marked ("Extra One")); - App.Tap (c => c.Marked ("Destruction")); + ScrollAndTap("ActionSheet Title Destruction"); + App.WaitForElement(c => c.Marked("Title")); + App.WaitForNoElement(c => c.Marked("Extra One")); + App.Tap(c => c.Marked("Destruction")); } [Test] - public void TestDisplayActionSheetTitleDestructionExtras () + public void TestDisplayActionSheetTitleDestructionExtras() { - ScrollAndTap ("ActionSheet Title Destruction Extras"); - App.WaitForElement (c => c.Marked ("Title")); - CheckExtras (); - App.Tap (c => c.Marked ("Destruction")); + ScrollAndTap("ActionSheet Title Destruction Extras"); + App.WaitForElement(c => c.Marked("Title")); + CheckExtras(); + App.Tap(c => c.Marked("Destruction")); } [Test] - public void TestDisplayActionSheetTitleExtras () + public void TestDisplayActionSheetTitleExtras() { - ScrollAndTap ("ActionSheet Title Extras"); - CheckExtras (); - App.Tap (c => c.Marked ("Extra One")); + ScrollAndTap("ActionSheet Title Extras"); + CheckExtras(); + App.Tap(c => c.Marked("Extra One")); } - void ScrollAndTap(string actionSheet) + void ScrollAndTap(string actionSheet) { +#if !__MACOS__ App.ScrollForElement(string.Format("* text:'{0}'", actionSheet), new Drag(App.Query(q => q.Marked("ActionSheetPage"))[0].Rect, Drag.Direction.BottomToTop, Drag.DragLength.Long)); - App.Tap(q=>q.Raw(string.Format("* text:'{0}'", actionSheet))); +#endif + App.Tap(q => q.Raw(string.Format("* text:'{0}'", actionSheet))); } } diff --git a/Xamarin.Forms.Core.iOS.UITests/Tests/ActivityIndicatorUITests.cs b/Xamarin.Forms.Core.iOS.UITests/Tests/ActivityIndicatorUITests.cs index 36dd3a14..86d0d750 100644 --- a/Xamarin.Forms.Core.iOS.UITests/Tests/ActivityIndicatorUITests.cs +++ b/Xamarin.Forms.Core.iOS.UITests/Tests/ActivityIndicatorUITests.cs @@ -47,11 +47,14 @@ namespace Xamarin.Forms.Core.UITests [UiTest (typeof(ActivityIndicator), "IsRunning")] public void IsRunning () { - var remote = new ViewContainerRemote (App, Test.ActivityIndicator.IsRunning, PlatformViewType); - remote.GoTo (); - + var remote = new ViewContainerRemote(App, Test.ActivityIndicator.IsRunning, PlatformViewType); + remote.GoTo(); +#if __MACOS__ + Assert.Inconclusive("Not tested yet"); +#else var isRunning = remote.GetProperty (ActivityIndicator.IsRunningProperty); Assert.IsTrue (isRunning); +#endif } protected override void FixtureTeardown () diff --git a/Xamarin.Forms.Core.iOS.UITests/Tests/AppearingUITests.cs b/Xamarin.Forms.Core.iOS.UITests/Tests/AppearingUITests.cs index 1e624611..568663ab 100644 --- a/Xamarin.Forms.Core.iOS.UITests/Tests/AppearingUITests.cs +++ b/Xamarin.Forms.Core.iOS.UITests/Tests/AppearingUITests.cs @@ -3,6 +3,9 @@ using NUnit.Framework; namespace Xamarin.Forms.Core.UITests { +#if __MACOS__ + [Ignore("Not tested on the MAC")] +#endif [Category(UITestCategories.LifeCycle)] internal class AppearingUITests : BaseTestFixture { diff --git a/Xamarin.Forms.Core.iOS.UITests/Tests/AutomationIDUITests.cs b/Xamarin.Forms.Core.iOS.UITests/Tests/AutomationIDUITests.cs index 4aeb5cc7..9b814a92 100644 --- a/Xamarin.Forms.Core.iOS.UITests/Tests/AutomationIDUITests.cs +++ b/Xamarin.Forms.Core.iOS.UITests/Tests/AutomationIDUITests.cs @@ -3,6 +3,7 @@ using Xamarin.UITest; using System; using System.Threading; using Xamarin.UITest.Queries; +using System.Threading.Tasks; namespace Xamarin.Forms.Core.UITests { @@ -41,8 +42,9 @@ namespace Xamarin.Forms.Core.UITests [Test] - public void Test2 () + public async void Test2() { + await Task.Delay(1000); App.WaitForElement(c => c.Marked("btnTest2")); App.Tap (c => c.Marked ("btnTest2")); App.WaitForElement (c => c.Marked ("imgHello")); diff --git a/Xamarin.Forms.Core.iOS.UITests/Tests/BoxViewUITests.cs b/Xamarin.Forms.Core.iOS.UITests/Tests/BoxViewUITests.cs index fa9cdc29..6def5ed0 100644 --- a/Xamarin.Forms.Core.iOS.UITests/Tests/BoxViewUITests.cs +++ b/Xamarin.Forms.Core.iOS.UITests/Tests/BoxViewUITests.cs @@ -17,6 +17,9 @@ using Xamarin.UITest.iOS; namespace Xamarin.Forms.Core.UITests { [TestFixture] +#if __MACOS__ + [Ignore("Not tested on the MAC")] +#endif [Category(UITestCategories.BoxView)] internal class BoxViewUITests : _ViewUITests { diff --git a/Xamarin.Forms.Core.iOS.UITests/Tests/ButtonUITests.cs b/Xamarin.Forms.Core.iOS.UITests/Tests/ButtonUITests.cs index 83c9cccd..89994a98 100644 --- a/Xamarin.Forms.Core.iOS.UITests/Tests/ButtonUITests.cs +++ b/Xamarin.Forms.Core.iOS.UITests/Tests/ButtonUITests.cs @@ -127,6 +127,8 @@ namespace Xamarin.Forms.Core.UITests #if __ANDROID__ var isBold = remote.GetProperty (Button.FontProperty); Assert.True (isBold); +#elif __MACOS__ + Assert.Inconclusive("needs testing"); #else var font = remote.GetProperty (Button.FontProperty); Assert.True (font.FontAttributes.HasFlag (FontAttributes.Bold)); diff --git a/Xamarin.Forms.Core.iOS.UITests/Tests/ContextActionsUITests.cs b/Xamarin.Forms.Core.iOS.UITests/Tests/ContextActionsUITests.cs index d681d476..cd0b3643 100644 --- a/Xamarin.Forms.Core.iOS.UITests/Tests/ContextActionsUITests.cs +++ b/Xamarin.Forms.Core.iOS.UITests/Tests/ContextActionsUITests.cs @@ -31,7 +31,7 @@ namespace Xamarin.Forms.Core.UITests const string mark = "Mark"; -#if __ANDROID__ +#if __ANDROID__ || __MACOS__ [Test] public void ContextActionsShow () { @@ -81,7 +81,6 @@ namespace Xamarin.Forms.Core.UITests } #endif } - [TestFixture] [Category(UITestCategories.Cells)] internal class ContextActionsTableUITests : BaseTestFixture @@ -103,7 +102,7 @@ namespace Xamarin.Forms.Core.UITests const string mark = "Mark"; const string cellWithNoContextActions = "I have no ContextActions"; -#if __ANDROID__ +#if __ANDROID__ || __MACOS__ [Test] public void ContextActionsShowAndReset () { diff --git a/Xamarin.Forms.Core.iOS.UITests/Tests/FrameUITests.cs b/Xamarin.Forms.Core.iOS.UITests/Tests/FrameUITests.cs index 035e3f70..338d6fed 100644 --- a/Xamarin.Forms.Core.iOS.UITests/Tests/FrameUITests.cs +++ b/Xamarin.Forms.Core.iOS.UITests/Tests/FrameUITests.cs @@ -16,6 +16,9 @@ using Xamarin.UITest.iOS; namespace Xamarin.Forms.Core.UITests { +#if __MACOS__ + [Ignore("Not tested on the MAC")] +#endif [TestFixture] [Category(UITestCategories.Frame)] internal class FrameUITests : _ViewUITests diff --git a/Xamarin.Forms.Core.iOS.UITests/Tests/Legacy-CellsUITests.cs b/Xamarin.Forms.Core.iOS.UITests/Tests/Legacy-CellsUITests.cs index f89f5714..24732519 100644 --- a/Xamarin.Forms.Core.iOS.UITests/Tests/Legacy-CellsUITests.cs +++ b/Xamarin.Forms.Core.iOS.UITests/Tests/Legacy-CellsUITests.cs @@ -12,6 +12,9 @@ using Xamarin.UITest.Queries; namespace Xamarin.Forms.Core.UITests { +#if __MACOS__ + [Ignore("Not tested on the MAC")] +#endif [TestFixture] [Category(UITestCategories.Cells)] internal class CellsGalleryTests : BaseTestFixture diff --git a/Xamarin.Forms.Core.iOS.UITests/Tests/ToolbarItemTests.cs b/Xamarin.Forms.Core.iOS.UITests/Tests/ToolbarItemTests.cs index 30cabffd..1c8a1565 100644 --- a/Xamarin.Forms.Core.iOS.UITests/Tests/ToolbarItemTests.cs +++ b/Xamarin.Forms.Core.iOS.UITests/Tests/ToolbarItemTests.cs @@ -6,6 +6,9 @@ using Xamarin.UITest.iOS; namespace Xamarin.Forms.Core.UITests { +#if __MACOS__ + [Ignore("Not tested in MacOS yet")] +#endif [TestFixture] [Category(UITestCategories.ToolbarItem)] internal class ToolbarItemTests : BaseTestFixture diff --git a/Xamarin.Forms.Core.iOS.UITests/Tests/ViewUITests.cs b/Xamarin.Forms.Core.iOS.UITests/Tests/ViewUITests.cs index a7a13017..9029f2aa 100644 --- a/Xamarin.Forms.Core.iOS.UITests/Tests/ViewUITests.cs +++ b/Xamarin.Forms.Core.iOS.UITests/Tests/ViewUITests.cs @@ -11,6 +11,7 @@ using Xamarin.UITest.iOS; namespace Xamarin.Forms.Core.UITests { + [Category("ViewBaseTests")] internal abstract class _ViewUITests : BaseTestFixture { /* Under score prefixes ensure inherited properties run first in test suite */ @@ -117,7 +118,11 @@ namespace Xamarin.Forms.Core.UITests var viewPre = remote.GetViews (); +#if __MACOS__ + Assert.GreaterOrEqual(viewPre.Length, 1); +#else Assert.AreEqual (1, viewPre.Length); +#endif remote.TapStateButton (); @@ -136,12 +141,15 @@ namespace Xamarin.Forms.Core.UITests [UiTest (typeof (VisualElement), "Opacity")] public virtual void _Opacity () { - var remote = new ViewContainerRemote (App, Test.VisualElement.Opacity, PlatformViewType); - remote.GoTo (); - + var remote = new ViewContainerRemote(App, Test.VisualElement.Opacity, PlatformViewType); + remote.GoTo(); +#if __MACOS__ + Assert.Inconclusive("needs testing"); +#else float opacity = -1f; opacity = remote.GetProperty (View.OpacityProperty); Assert.AreEqual (0.5f, opacity); +#endif } [Test] @@ -203,12 +211,15 @@ namespace Xamarin.Forms.Core.UITests [UiTest (typeof (VisualElement), "Scale")] public virtual void _Scale () { - var remote = new ViewContainerRemote (App, Test.VisualElement.Scale, PlatformViewType); - remote.GoTo (); - - var scaleMatrix = remote.GetProperty (View.ScaleProperty); - Matrix generatedMatrix = NumericExtensions.BuildScaleMatrix (0.5f); - Assert.AreEqual (generatedMatrix, scaleMatrix); + var remote = new ViewContainerRemote(App, Test.VisualElement.Scale, PlatformViewType); + remote.GoTo(); +#if __MACOS__ + Assert.Inconclusive("needs testing"); +#else + var scaleMatrix = remote.GetProperty(View.ScaleProperty); + Matrix generatedMatrix = NumericExtensions.BuildScaleMatrix(0.5f); + Assert.AreEqual(generatedMatrix, scaleMatrix); +#endif } [Test] diff --git a/Xamarin.Forms.Core.iOS.UITests/Utilities/AppExtensions.cs b/Xamarin.Forms.Core.iOS.UITests/Utilities/AppExtensions.cs index 481c3a5e..b5f52b9c 100644 --- a/Xamarin.Forms.Core.iOS.UITests/Utilities/AppExtensions.cs +++ b/Xamarin.Forms.Core.iOS.UITests/Utilities/AppExtensions.cs @@ -1,16 +1,7 @@ using System; -using System.Collections.Generic; -using System.Diagnostics; using System.Linq; -using System.Text; -using System.Threading; -using System.Threading.Tasks; - -using NUnit.Framework; using Xamarin.UITest; -using Xamarin.UITest.Android; -using Xamarin.UITest.iOS; using Xamarin.UITest.Queries; using System.Text.RegularExpressions; -- cgit v1.2.3