summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Core.Windows.UITests
diff options
context:
space:
mode:
authorRui Marinho <me@ruimarinho.net>2017-03-23 11:03:48 +0000
committerGitHub <noreply@github.com>2017-03-23 11:03:48 +0000
commit2be80a55a514a050ab5ab07a201d13c111f49f63 (patch)
treea9cc64903a830e4b754ae6eee3fcc2ebb3ba200d /Xamarin.Forms.Core.Windows.UITests
parent16fcac8cf52ab960e7354a52864b0a72aefdfc1f (diff)
downloadxamarin-forms-2be80a55a514a050ab5ab07a201d13c111f49f63.tar.gz
xamarin-forms-2be80a55a514a050ab5ab07a201d13c111f49f63.tar.bz2
xamarin-forms-2be80a55a514a050ab5ab07a201d13c111f49f63.zip
[UITests]Add Xamarin.Forms.Core.UITests.Shared (#711)
* [UITests]Add Xamarin.Forms.Core.UITests.Shared * fix * [UITests]Use shared UITest project on macOS * [UITests] Add correct platform queries * [Controls] Add missing Preserve
Diffstat (limited to 'Xamarin.Forms.Core.Windows.UITests')
-rw-r--r--Xamarin.Forms.Core.Windows.UITests/App.cs19
-rw-r--r--Xamarin.Forms.Core.Windows.UITests/PlatformQueries.cs129
-rw-r--r--Xamarin.Forms.Core.Windows.UITests/Xamarin.Forms.Core.Windows.UITests.csproj135
3 files changed, 1 insertions, 282 deletions
diff --git a/Xamarin.Forms.Core.Windows.UITests/App.cs b/Xamarin.Forms.Core.Windows.UITests/App.cs
deleted file mode 100644
index 8c0ddc0f..00000000
--- a/Xamarin.Forms.Core.Windows.UITests/App.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using Xamarin.UITest;
-
-namespace Xamarin.Forms.Core.UITests
-{
- internal static class RunningApp
- {
- public static IApp App;
-
- public static void Restart ()
- {
- App = null;
- }
- }
-}
diff --git a/Xamarin.Forms.Core.Windows.UITests/PlatformQueries.cs b/Xamarin.Forms.Core.Windows.UITests/PlatformQueries.cs
deleted file mode 100644
index 9599d5d3..00000000
--- a/Xamarin.Forms.Core.Windows.UITests/PlatformQueries.cs
+++ /dev/null
@@ -1,129 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using Xamarin.UITest.Queries;
-
-namespace Xamarin.Forms.Core.UITests
-{
- internal static class PlatformMethodQueries
- {
- public static readonly Dictionary<BindableProperty, Tuple<string[], bool>> PropertyPlatformMethodDictionary = new Dictionary<BindableProperty, Tuple<string[], bool>> {
- { 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<AppQuery, AppQuery> Root = q => q.Id ("content");
- public static readonly Func<AppQuery, AppQuery> RootPageListView = q => q.Raw ("ListViewRenderer index:0");
- public static readonly Func<AppQuery, AppQuery> GalleryListView = q => q.Raw ("ListViewRenderer index:1");
- public static readonly Func<AppQuery, AppQuery> PageWithoutNavigationBar = q => q.Raw ("* id:'content' index:0");
- public static readonly Func<AppQuery, AppQuery> NavigationBarBackButton = q => q.Class ("android.support.v7.widget.Toolbar").Child ("android.widget.ImageButton");
-
- // Views
- public static readonly Func<AppQuery, AppQuery> ActivityIndicator = q => q.ClassFull (PlatformViews.ActivityIndicator);
- public static readonly Func<AppQuery, AppQuery> Button = q => q.ClassFull (PlatformViews.Button);
-
- public static Func<AppQuery, AppQuery> EntryWithPlaceholder (string text) {
- return q => q.Raw (string.Format ("EntryEditText hint:'{0}'", text));
- }
- public static Func<AppQuery, AppQuery> EntryCellWithPlaceholder (string text) {
- return q => q.Raw (string.Format ("EntryCellEditText hint:'{0}'", text));
- }
-
- public static Func<AppQuery, AppQuery> EntryWithText (string text) {
- return q => q.Raw (string.Format ("EntryEditText text:'{0}'", text));
- }
-
- public static Func<AppQuery, AppQuery> EntryCellWithText (string text) {
- return q => q.Raw (string.Format ("EntryCellEditText text:'{0}'", text));
- }
-
- public static Func<AppQuery, AppQuery> EditorsWithText (string text) {
- return q => q.Raw (string.Format ("EditorEditText text:'{0}'", text));
- }
-
- public static Func<AppQuery, AppQuery> EntryWithIndex (int index) {
- return q => q.Raw (string.Format ("EntryEditText index:{0}", index));
- }
-
- public static Func<AppQuery, AppQuery> SearchBarWithIndex (int index) {
- return q => q.Raw (string.Format ("SearchView index:{0}", index));
- }
-
- public static Func<AppQuery, AppQuery> LabelWithIndex (int index) {
- return q => q.Raw (string.Format ("TextView index:{0}", index));
- }
-
- public static Func<AppQuery, AppQuery> LabelWithText (string text) {
- return q => q.Raw (string.Format ("TextView text:'{0}'", text));
- }
-
- public static Func<AppQuery, AppQuery> LabelWithId (string id) {
- return q => q.Raw (string.Format ("TextView id:'{0}'", id));
- }
-
- public static Func<AppQuery, AppQuery> PickerEntryWithIndex (int index) {
- return q => q.Raw (string.Format ("EditText index:{0}", index));
- }
-
- public static Func<AppQuery, AppQuery> PickerEntryWithPlaceholder (string placeholder) {
- return q => q.Raw (string.Format ("EditText hint:'{0}'", placeholder));
- }
-
- public static Func<AppQuery, AppQuery> PickerEntryWithText (string text) {
- return q => q.Raw (string.Format ("EditText text:'{0}'", text));
- }
-
- public static Func<AppQuery, AppQuery> SwitchWithIndex (int index) {
- return q => q.Raw (string.Format ("Switch index:{0}", index));
- }
-
- public static Func<AppQuery, AppQuery> StepperWithIndex (int index) {
- return q => q.Raw (string.Format ("button marked:'+' index:{0}", index));
- }
- }
-}
diff --git a/Xamarin.Forms.Core.Windows.UITests/Xamarin.Forms.Core.Windows.UITests.csproj b/Xamarin.Forms.Core.Windows.UITests/Xamarin.Forms.Core.Windows.UITests.csproj
index f297b073..972ac120 100644
--- a/Xamarin.Forms.Core.Windows.UITests/Xamarin.Forms.Core.Windows.UITests.csproj
+++ b/Xamarin.Forms.Core.Windows.UITests/Xamarin.Forms.Core.Windows.UITests.csproj
@@ -52,140 +52,6 @@
</Reference>
</ItemGroup>
<ItemGroup>
- <Compile Include="..\Xamarin.Forms.Core.iOS.UITests\BaseTestFixture.cs">
- <Link>BaseTestFixture.cs</Link>
- </Compile>
- <Compile Include="..\Xamarin.Forms.Core.iOS.UITests\Queries.cs">
- <Link>Queries.cs</Link>
- </Compile>
- <Compile Include="..\Xamarin.Forms.Core.iOS.UITests\Remotes\BaseViewContainerRemote.cs">
- <Link>Remotes\BaseViewContainerRemote.cs</Link>
- </Compile>
- <Compile Include="..\Xamarin.Forms.Core.iOS.UITests\Remotes\EventViewContainerRemote.cs">
- <Link>Remotes\EventViewContainerRemote.cs</Link>
- </Compile>
- <Compile Include="..\Xamarin.Forms.Core.iOS.UITests\Remotes\LayeredViewContainerRemote.cs">
- <Link>Remotes\LayeredViewContainerRemote.cs</Link>
- </Compile>
- <Compile Include="..\Xamarin.Forms.Core.iOS.UITests\Remotes\RemoteFactory.cs">
- <Link>Remotes\RemoteFactory.cs</Link>
- </Compile>
- <Compile Include="..\Xamarin.Forms.Core.iOS.UITests\Remotes\StateViewContainerRemote.cs">
- <Link>Remotes\StateViewContainerRemote.cs</Link>
- </Compile>
- <Compile Include="..\Xamarin.Forms.Core.iOS.UITests\Remotes\ViewContainerRemote.cs">
- <Link>Remotes\ViewContainerRemote.cs</Link>
- </Compile>
- <Compile Include="..\Xamarin.Forms.Core.iOS.UITests\Tests\ActionSheetUITests.cs">
- <Link>Tests\ActionSheetUITests.cs</Link>
- </Compile>
- <Compile Include="..\Xamarin.Forms.Core.iOS.UITests\Tests\ActivityIndicatorUITests.cs">
- <Link>Tests\ActivityIndicatorUITests.cs</Link>
- </Compile>
- <Compile Include="..\Xamarin.Forms.Core.iOS.UITests\Tests\AutomationIDUITests.cs">
- <Link>Tests\AutomationIDUITests.cs</Link>
- </Compile>
- <Compile Include="..\Xamarin.Forms.Core.iOS.UITests\Tests\BoxViewUITests.cs">
- <Link>Tests\BoxViewUITests.cs</Link>
- </Compile>
- <Compile Include="..\Xamarin.Forms.Core.iOS.UITests\Tests\ButtonUITests.cs">
- <Link>Tests\ButtonUITests.cs</Link>
- </Compile>
- <Compile Include="..\Xamarin.Forms.Core.iOS.UITests\Tests\ContextActionsUITests.cs">
- <Link>Tests\ContextActionsUITests.cs</Link>
- </Compile>
- <Compile Include="..\Xamarin.Forms.Core.iOS.UITests\Tests\DatePickerUITests.cs">
- <Link>Tests\DatePickerUITests.cs</Link>
- </Compile>
- <Compile Include="..\Xamarin.Forms.Core.iOS.UITests\Tests\DisplayAlertUITests.cs">
- <Link>Tests\DisplayAlertUITests.cs</Link>
- </Compile>
- <Compile Include="..\Xamarin.Forms.Core.iOS.UITests\Tests\EditorUITests.cs">
- <Link>Tests\EditorUITests.cs</Link>
- </Compile>
- <Compile Include="..\Xamarin.Forms.Core.iOS.UITests\Tests\EntryUITests.cs">
- <Link>Tests\EntryUITests.cs</Link>
- </Compile>
- <Compile Include="..\Xamarin.Forms.Core.iOS.UITests\Tests\FrameUITests.cs">
- <Link>Tests\FrameUITests.cs</Link>
- </Compile>
- <Compile Include="..\Xamarin.Forms.Core.iOS.UITests\Tests\ImageUITests.cs">
- <Link>Tests\ImageUITests.cs</Link>
- </Compile>
- <Compile Include="..\Xamarin.Forms.Core.iOS.UITests\Tests\LabelUITests.cs">
- <Link>Tests\LabelUITests.cs</Link>
- </Compile>
- <Compile Include="..\Xamarin.Forms.Core.iOS.UITests\Tests\Legacy-CellsUITests.cs">
- <Link>Tests\Legacy-CellsUITests.cs</Link>
- </Compile>
- <Compile Include="..\Xamarin.Forms.Core.iOS.UITests\Tests\Legacy-UnevenListTests.cs">
- <Link>Tests\Legacy-UnevenListTests.cs</Link>
- </Compile>
- <Compile Include="..\Xamarin.Forms.Core.iOS.UITests\Tests\PickerUITests.cs">
- <Link>Tests\PickerUITests.cs</Link>
- </Compile>
- <Compile Include="..\Xamarin.Forms.Core.iOS.UITests\Tests\ProgressBarUITests.cs">
- <Link>Tests\ProgressBarUITests.cs</Link>
- </Compile>
- <Compile Include="..\Xamarin.Forms.Core.iOS.UITests\Tests\RootGalleryUITests.cs">
- <Link>Tests\RootGalleryUITests.cs</Link>
- </Compile>
- <Compile Include="..\Xamarin.Forms.Core.iOS.UITests\Tests\ScrollViewUITests.cs">
- <Link>Tests\ScrollViewUITests.cs</Link>
- </Compile>
- <Compile Include="..\Xamarin.Forms.Core.iOS.UITests\Tests\SearchBarUITests.cs">
- <Link>Tests\SearchBarUITests.cs</Link>
- </Compile>
- <Compile Include="..\Xamarin.Forms.Core.iOS.UITests\Tests\SliderUITests.cs">
- <Link>Tests\SliderUITests.cs</Link>
- </Compile>
- <Compile Include="..\Xamarin.Forms.Core.iOS.UITests\Tests\StepperUITests.cs">
- <Link>Tests\StepperUITests.cs</Link>
- </Compile>
- <Compile Include="..\Xamarin.Forms.Core.iOS.UITests\Tests\SwitchUITests.cs">
- <Link>Tests\SwitchUITests.cs</Link>
- </Compile>
- <Compile Include="..\Xamarin.Forms.Core.iOS.UITests\Tests\TimePickerUITests.cs">
- <Link>Tests\TimePickerUITests.cs</Link>
- </Compile>
- <Compile Include="..\Xamarin.Forms.Core.iOS.UITests\Tests\ToolbarItemTests.cs">
- <Link>Tests\ToolbarItemTests.cs</Link>
- </Compile>
- <Compile Include="..\Xamarin.Forms.Core.iOS.UITests\Tests\ViewUITests.cs">
- <Link>Tests\ViewUITests.cs</Link>
- </Compile>
- <Compile Include="..\Xamarin.Forms.Core.iOS.UITests\Tests\WebViewUITests.cs">
- <Link>Tests\WebViewUITests.cs</Link>
- </Compile>
- <Compile Include="..\Xamarin.Forms.Core.iOS.UITests\UITestCategories.cs">
- <Link>UITestCategories.cs</Link>
- </Compile>
- <Compile Include="..\Xamarin.Forms.Core.iOS.UITests\Utilities\AppExtensions.cs">
- <Link>Utilities\AppExtensions.cs</Link>
- </Compile>
- <Compile Include="..\Xamarin.Forms.Core.iOS.UITests\Utilities\Drag.cs">
- <Link>Utilities\Drag.cs</Link>
- </Compile>
- <Compile Include="..\Xamarin.Forms.Core.iOS.UITests\Utilities\Gestures.cs">
- <Link>Utilities\Gestures.cs</Link>
- </Compile>
- <Compile Include="..\Xamarin.Forms.Core.iOS.UITests\Utilities\Logger.cs">
- <Link>Utilities\Logger.cs</Link>
- </Compile>
- <Compile Include="..\Xamarin.Forms.Core.iOS.UITests\Utilities\NumericExtensions.cs">
- <Link>Utilities\NumericExtensions.cs</Link>
- </Compile>
- <Compile Include="..\Xamarin.Forms.Core.iOS.UITests\Utilities\ParsingUtils.cs">
- <Link>Utilities\ParsingUtils.cs</Link>
- </Compile>
- <Compile Include="..\Xamarin.Forms.Core.iOS.UITests\Utilities\UITestCustomExceptions.cs">
- <Link>Utilities\UITestCustomExceptions.cs</Link>
- </Compile>
- <Compile Include="..\Xamarin.Forms.Core.iOS.UITests\Utilities\ViewInspector.cs">
- <Link>Utilities\ViewInspector.cs</Link>
- </Compile>
- <Compile Include="App.cs" />
- <Compile Include="PlatformQueries.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
@@ -213,6 +79,7 @@
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
<Import Project="..\Xamarin.Forms.Controls.Issues\Xamarin.Forms.Controls.Issues.Shared\Xamarin.Forms.Controls.Issues.Shared.projitems" Label="Shared" />
+ <Import Project="..\Xamarin.Forms.Core.UITests.Shared\Xamarin.Forms.Core.UITests.projitems" Label="Shared" />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.