diff --git a/src/NzbDrone.Automation.Test/AutomationTest.cs b/src/NzbDrone.Automation.Test/AutomationTest.cs index 36f6050e1..5fbbf4144 100644 --- a/src/NzbDrone.Automation.Test/AutomationTest.cs +++ b/src/NzbDrone.Automation.Test/AutomationTest.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Threading; using FluentAssertions; using NLog; using NLog.Config; @@ -10,6 +11,8 @@ using NzbDrone.Common.EnvironmentInfo; using NzbDrone.Test.Common; using OpenQA.Selenium; using OpenQA.Selenium.Firefox; +using OpenQA.Selenium.IE; +using OpenQA.Selenium.Remote; using OpenQA.Selenium.Support.UI; namespace NzbDrone.Automation.Test @@ -19,7 +22,7 @@ namespace NzbDrone.Automation.Test public abstract class AutomationTest { private NzbDroneRunner _runner; - protected FirefoxDriver driver; + protected RemoteWebDriver driver; public AutomationTest() { @@ -31,7 +34,7 @@ namespace NzbDrone.Automation.Test LogManager.Configuration.LoggingRules.Add(new LoggingRule("*", LogLevel.Trace, consoleTarget)); } - [SetUp] + [TestFixtureSetUp] public void SmokeTestSetup() { driver = new FirefoxDriver(); @@ -57,22 +60,18 @@ namespace NzbDrone.Automation.Test .Select(e => e.Text); } - [TearDown] + [TestFixtureTearDown] public void SmokeTestTearDown() { _runner.KillAll(); - //driver.Quit(); + driver.Quit(); } - } - [TestFixture] - public class MyAutoTest : AutomationTest - { - [Test] - public void Test1() + [TearDown] + public void AutomationTearDown() { - + Thread.Sleep(2000); + GetPageErrors().Should().BeEmpty(); } } - } diff --git a/src/NzbDrone.Automation.Test/MainPagesTest.cs b/src/NzbDrone.Automation.Test/MainPagesTest.cs new file mode 100644 index 000000000..0d583f27d --- /dev/null +++ b/src/NzbDrone.Automation.Test/MainPagesTest.cs @@ -0,0 +1,46 @@ +using FluentAssertions; +using NUnit.Framework; + +namespace NzbDrone.Automation.Test +{ + [TestFixture] + public class MainPagesTest : AutomationTest + { + [Test] + public void series_page() + { + driver.FindElementByLinkText("Series").Click(); + driver.FindElementByClassName("iv-series-index-seriesindexlayout").Should().NotBeNull(); + } + + [Test] + public void calendar_page() + { + driver.FindElementByLinkText("Calendar").Click(); + driver.FindElementByClassName("iv-calendar-calendarlayout").Should().NotBeNull(); + } + + [Test] + public void history_page() + { + driver.FindElementByLinkText("History").Click(); + driver.FindElementByClassName("iv-history-historylayout").Should().NotBeNull(); + } + + [Test] + public void missing_page() + { + driver.FindElementByLinkText("Settings").Click(); + + } + + [Test] + public void system_page() + { + driver.FindElementByLinkText("System").Click(); + driver.FindElementByClassName("iv-system-systemlayout").Should().NotBeNull(); + } + + + } +} \ No newline at end of file diff --git a/src/NzbDrone.Automation.Test/NzbDrone.Automation.Test.csproj b/src/NzbDrone.Automation.Test/NzbDrone.Automation.Test.csproj index d32d4c6aa..2ac0dc3e7 100644 --- a/src/NzbDrone.Automation.Test/NzbDrone.Automation.Test.csproj +++ b/src/NzbDrone.Automation.Test/NzbDrone.Automation.Test.csproj @@ -61,6 +61,7 @@ + @@ -76,6 +77,11 @@ + + + PreserveNewest + +