public int ValidateImageSearchResults(int maxRes) { Base.MongoDb.UpdateSteps($"Validate Image Search Results."); _browserHelper.ExecutUntillTrue(() => imagesResults.ToList().Count == 30, $"There were less than {maxRes} results.", 30, false); return(imagesResults.ToList().Count()); }
public string ValidateComponents(BsonArray components) { var errors = string.Empty; List <string> componentsstrings = components.ToList().Select(x => x.ToString()).ToList(); componentsstrings.ForEach(c => { IWebElement el = null; Base.MongoDb.UpdateSteps($"Validate Component {c}."); if (!_browserHelper.ExecutUntillTrue(() => el = _driver.FindElement(By.CssSelector(c)), "", 0, false)) { errors += $"Component {c} does not exsist {Environment.NewLine}"; } }); return(errors); }
public string Validatetemplates(BsonArray templateNames) { Base.MongoDb.UpdateSteps($"Validate templates."); List <string> templatesList = null; List <string> templatesNamesList = templateNames.ToList().Select(x => x.ToString()).ToList(); _browserHelper.ExecutUntillTrue(() => { templatesList = _driver.FindElements(By.CssSelector(".templates li[class*='template-']")).Select(e => e.GetAttribute("class")).ToList(); return(templatesList.Count() == templateNames.Count()); }, $"Expected {templateNames.Count()} templates but actul {templatesList} templates."); var errors = string.Empty; templatesNamesList.ForEach(n => { errors += templatesList.Contains(n) ? "" : $"Template {n} hasn't shown {Environment.NewLine}"; }); return(errors); }