From 55b9dc2a9b7a287af51ad1443752bf720f3fb179 Mon Sep 17 00:00:00 2001 From: "kay.one" Date: Mon, 19 Dec 2011 11:31:17 -0800 Subject: [PATCH] Web drivers are now created only once per fixture. --- NzbDrone.Web.UI.Test/AutomationTestBase.cs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/NzbDrone.Web.UI.Test/AutomationTestBase.cs b/NzbDrone.Web.UI.Test/AutomationTestBase.cs index d6ad7a9ac..18134b26d 100644 --- a/NzbDrone.Web.UI.Test/AutomationTestBase.cs +++ b/NzbDrone.Web.UI.Test/AutomationTestBase.cs @@ -37,13 +37,13 @@ namespace NzbDrone.Web.UI.Automation [SetUp] public void AutomationSetup() { - Driver = new FirefoxDriver(); + } [TearDown] public void AutomationTearDown() { - Driver.Close(); + if (!Directory.Exists(Directory.GetCurrentDirectory() + "\\Screenshots")) { @@ -64,12 +64,16 @@ namespace NzbDrone.Web.UI.Automation StopNzbDrone(); ResetUserData(); StartNzbDrone(); + Driver = new FirefoxDriver(); } [TestFixtureTearDown] public void AutomationTestFixtureTearDown() { + Driver.Close(); StopNzbDrone(); + + File.Copy(Path.Combine(testFolder, "nzbdrone.log"), Path.Combine(Directory.GetCurrentDirectory(), "nzbdrone.log"), true); } @@ -77,7 +81,7 @@ namespace NzbDrone.Web.UI.Automation { var method = new StackFrame(1).GetMethod().Name; - var fileName = String.Format("{0}__{1}.png", this.GetType().Name, method); + var fileName = String.Format("{0}__{1}.png", GetType().Name, method); ((ITakesScreenshot)Driver).GetScreenshot().SaveAsFile(fileName, ImageFormat.Png); } @@ -127,9 +131,9 @@ namespace NzbDrone.Web.UI.Automation }; nzbDroneProcess.OutputDataReceived += delegate(object o, DataReceivedEventArgs args) - { - Console.WriteLine(args.Data); - }; + { + Console.WriteLine(args.Data); + }; nzbDroneProcess.Start(); }