diff options
author | Rui Marinho <me@ruimarinho.net> | 2016-08-16 19:31:53 +0100 |
---|---|---|
committer | Jason Smith <jason.smith@xamarin.com> | 2016-08-16 11:31:53 -0700 |
commit | 52dc625bce269e5de4913cc1da444d890bc93d10 (patch) | |
tree | 0cac527272ce7739d0950407bd8016aa57c0a436 /Xamarin.Forms.Core.iOS.UITests/BaseTestFixture.cs | |
parent | f6febd4c81a80430331c7fcdcc63271aa4fa636c (diff) | |
download | xamarin-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/BaseTestFixture.cs')
-rw-r--r-- | Xamarin.Forms.Core.iOS.UITests/BaseTestFixture.cs | 46 |
1 files changed, 18 insertions, 28 deletions
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(); } } } |