From 2be80a55a514a050ab5ab07a201d13c111f49f63 Mon Sep 17 00:00:00 2001 From: Rui Marinho Date: Thu, 23 Mar 2017 11:03:48 +0000 Subject: [UITests]Add Xamarin.Forms.Core.UITests.Shared (#711) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [UITests]Add Xamarin.Forms.Core.UITests.Shared * fix * [UITests]Use shared UITest project on macOS * [UITests] Add correct platform queries * [Controls] Add missing Preserve --- .../PlatformQueries.cs | 133 -------------------- .../Xamarin.Forms.Core.Android.UITests.csproj | 134 +-------------------- 2 files changed, 1 insertion(+), 266 deletions(-) delete mode 100644 Xamarin.Forms.Core.Android.UITests/PlatformQueries.cs (limited to 'Xamarin.Forms.Core.Android.UITests') diff --git a/Xamarin.Forms.Core.Android.UITests/PlatformQueries.cs b/Xamarin.Forms.Core.Android.UITests/PlatformQueries.cs deleted file mode 100644 index 01a27aac..00000000 --- a/Xamarin.Forms.Core.Android.UITests/PlatformQueries.cs +++ /dev/null @@ -1,133 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -using Xamarin.UITest.Android; -using Xamarin.UITest.Queries; - -namespace Xamarin.Forms.Core.UITests -{ - internal static class AndroidLoaderIdentifier {} - - internal static class PlatformMethodQueries - { - public static readonly Dictionary> PropertyPlatformMethodDictionary = new Dictionary> { - { ActivityIndicator.ColorProperty, Tuple.Create (new[] { "getProgressDrawable", "getColor" }, false) }, - { ActivityIndicator.IsRunningProperty, Tuple.Create (new[] { "isIndeterminate" }, false) }, - { Button.BorderColorProperty, Tuple.Create (new[] { "getBackground" }, false) }, - { Button.BorderRadiusProperty, Tuple.Create (new[] { "getBackground" }, false) }, - { Button.BorderWidthProperty, Tuple.Create (new[] { "getBackground" }, false) }, - { Button.ImageProperty, Tuple.Create (new[] { "getBackground" }, false) }, - { Button.FontProperty, Tuple.Create (new[] { "getTypeface", "isBold" }, false) }, - { Button.TextProperty, Tuple.Create (new[] { "getText" }, false) }, - { Button.TextColorProperty, Tuple.Create (new[] { "getCurrentTextColor" }, false) }, - { View.AnchorXProperty, Tuple.Create (new[] { "getPivotX" }, true) }, - { View.AnchorYProperty, Tuple.Create (new[] { "getPivotY" }, true) }, - { View.BackgroundColorProperty, Tuple.Create (new[] { "getBackground", "getColor" }, true) }, - { View.IsEnabledProperty, Tuple.Create (new[] { "isEnabled" }, false) }, - { View.OpacityProperty, Tuple.Create (new[] { "getAlpha" }, true) }, - { View.RotationProperty, Tuple.Create (new[] { "getRotation" }, true) }, - { View.RotationXProperty, Tuple.Create (new[] { "getRotationX" }, true) }, - { View.RotationYProperty, Tuple.Create (new[] { "getRotationY" }, true) }, - { View.ScaleProperty, Tuple.Create (new[] { "getScaleX", "getScaleY" }, true) }, - }; - } - - internal static class PlatformViews - { - public static readonly string ActivityIndicator = "android.widget.ProgressBar"; - public static readonly string BoxView = "xamarin.forms.platform.android.BoxRenderer"; - public static readonly string Button = "android.widget.Button"; - public static readonly string DatePicker = "android.widget.EditText"; - public static readonly string Editor = "xamarin.forms.platform.android.EditorEditText"; - public static readonly string Entry = "xamarin.forms.platform.android.EntryEditText"; - public static readonly string Frame = "xamarin.forms.platform.android.appcompat.FrameRenderer"; - public static readonly string Image = "android.widget.ImageView"; - public static readonly string Label = "android.widget.TextView"; - public static readonly string ListView = "android.widget.ListView"; - public static readonly string OpenGLView = "android.widget.GLSurfaceView"; - public static readonly string Picker = "android.widget.EditText"; - public static readonly string ProgressBar = "android.widget.ProgressBar"; - public static readonly string SearchBar = "android.widget.SearchView"; - public static readonly string Slider = "android.widget.SeekBar"; - public static readonly string Stepper = "button marked:'+'"; - public static readonly string Switch = "android.widget.Switch"; - public static readonly string TableView = "android.widget.ListView"; - public static readonly string TimePicker = "android.widget.EditText"; - public static readonly string WebView = "android.widget.WebView"; - } - - internal static class PlatformQueries - { - public static readonly Func Root = q => q.Id ("content"); - public static readonly Func RootPageListView = q => q.Raw ("ListViewRenderer index:0"); - public static readonly Func GalleryListView = q => q.Raw ("ListViewRenderer index:1"); - public static readonly Func PageWithoutNavigationBar = q => q.Raw ("* id:'content' index:0"); - public static readonly Func NavigationBarBackButton = q => q.Class ("android.support.v7.widget.Toolbar").Child ("android.widget.ImageButton"); - - // Views - public static readonly Func ActivityIndicator = q => q.ClassFull (PlatformViews.ActivityIndicator); - public static readonly Func Button = q => q.ClassFull (PlatformViews.Button); - - public static Func EntryWithPlaceholder (string text) { - return q => q.Raw (string.Format ("EntryEditText hint:'{0}'", text)); - } - public static Func EntryCellWithPlaceholder (string text) { - return q => q.Raw (string.Format ("EntryCellEditText hint:'{0}'", text)); - } - - public static Func EntryWithText (string text) { - return q => q.Raw (string.Format ("EntryEditText text:'{0}'", text)); - } - - public static Func EntryCellWithText (string text) { - return q => q.Raw (string.Format ("EntryCellEditText text:'{0}'", text)); - } - - public static Func EditorsWithText (string text) { - return q => q.Raw (string.Format ("EditorEditText text:'{0}'", text)); - } - - public static Func EntryWithIndex (int index) { - return q => q.Raw (string.Format ("EntryEditText index:{0}", index)); - } - - public static Func SearchBarWithIndex (int index) { - return q => q.Raw (string.Format ("SearchView index:{0}", index)); - } - - public static Func LabelWithIndex (int index) { - return q => q.Raw (string.Format ("TextView index:{0}", index)); - } - - public static Func LabelWithText (string text) { - return q => q.Raw (string.Format ("TextView text:'{0}'", text)); - } - - public static Func LabelWithId (string id) { - return q => q.Raw (string.Format ("TextView id:'{0}'", id)); - } - - public static Func PickerEntryWithIndex (int index) { - return q => q.Raw (string.Format ("EditText index:{0}", index)); - } - - public static Func PickerEntryWithPlaceholder (string placeholder) { - return q => q.Raw (string.Format ("EditText hint:'{0}'", placeholder)); - } - - public static Func PickerEntryWithText (string text) { - return q => q.Raw (string.Format ("EditText text:'{0}'", text)); - } - - public static Func SwitchWithIndex (int index) { - return q => q.Raw (string.Format ("Switch index:{0}", index)); - } - - public static Func StepperWithIndex (int index) { - return q => q.Raw (string.Format ("button marked:'+' index:{0}", index)); - } - } -} \ No newline at end of file diff --git a/Xamarin.Forms.Core.Android.UITests/Xamarin.Forms.Core.Android.UITests.csproj b/Xamarin.Forms.Core.Android.UITests/Xamarin.Forms.Core.Android.UITests.csproj index 983add24..0f25f8ae 100644 --- a/Xamarin.Forms.Core.Android.UITests/Xamarin.Forms.Core.Android.UITests.csproj +++ b/Xamarin.Forms.Core.Android.UITests/Xamarin.Forms.Core.Android.UITests.csproj @@ -63,141 +63,8 @@ - - BaseTestFixture.cs - - - Queries.cs - - - Remotes\BaseViewContainerRemote.cs - - - Remotes\EventViewContainerRemote.cs - - - Remotes\LayeredViewContainerRemote.cs - - - Remotes\StateViewContainerRemote.cs - - - Remotes\ViewContainerRemote.cs - - - Tests\ActivityIndicatorUITests.cs - - - Tests\BoxViewUITests.cs - - - Tests\ButtonUITests.cs - - - Tests\ContextActionsUITests.cs - - - Tests\DatePickerUITests.cs - - - Tests\EditorUITests.cs - - - Tests\EntryUITests.cs - - - Tests\FrameUITests.cs - - - Tests\ImageUITests.cs - - - Tests\LabelUITests.cs - - - Tests\Legacy-CellsUITests.cs - - - Tests\PickerUITests.cs - - - Tests\ProgressBarUITests.cs - - - Tests\SearchBarUITests.cs - - - Tests\SliderUITests.cs - - - Tests\StepperUITests.cs - - - Tests\SwitchUITests.cs - - - Tests\TimePickerUITests.cs - - - Tests\ViewUITests.cs - - - Tests\WebViewUITests.cs - - - UITestCategories.cs - - - - Remotes\RemoteFactory.cs - - - Utilities\AppExtensions.cs - - - Utilities\Drag.cs - - - Utilities\Gestures.cs - - - Utilities\Logger.cs - - - Utilities\NumericExtensions.cs - - - Utilities\ParsingUtils.cs - - - Utilities\UITestCustomExceptions.cs - - - Utilities\ViewInspector.cs - - - Tests\DisplayAlertUITests.cs - - - Tests\ActionSheetUITests.cs - - - Tests\ToolbarItemTests.cs - - - Tests\ScrollViewUITests.cs - - - Tests\RootGalleryUITests.cs - - - Tests\AppearingUITests.cs - - - Tests\AutomationIDUITests.cs - @@ -228,6 +95,7 @@ + -- cgit v1.2.3