mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-10-01 07:55:22 +02:00
Take Screenshot on Automation tests for build status notifications
This commit is contained in:
@@ -42,6 +42,8 @@ namespace NzbDrone.Automation.Test
|
||||
// Timeout as windows automation tests seem to take alot longer to get going
|
||||
driver = new ChromeDriver(service, options, new TimeSpan(0, 3, 0));
|
||||
|
||||
driver.Manage().Window.Size = new System.Drawing.Size(1920, 1080);
|
||||
|
||||
_runner = new NzbDroneRunner(LogManager.GetCurrentClassLogger());
|
||||
_runner.KillAll();
|
||||
_runner.Start();
|
||||
@@ -62,6 +64,19 @@ namespace NzbDrone.Automation.Test
|
||||
.Select(e => e.Text);
|
||||
}
|
||||
|
||||
protected void TakeScreenshot(string name)
|
||||
{
|
||||
try
|
||||
{
|
||||
Screenshot image = ((ITakesScreenshot)driver).GetScreenshot();
|
||||
image.SaveAsFile($"./{name}_test_screenshot.png", ScreenshotImageFormat.Png);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"Failed to save screenshot {name}, {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
[OneTimeTearDown]
|
||||
public void SmokeTestTearDown()
|
||||
{
|
||||
|
@@ -1,4 +1,5 @@
|
||||
using FluentAssertions;
|
||||
using System.Reflection;
|
||||
using FluentAssertions;
|
||||
using NUnit.Framework;
|
||||
using NzbDrone.Automation.Test.PageModel;
|
||||
using OpenQA.Selenium;
|
||||
@@ -21,6 +22,10 @@ namespace NzbDrone.Automation.Test
|
||||
{
|
||||
_page.MovieNavIcon.Click();
|
||||
_page.WaitForNoSpinner();
|
||||
|
||||
var imageName = MethodBase.GetCurrentMethod().Name;
|
||||
TakeScreenshot(imageName);
|
||||
|
||||
_page.Find(By.CssSelector("div[class*='MovieIndex']")).Should().NotBeNull();
|
||||
}
|
||||
|
||||
@@ -30,6 +35,9 @@ namespace NzbDrone.Automation.Test
|
||||
_page.CalendarNavIcon.Click();
|
||||
_page.WaitForNoSpinner();
|
||||
|
||||
var imageName = MethodBase.GetCurrentMethod().Name;
|
||||
TakeScreenshot(imageName);
|
||||
|
||||
_page.Find(By.CssSelector("div[class*='CalendarPage']")).Should().NotBeNull();
|
||||
}
|
||||
|
||||
@@ -39,6 +47,9 @@ namespace NzbDrone.Automation.Test
|
||||
_page.ActivityNavIcon.Click();
|
||||
_page.WaitForNoSpinner();
|
||||
|
||||
var imageName = MethodBase.GetCurrentMethod().Name;
|
||||
TakeScreenshot(imageName);
|
||||
|
||||
_page.Find(By.LinkText("Queue")).Should().NotBeNull();
|
||||
_page.Find(By.LinkText("History")).Should().NotBeNull();
|
||||
_page.Find(By.LinkText("Blacklist")).Should().NotBeNull();
|
||||
@@ -50,6 +61,9 @@ namespace NzbDrone.Automation.Test
|
||||
_page.SystemNavIcon.Click();
|
||||
_page.WaitForNoSpinner();
|
||||
|
||||
var imageName = MethodBase.GetCurrentMethod().Name;
|
||||
TakeScreenshot(imageName);
|
||||
|
||||
_page.Find(By.CssSelector("div[class*='Health']")).Should().NotBeNull();
|
||||
}
|
||||
|
||||
@@ -58,11 +72,12 @@ namespace NzbDrone.Automation.Test
|
||||
{
|
||||
_page.MovieNavIcon.Click();
|
||||
_page.WaitForNoSpinner();
|
||||
|
||||
_page.Find(By.LinkText("Add New")).Click();
|
||||
|
||||
_page.WaitForNoSpinner();
|
||||
|
||||
var imageName = MethodBase.GetCurrentMethod().Name;
|
||||
TakeScreenshot(imageName);
|
||||
|
||||
_page.Find(By.CssSelector("input[class*='AddNewMovie-searchInput']")).Should().NotBeNull();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user