mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-10-03 01:01:34 +02:00
Fix fullscreen automation screenshots
This commit is contained in:
@@ -39,15 +39,16 @@ namespace NzbDrone.Automation.Test
|
||||
var service = ChromeDriverService.CreateDefaultService();
|
||||
|
||||
// Timeout as windows automation tests seem to take alot longer to get going
|
||||
driver = new ChromeDriver(service, options, new TimeSpan(0, 3, 0));
|
||||
driver = new ChromeDriver(service, options, TimeSpan.FromMinutes(3));
|
||||
|
||||
driver.Manage().Window.Size = new System.Drawing.Size(1920, 1080);
|
||||
driver.Manage().Window.FullScreen();
|
||||
|
||||
_runner = new NzbDroneRunner(LogManager.GetCurrentClassLogger(), null);
|
||||
_runner.KillAll();
|
||||
_runner.Start(true);
|
||||
|
||||
driver.Url = "http://localhost:9696";
|
||||
driver.Navigate().GoToUrl("http://localhost:9696");
|
||||
|
||||
var page = new PageBase(driver);
|
||||
page.WaitForNoSpinner();
|
||||
@@ -67,7 +68,7 @@ namespace NzbDrone.Automation.Test
|
||||
{
|
||||
try
|
||||
{
|
||||
var image = ((ITakesScreenshot)driver).GetScreenshot();
|
||||
var image = (driver as ITakesScreenshot).GetScreenshot();
|
||||
image.SaveAsFile($"./{name}_test_screenshot.png", ScreenshotImageFormat.Png);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
@@ -7,12 +7,11 @@ namespace NzbDrone.Automation.Test.PageModel
|
||||
{
|
||||
public class PageBase
|
||||
{
|
||||
private readonly WebDriver _driver;
|
||||
private readonly IWebDriver _driver;
|
||||
|
||||
public PageBase(WebDriver driver)
|
||||
public PageBase(IWebDriver driver)
|
||||
{
|
||||
_driver = driver;
|
||||
driver.Manage().Window.Maximize();
|
||||
}
|
||||
|
||||
public IWebElement FindByClass(string className, int timeout = 5)
|
||||
|
Reference in New Issue
Block a user