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 @@ static AutomationTestBase() [SetUp] public void AutomationSetup() { - Driver = new FirefoxDriver(); + } [TearDown] public void AutomationTearDown() { - Driver.Close(); + if (!Directory.Exists(Directory.GetCurrentDirectory() + "\\Screenshots")) { @@ -64,12 +64,16 @@ public void AutomationTestFixtureSetup() 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 @@ protected void CaptureScreen() { 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 @@ static void StartNzbDrone() }; nzbDroneProcess.OutputDataReceived += delegate(object o, DataReceivedEventArgs args) - { - Console.WriteLine(args.Data); - }; + { + Console.WriteLine(args.Data); + }; nzbDroneProcess.Start(); }