Fixed Automation Tests for Firefox and Sonarr v3 UI.

This commit is contained in:
Taloth Saldono 2019-08-16 20:53:22 +02:00
parent 09953e2af8
commit ef6a648189
4 changed files with 20 additions and 15 deletions

View File

@ -45,7 +45,7 @@ namespace NzbDrone.Automation.Test
var page = new PageBase(driver); var page = new PageBase(driver);
page.WaitForNoSpinner(); page.WaitForNoSpinner();
driver.ExecuteScript("window.NzbDrone.NameViews = true;"); driver.ExecuteScript("window.Sonarr.NameViews = true;");
GetPageErrors().Should().BeEmpty(); GetPageErrors().Should().BeEmpty();
} }

View File

@ -21,7 +21,8 @@ namespace NzbDrone.Automation.Test
{ {
page.SeriesNavIcon.Click(); page.SeriesNavIcon.Click();
page.WaitForNoSpinner(); page.WaitForNoSpinner();
page.FindByClass("iv-series-index-seriesindexlayout").Should().NotBeNull();
page.Find(By.CssSelector("div[class*='SeriesIndex']")).Should().NotBeNull();
} }
[Test] [Test]
@ -30,7 +31,7 @@ namespace NzbDrone.Automation.Test
page.CalendarNavIcon.Click(); page.CalendarNavIcon.Click();
page.WaitForNoSpinner(); page.WaitForNoSpinner();
page.FindByClass("iv-calendar-calendarlayout").Should().NotBeNull(); page.Find(By.CssSelector("div[class*='CalendarPage']")).Should().NotBeNull();
} }
[Test] [Test]
@ -39,7 +40,9 @@ namespace NzbDrone.Automation.Test
page.ActivityNavIcon.Click(); page.ActivityNavIcon.Click();
page.WaitForNoSpinner(); 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] [Test]
@ -48,7 +51,8 @@ namespace NzbDrone.Automation.Test
page.WantedNavIcon.Click(); page.WantedNavIcon.Click();
page.WaitForNoSpinner(); 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] [Test]
@ -57,7 +61,7 @@ namespace NzbDrone.Automation.Test
page.SystemNavIcon.Click(); page.SystemNavIcon.Click();
page.WaitForNoSpinner(); page.WaitForNoSpinner();
page.FindByClass("iv-system-systemlayout").Should().NotBeNull(); page.Find(By.CssSelector("div[class*='Health']")).Should().NotBeNull();
} }
[Test] [Test]
@ -66,11 +70,11 @@ namespace NzbDrone.Automation.Test
page.SeriesNavIcon.Click(); page.SeriesNavIcon.Click();
page.WaitForNoSpinner(); page.WaitForNoSpinner();
page.Find(By.LinkText("Add Series")).Click(); page.Find(By.LinkText("Add New")).Click();
page.WaitForNoSpinner(); page.WaitForNoSpinner();
page.FindByClass("iv-addseries-addserieslayout").Should().NotBeNull(); page.Find(By.CssSelector("input[class*='AddNewSeries/searchInput']")).Should().NotBeNull();
} }
} }
} }

View File

@ -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"));
} }
} }

View File

@ -4,7 +4,8 @@
<Platforms>x86</Platforms> <Platforms>x86</Platforms>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Selenium.Support" Version="3.2.0" /> <PackageReference Include="Selenium.Firefox.WebDriver" Version="0.24.0" />
<PackageReference Include="Selenium.Support" Version="3.141.0" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\NzbDrone.Test.Common\Sonarr.Test.Common.csproj" /> <ProjectReference Include="..\NzbDrone.Test.Common\Sonarr.Test.Common.csproj" />