mirror of
https://github.com/lidarr/Lidarr
synced 2024-12-25 17:17:02 +00:00
Web drivers are now created only once per fixture.
This commit is contained in:
parent
9be08b810e
commit
55b9dc2a9b
1 changed files with 10 additions and 6 deletions
|
@ -37,13 +37,13 @@ static AutomationTestBase()
|
||||||
[SetUp]
|
[SetUp]
|
||||||
public void AutomationSetup()
|
public void AutomationSetup()
|
||||||
{
|
{
|
||||||
Driver = new FirefoxDriver();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[TearDown]
|
[TearDown]
|
||||||
public void AutomationTearDown()
|
public void AutomationTearDown()
|
||||||
{
|
{
|
||||||
Driver.Close();
|
|
||||||
|
|
||||||
if (!Directory.Exists(Directory.GetCurrentDirectory() + "\\Screenshots"))
|
if (!Directory.Exists(Directory.GetCurrentDirectory() + "\\Screenshots"))
|
||||||
{
|
{
|
||||||
|
@ -64,12 +64,16 @@ public void AutomationTestFixtureSetup()
|
||||||
StopNzbDrone();
|
StopNzbDrone();
|
||||||
ResetUserData();
|
ResetUserData();
|
||||||
StartNzbDrone();
|
StartNzbDrone();
|
||||||
|
Driver = new FirefoxDriver();
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestFixtureTearDown]
|
[TestFixtureTearDown]
|
||||||
public void AutomationTestFixtureTearDown()
|
public void AutomationTestFixtureTearDown()
|
||||||
{
|
{
|
||||||
|
Driver.Close();
|
||||||
StopNzbDrone();
|
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 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);
|
((ITakesScreenshot)Driver).GetScreenshot().SaveAsFile(fileName, ImageFormat.Png);
|
||||||
}
|
}
|
||||||
|
@ -127,9 +131,9 @@ static void StartNzbDrone()
|
||||||
};
|
};
|
||||||
nzbDroneProcess.OutputDataReceived +=
|
nzbDroneProcess.OutputDataReceived +=
|
||||||
delegate(object o, DataReceivedEventArgs args)
|
delegate(object o, DataReceivedEventArgs args)
|
||||||
{
|
{
|
||||||
Console.WriteLine(args.Data);
|
Console.WriteLine(args.Data);
|
||||||
};
|
};
|
||||||
|
|
||||||
nzbDroneProcess.Start();
|
nzbDroneProcess.Start();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue