public void TestIndicatorAndSexAndAgeCanBeBookmarked() { var parameters = new HashParameters(); parameters.AddAreaTypeId(AreaTypeIds.CountyAndUnitaryAuthority); parameters.AddIndicatorId(IndicatorIds.GapInLifeExpectancyAtBirth); parameters.AddSexId(SexIds.Female); parameters.AddAgeId(AgeIds.AllAges); parameters.AddTabId(TabIds.BarChart); navigateTo.GoToUrl(UrlKey + parameters.HashParameterString); waitFor.FingertipsBarChartTableToLoad(); // Check area menu contains searched for area var text = driver.FindElement(By.Id("indicatorDetailsHeader")).Text; TestHelper.AssertTextContains(text, "gap in life expectancy at birth"); TestHelper.AssertTextContains(text, "(Female)"); }
public void TestChangingAreaTypeRepopulatesButRetainsSelectedSupportingIndicator() { var parameters = new HashParameters(); parameters.AddAreaTypeId(AreaTypeIds.CountyAndUnitaryAuthority); parameters.AddIndicatorId(IndicatorIds.GapInLifeExpectancyAtBirth); parameters.AddSexId(SexIds.Persons); parameters.AddAgeId(AgeIds.AllAges); parameters.AddTabId(TabIds.ScatterPlot); navigateTo.GoToUrl(UrlKey + parameters.HashParameterString); waitFor.FingertipsScatterPlotChartToLoad(); var countyUaAreaCount = driver.FindElements(By.CssSelector("#supportingIndicators option")); //Set supporting indicator driver.FindElement(By.CssSelector("div.chosen-container a.chosen-single")).Click(); var searchText = driver.FindElement(By.CssSelector("div.chosen-search input")); searchText.SendKeys("pupil absence"); searchText.SendKeys(Keys.Return); //Change the area type from CountyUa to District var areaTypeDropdown = driver.FindElement(By.Id("areaTypes")); SelectElement clickThis = new SelectElement(areaTypeDropdown); clickThis.SelectByText("District & UA"); waitFor.FingertipsScatterPlotChartToLoad(); var distictUaAreaCount = driver.FindElements(By.CssSelector("#supportingIndicators option")); var selectedSupportinIndicator = driver.FindElement(By.CssSelector("div.chosen-container a.chosen-single span")); Assert.AreNotEqual(countyUaAreaCount, distictUaAreaCount); TestHelper.AssertTextContains(selectedSupportinIndicator.Text, "Pupil absence"); }