public string ValidatePostLanguage(CastrPost castrPost, Languages lang) { UpdateStep($"Validating post's language"); var postUrl = castrPost.GetPostUrl(); return(castrPost.GetPostUrl().ToLower().Contains(lang.ToString()) ? "" : $"{postUrl} is not in {lang}"); }
public string ValidatePostInEnglish(CastrPost castrPost, Languages lang) { UpdateStep($"Validating post's language"); var langs = Enum.GetValues(typeof(Languages)) .Cast <Languages>() .Select(v => v.ToString()) .ToList(); return(!castrPost.GetPostUrl().Contains(lang.ToString())? "" : "Post was not in english."); }
public string CheckAllPostsInEnglish() { var errors = string.Empty; foreach (var post in posts.ToList().Where((x, i) => i < 10)) { _browserHelper.Click(post, nameof(post)); CastrPost castrPost = new CastrPost(_browser); errors += ValidateEnglishPosts(castrPost.GetPostUrl()); } return(errors); }
public void Castr_ValidatePostUrl() { _browser.Navigate(_config.Url); HomePage homePage = new HomePage(_browser); homePage.Login(_config.ConfigObject.Users.AdminUser); PostCreator postCreator = new PostCreator(_browser); PostPage postPage = postCreator.Create(typeof(ArticleBase)); string exUrl = _browser.GetUrl(); postPage.HoverOverOptions(); CastrPage CasterPage = postPage.ClickOnOpenInCaster(); _browser.SwitchToLastTab(); CastrPost post = new CastrPost(_browser); string acUrl = post.GetPostUrl().Replace("https", "http"); Assert.AreEqual(exUrl, acUrl); }