From ef6a6481895a670bd1bf211554c069fd534b331f Mon Sep 17 00:00:00 2001 From: Taloth Saldono Date: Fri, 16 Aug 2019 20:53:22 +0200 Subject: [PATCH] Fixed Automation Tests for Firefox and Sonarr v3 UI. --- src/NzbDrone.Automation.Test/AutomationTest.cs | 2 +- src/NzbDrone.Automation.Test/MainPagesTest.cs | 18 +++++++++++------- .../PageModel/PageBase.cs | 12 ++++++------ .../Sonarr.Automation.Test.csproj | 3 ++- 4 files changed, 20 insertions(+), 15 deletions(-) diff --git a/src/NzbDrone.Automation.Test/AutomationTest.cs b/src/NzbDrone.Automation.Test/AutomationTest.cs index 47f8d87c0..febe1651d 100644 --- a/src/NzbDrone.Automation.Test/AutomationTest.cs +++ b/src/NzbDrone.Automation.Test/AutomationTest.cs @@ -45,7 +45,7 @@ namespace NzbDrone.Automation.Test var page = new PageBase(driver); page.WaitForNoSpinner(); - driver.ExecuteScript("window.NzbDrone.NameViews = true;"); + driver.ExecuteScript("window.Sonarr.NameViews = true;"); GetPageErrors().Should().BeEmpty(); } diff --git a/src/NzbDrone.Automation.Test/MainPagesTest.cs b/src/NzbDrone.Automation.Test/MainPagesTest.cs index bbf89690a..b6f172140 100644 --- a/src/NzbDrone.Automation.Test/MainPagesTest.cs +++ b/src/NzbDrone.Automation.Test/MainPagesTest.cs @@ -21,7 +21,8 @@ namespace NzbDrone.Automation.Test { page.SeriesNavIcon.Click(); page.WaitForNoSpinner(); - page.FindByClass("iv-series-index-seriesindexlayout").Should().NotBeNull(); + + page.Find(By.CssSelector("div[class*='SeriesIndex']")).Should().NotBeNull(); } [Test] @@ -30,7 +31,7 @@ namespace NzbDrone.Automation.Test page.CalendarNavIcon.Click(); page.WaitForNoSpinner(); - page.FindByClass("iv-calendar-calendarlayout").Should().NotBeNull(); + page.Find(By.CssSelector("div[class*='CalendarPage']")).Should().NotBeNull(); } [Test] @@ -39,7 +40,9 @@ namespace NzbDrone.Automation.Test page.ActivityNavIcon.Click(); page.WaitForNoSpinner(); - page.FindByClass("iv-activity-activitylayout").Should().NotBeNull(); + page.Find(By.LinkText("Queue")).Should().NotBeNull(); + page.Find(By.LinkText("History")).Should().NotBeNull(); + page.Find(By.LinkText("Blacklist")).Should().NotBeNull(); } [Test] @@ -48,7 +51,8 @@ namespace NzbDrone.Automation.Test page.WantedNavIcon.Click(); page.WaitForNoSpinner(); - page.FindByClass("iv-wanted-missing-missinglayout").Should().NotBeNull(); + page.Find(By.LinkText("Missing")).Should().NotBeNull(); + page.Find(By.LinkText("Cutoff Unmet")).Should().NotBeNull(); } [Test] @@ -57,7 +61,7 @@ namespace NzbDrone.Automation.Test page.SystemNavIcon.Click(); page.WaitForNoSpinner(); - page.FindByClass("iv-system-systemlayout").Should().NotBeNull(); + page.Find(By.CssSelector("div[class*='Health']")).Should().NotBeNull(); } [Test] @@ -66,11 +70,11 @@ namespace NzbDrone.Automation.Test page.SeriesNavIcon.Click(); page.WaitForNoSpinner(); - page.Find(By.LinkText("Add Series")).Click(); + page.Find(By.LinkText("Add New")).Click(); page.WaitForNoSpinner(); - page.FindByClass("iv-addseries-addserieslayout").Should().NotBeNull(); + page.Find(By.CssSelector("input[class*='AddNewSeries/searchInput']")).Should().NotBeNull(); } } } \ No newline at end of file diff --git a/src/NzbDrone.Automation.Test/PageModel/PageBase.cs b/src/NzbDrone.Automation.Test/PageModel/PageBase.cs index f835c39a6..b030536c5 100644 --- a/src/NzbDrone.Automation.Test/PageModel/PageBase.cs +++ b/src/NzbDrone.Automation.Test/PageModel/PageBase.cs @@ -47,16 +47,16 @@ namespace NzbDrone.Automation.Test.PageModel }); } - public IWebElement SeriesNavIcon => FindByClass("x-series-nav"); + public IWebElement SeriesNavIcon => Find(By.LinkText("Series")); - public IWebElement CalendarNavIcon => FindByClass("x-calendar-nav"); + public IWebElement CalendarNavIcon => Find(By.LinkText("Calendar")); - public IWebElement ActivityNavIcon => FindByClass("x-activity-nav"); + public IWebElement ActivityNavIcon => Find(By.LinkText("Activity")); - public IWebElement WantedNavIcon => FindByClass("x-wanted-nav"); + public IWebElement WantedNavIcon => Find(By.LinkText("Wanted")); - public IWebElement SettingNavIcon => FindByClass("x-settings-nav"); + public IWebElement SettingNavIcon => Find(By.LinkText("Settings")); - public IWebElement SystemNavIcon => FindByClass("x-system-nav"); + public IWebElement SystemNavIcon => Find(By.PartialLinkText("System")); } } \ No newline at end of file diff --git a/src/NzbDrone.Automation.Test/Sonarr.Automation.Test.csproj b/src/NzbDrone.Automation.Test/Sonarr.Automation.Test.csproj index 4abfdf265..d25dd9156 100644 --- a/src/NzbDrone.Automation.Test/Sonarr.Automation.Test.csproj +++ b/src/NzbDrone.Automation.Test/Sonarr.Automation.Test.csproj @@ -4,7 +4,8 @@ x86 - + +