diff --git a/src/NzbDrone.Automation.Test/MainPagesTest.cs b/src/NzbDrone.Automation.Test/MainPagesTest.cs index 3cb35b31a..fb06037c6 100644 --- a/src/NzbDrone.Automation.Test/MainPagesTest.cs +++ b/src/NzbDrone.Automation.Test/MainPagesTest.cs @@ -55,6 +55,16 @@ public void activity_page() _page.Find(By.LinkText("Blocklist")).Should().NotBeNull(); } + [Test] + public void wanted_page() + { + _page.WantedNavIcon.Click(); + _page.WaitForNoSpinner(); + + _page.Find(By.LinkText("Missing")).Should().NotBeNull(); + _page.Find(By.LinkText("Cutoff Unmet")).Should().NotBeNull(); + } + [Test] public void system_page() { diff --git a/src/NzbDrone.Automation.Test/PageModel/PageBase.cs b/src/NzbDrone.Automation.Test/PageModel/PageBase.cs index 48f4aab82..0815fec76 100644 --- a/src/NzbDrone.Automation.Test/PageModel/PageBase.cs +++ b/src/NzbDrone.Automation.Test/PageModel/PageBase.cs @@ -57,6 +57,8 @@ public void WaitForNoSpinner(int timeout = 30) public IWebElement ActivityNavIcon => Find(By.LinkText("Activity")); + public IWebElement WantedNavIcon => Find(By.LinkText("Wanted")); + public IWebElement SettingNavIcon => Find(By.LinkText("Settings")); public IWebElement SystemNavIcon => Find(By.PartialLinkText("System")); diff --git a/src/NzbDrone.Core/Localization/Core/en.json b/src/NzbDrone.Core/Localization/Core/en.json index 7df847de4..b69acce84 100644 --- a/src/NzbDrone.Core/Localization/Core/en.json +++ b/src/NzbDrone.Core/Localization/Core/en.json @@ -266,7 +266,7 @@ "CustomFormatsSpecificationRegularExpressionHelpText": "Custom Format RegEx is Case Insensitive", "Cutoff": "Cutoff", "CutoffNotMet": "Cutoff Not Met", - "CutoffUnmet": "Cut-off Unmet", + "CutoffUnmet": "Cutoff Unmet", "CutoffUnmetLoadError": "Error loading cutoff unmet items", "CutoffUnmetNoItems": "No cutoff unmet items", "Dash": "Dash", diff --git a/src/NzbDrone.Integration.Test/ApiTests/WantedTests/CutoffUnmetFixture.cs b/src/NzbDrone.Integration.Test/ApiTests/WantedTests/CutoffUnmetFixture.cs new file mode 100644 index 000000000..9d14cc39c --- /dev/null +++ b/src/NzbDrone.Integration.Test/ApiTests/WantedTests/CutoffUnmetFixture.cs @@ -0,0 +1,63 @@ +using System.Linq; +using FluentAssertions; +using NUnit.Framework; +using NzbDrone.Core.Qualities; + +namespace NzbDrone.Integration.Test.ApiTests.WantedTests +{ + [TestFixture] + public class CutoffUnmetFixture : IntegrationTest + { + [Test] + [Order(1)] + public void cutoff_should_have_monitored_items() + { + EnsureQualityProfileCutoff(1, Quality.HDTV720p, true); + var movie = EnsureMovie(680, "Pulp Fiction", true); + EnsureMovieFile(movie, Quality.SDTV); + + var result = WantedCutoffUnmet.GetPaged(0, 15, "movieMetadata.year", "desc"); + + result.Records.Should().NotBeEmpty(); + } + + [Test] + [Order(1)] + public void cutoff_should_not_have_unmonitored_items() + { + EnsureQualityProfileCutoff(1, Quality.HDTV720p, true); + var movie = EnsureMovie(680, "Pulp Fiction", false); + EnsureMovieFile(movie, Quality.SDTV); + + var result = WantedCutoffUnmet.GetPaged(0, 15, "movieMetadata.year", "desc"); + + result.Records.Should().BeEmpty(); + } + + [Test] + [Order(1)] + public void cutoff_should_have_series() + { + EnsureQualityProfileCutoff(1, Quality.HDTV720p, true); + var movie = EnsureMovie(680, "Pulp Fiction", true); + EnsureMovieFile(movie, Quality.SDTV); + + var result = WantedCutoffUnmet.GetPaged(0, 15, "movieMetadata.year", "desc"); + + result.Records.First().Title.Should().Be("Pulp Fiction"); + } + + [Test] + [Order(2)] + public void cutoff_should_have_unmonitored_items() + { + EnsureQualityProfileCutoff(1, Quality.HDTV720p, true); + var movie = EnsureMovie(680, "Pulp Fiction", false); + EnsureMovieFile(movie, Quality.SDTV); + + var result = WantedCutoffUnmet.GetPaged(0, 15, "movieMetadata.year", "desc", "monitored", false); + + result.Records.Should().NotBeEmpty(); + } + } +} diff --git a/src/NzbDrone.Integration.Test/ApiTests/WantedTests/MissingFixture.cs b/src/NzbDrone.Integration.Test/ApiTests/WantedTests/MissingFixture.cs new file mode 100644 index 000000000..aef324d90 --- /dev/null +++ b/src/NzbDrone.Integration.Test/ApiTests/WantedTests/MissingFixture.cs @@ -0,0 +1,65 @@ +using System.Linq; +using FluentAssertions; +using NUnit.Framework; + +namespace NzbDrone.Integration.Test.ApiTests.WantedTests +{ + [TestFixture] + public class MissingFixture : IntegrationTest + { + [Test] + [Order(0)] + public void missing_should_be_empty() + { + EnsureNoMovie(680, "Pulp Fiction"); + + var result = WantedMissing.GetPaged(0, 15, "movieMetadata.year", "desc"); + + result.Records.Should().BeEmpty(); + } + + [Test] + [Order(1)] + public void missing_should_have_monitored_items() + { + EnsureMovie(680, "Pulp Fiction", true); + + var result = WantedMissing.GetPaged(0, 15, "movieMetadata.year", "desc"); + + result.Records.Should().NotBeEmpty(); + } + + [Test] + [Order(1)] + public void missing_should_have_series() + { + EnsureMovie(680, "Pulp Fiction", true); + + var result = WantedMissing.GetPaged(0, 15, "movieMetadata.year", "desc"); + + result.Records.First().Title.Should().Be("Pulp Fiction"); + } + + [Test] + [Order(1)] + public void missing_should_not_have_unmonitored_items() + { + EnsureMovie(680, "Pulp Fiction", false); + + var result = WantedMissing.GetPaged(0, 15, "movieMetadata.year", "desc"); + + result.Records.Should().BeEmpty(); + } + + [Test] + [Order(2)] + public void missing_should_have_unmonitored_items() + { + EnsureMovie(680, "Pulp Fiction", false); + + var result = WantedMissing.GetPaged(0, 15, "movieMetadata.year", "desc", "monitored", false); + + result.Records.Should().NotBeEmpty(); + } + } +}