summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Core.iOS.UITests
diff options
context:
space:
mode:
authorRui Marinho <me@ruimarinho.net>2016-08-16 19:31:53 +0100
committerJason Smith <jason.smith@xamarin.com>2016-08-16 11:31:53 -0700
commit52dc625bce269e5de4913cc1da444d890bc93d10 (patch)
tree0cac527272ce7739d0950407bd8016aa57c0a436 /Xamarin.Forms.Core.iOS.UITests
parentf6febd4c81a80430331c7fcdcc63271aa4fa636c (diff)
downloadxamarin-forms-52dc625bce269e5de4913cc1da444d890bc93d10.tar.gz
xamarin-forms-52dc625bce269e5de4913cc1da444d890bc93d10.tar.bz2
xamarin-forms-52dc625bce269e5de4913cc1da444d890bc93d10.zip
[iOS] Change when we updated the XF INavigationPageController after popping a page natively, Cleanup UITest references (#291)
Diffstat (limited to 'Xamarin.Forms.Core.iOS.UITests')
-rw-r--r--Xamarin.Forms.Core.iOS.UITests/App.cs29
-rw-r--r--Xamarin.Forms.Core.iOS.UITests/BaseTestFixture.cs46
-rw-r--r--Xamarin.Forms.Core.iOS.UITests/Tests/Legacy-UnevenListTests.cs9
-rw-r--r--Xamarin.Forms.Core.iOS.UITests/Xamarin.Forms.Core.iOS.UITests.csproj8
4 files changed, 26 insertions, 66 deletions
diff --git a/Xamarin.Forms.Core.iOS.UITests/App.cs b/Xamarin.Forms.Core.iOS.UITests/App.cs
deleted file mode 100644
index dee82d8c..00000000
--- a/Xamarin.Forms.Core.iOS.UITests/App.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-using NUnit.Framework;
-
-using Xamarin.UITest;
-using Xamarin.UITest.iOS;
-
-namespace Xamarin.Forms.Core.UITests
-{
- internal static class RunningApp
- {
- public static iOSApp App;
-
- public static void Restart ()
- {
- App = ConfigureApp
- .iOS
- .Debug ()
- // Keeping the old BundleId for now, Test Cloud doesn't
- // like it when we update the BundleId for an existing app
- .InstalledApp ("com.xamarin.quickui.controlgallery")
- .StartApp (Xamarin.UITest.Configuration.AppDataMode.Clear);
- }
- }
-} \ No newline at end of file
diff --git a/Xamarin.Forms.Core.iOS.UITests/BaseTestFixture.cs b/Xamarin.Forms.Core.iOS.UITests/BaseTestFixture.cs
index c60ef35c..b2f98e24 100644
--- a/Xamarin.Forms.Core.iOS.UITests/BaseTestFixture.cs
+++ b/Xamarin.Forms.Core.iOS.UITests/BaseTestFixture.cs
@@ -16,22 +16,22 @@ namespace Xamarin.Forms.Core.UITests
{
// TODO: Landscape tests
- public static IApp App { get; private set; }
+ public static IApp App { get; private set; }
public string PlatformViewType { get; protected set; }
public bool ShouldResetPerFixture { get; protected set; }
public AppRect ScreenBounds { get; private set; }
- protected BaseTestFixture ()
+ protected BaseTestFixture()
{
ShouldResetPerFixture = true;
}
- protected abstract void NavigateToGallery ();
+ protected abstract void NavigateToGallery();
#pragma warning disable 618
[TestFixtureSetUp]
#pragma warning restore 618
- protected virtual void FixtureSetup ()
+ protected virtual void FixtureSetup()
{
try
{
@@ -50,43 +50,33 @@ namespace Xamarin.Forms.Core.UITests
#pragma warning disable 618
[TestFixtureTearDown]
#pragma warning restore 618
- protected virtual void FixtureTeardown ()
- {
+ protected virtual void FixtureTeardown()
+ {
}
[SetUp]
- protected virtual void TestSetup ()
+ protected virtual void TestSetup()
{
- if (!ShouldResetPerFixture) {
- RelaunchApp ();
+ if (!ShouldResetPerFixture)
+ {
+
+ RelaunchApp();
}
- App.Screenshot ("Begin Test");
}
[TearDown]
- protected virtual void TestTearDown ()
+ protected virtual void TestTearDown()
{
- App.Screenshot ("Test complete");
+
}
- void RelaunchApp ()
+ void RelaunchApp()
{
App = null;
- RunningApp.App = null;
-
- try {
- RunningApp.Restart ();
- } catch (Exception ex) {
- // if at first you dont succeed
- RunningApp.Restart ();
- }
-
- // 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 ();
- NavigateToGallery ();
+ App = AppSetup.Setup();
+ App.SetOrientationPortrait();
+ ScreenBounds = App.RootViewRect();
+ NavigateToGallery();
}
}
}
diff --git a/Xamarin.Forms.Core.iOS.UITests/Tests/Legacy-UnevenListTests.cs b/Xamarin.Forms.Core.iOS.UITests/Tests/Legacy-UnevenListTests.cs
index b425545f..86a39ad3 100644
--- a/Xamarin.Forms.Core.iOS.UITests/Tests/Legacy-UnevenListTests.cs
+++ b/Xamarin.Forms.Core.iOS.UITests/Tests/Legacy-UnevenListTests.cs
@@ -21,10 +21,11 @@ namespace Xamarin.Forms.Core.UITests
[Test]
public void UnevenListCellTest ()
{
- if (UnevenListTests.ShouldRunTest(RunningApp.App)) {
- var element = App.Query (q => q.Marked ("unevenCellListGalleryDynamic").Descendant (("UITableViewCellContentView"))) [0];
-
- Assert.GreaterOrEqual (element.Rect.Height, 100);
+ if (UnevenListTests.ShouldRunTest(App))
+ {
+ var element = App.Query(q => q.Marked("unevenCellListGalleryDynamic").Descendant(("UITableViewCellContentView")))[0];
+
+ Assert.GreaterOrEqual(element.Rect.Height, 100);
}
}
diff --git a/Xamarin.Forms.Core.iOS.UITests/Xamarin.Forms.Core.iOS.UITests.csproj b/Xamarin.Forms.Core.iOS.UITests/Xamarin.Forms.Core.iOS.UITests.csproj
index 3454e072..9c5ad1bd 100644
--- a/Xamarin.Forms.Core.iOS.UITests/Xamarin.Forms.Core.iOS.UITests.csproj
+++ b/Xamarin.Forms.Core.iOS.UITests/Xamarin.Forms.Core.iOS.UITests.csproj
@@ -22,7 +22,7 @@
<DefineConstants>TRACE;DEBUG;__IOS__;UITEST</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
- <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
+ <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<NoWarn>0114;0108;4014;0649;0169;0168;0219</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
@@ -58,14 +58,12 @@
<Reference Include="nunit.framework">
<HintPath>..\packages\NUnit.2.6.4\lib\nunit.framework.dll</HintPath>
</Reference>
- <Reference Include="Xamarin.UITest, Version=1.3.8.0, Culture=neutral, processorArchitecture=MSIL">
+ <Reference Include="Xamarin.UITest">
<HintPath>..\packages\Xamarin.UITest.1.3.8\lib\Xamarin.UITest.dll</HintPath>
- <Private>True</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="BaseTestFixture.cs" />
- <Compile Include="App.cs" />
<Compile Include="PlatformQueries.cs" />
<Compile Include="Remotes\BaseViewContainerRemote.cs" />
<Compile Include="Remotes\EventViewContainerRemote.cs" />
@@ -153,4 +151,4 @@
</Target>
-->
<ItemGroup />
-</Project>
+</Project> \ No newline at end of file