mirror of
https://github.com/Radarr/Radarr.git
synced 2026-04-18 21:35:51 -04:00
Automation ;)
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
using System.Linq;
|
||||
using OpenQA.Selenium.Remote;
|
||||
|
||||
namespace NzbDrone.Web.UI.Automation.Fluent
|
||||
{
|
||||
public static class AssertionExtention
|
||||
{
|
||||
public static DriverAssertion Should(this RemoteWebDriver actualValue)
|
||||
{
|
||||
return new DriverAssertion(actualValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
using System.Linq;
|
||||
using FluentAssertions;
|
||||
using OpenQA.Selenium.Remote;
|
||||
|
||||
namespace NzbDrone.Web.UI.Automation.Fluent
|
||||
{
|
||||
public class DriverAssertion
|
||||
{
|
||||
private readonly RemoteWebDriver _driver;
|
||||
|
||||
public DriverAssertion(RemoteWebDriver driver)
|
||||
{
|
||||
_driver = driver;
|
||||
}
|
||||
|
||||
public void BeNzbDronePage()
|
||||
{
|
||||
_driver.Title.Should().EndWith("NzbDrone");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
using System.Linq;
|
||||
using OpenQA.Selenium.Remote;
|
||||
|
||||
namespace NzbDrone.Web.UI.Automation.Fluent
|
||||
{
|
||||
public static class NavigationExtention
|
||||
{
|
||||
|
||||
private const string baseUrl = "http://localhost:8989/";
|
||||
|
||||
public static RemoteWebDriver GivenHomePage(this RemoteWebDriver driver)
|
||||
{
|
||||
driver.Navigate().GoToUrl(baseUrl);
|
||||
return driver;
|
||||
}
|
||||
|
||||
public static RemoteWebDriver GivenSettingsPage(this RemoteWebDriver driver)
|
||||
{
|
||||
driver.Navigate().GoToUrl(baseUrl + "settings");
|
||||
return driver;
|
||||
}
|
||||
|
||||
public static RemoteWebDriver GivenUpcomingPage(this RemoteWebDriver driver)
|
||||
{
|
||||
driver.Navigate().GoToUrl(baseUrl + "Upcoming");
|
||||
return driver;
|
||||
}
|
||||
|
||||
public static RemoteWebDriver GivenHistoryPage(this RemoteWebDriver driver)
|
||||
{
|
||||
driver.Navigate().GoToUrl(baseUrl + "History");
|
||||
return driver;
|
||||
}
|
||||
|
||||
public static RemoteWebDriver GivenMissingPage(this RemoteWebDriver driver)
|
||||
{
|
||||
driver.Navigate().GoToUrl(baseUrl + "Missing");
|
||||
return driver;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user