public void CMSNegativeEditArticleWithoutTitle() { LoginUser user = AccessExcelData.GetTLoginUserData("CreateNewArticle"); BlogArticle article = AccessExcelData.GetArticleTestData("NegativeEditArticleWithoutTitle"); LoginPage loginPage = new LoginPage(driver); CMSPage cmsPage = new CMSPage(driver); loginPage.NavigateTo(); loginPage.FillCredentials(user); var pathToArticle = "//*[@class='col-sm-6']//descendant::a[contains(., '" + article.TargetForEdit + "')]"; IWebElement articleToBeEditedNegative = driver.FindElement(By.XPath(pathToArticle)); cmsPage.NavigateToExistingArticle(article, articleToBeEditedNegative); Assert.IsTrue(cmsPage.ErrorMessageForEmptyTitleOrContent.Contains(article.ArticleErrorMessage)); }
public void CMSEditExistingArticle() { LoginUser user = AccessExcelData.GetTLoginUserData("CreateNewArticle"); BlogArticle article = AccessExcelData.GetArticleTestData("EditExistingArticle"); LoginPage loginPage = new LoginPage(driver); CMSPage cmsPage = new CMSPage(driver); loginPage.NavigateTo(); loginPage.FillCredentials(user); var pathToArticle = "//*[@class='col-sm-6']//descendant::a[contains(., '" + article.TargetForEdit + "')]"; IWebElement articleToBeEdited = driver.FindElement(By.XPath(pathToArticle)); cmsPage.NavigateToExistingArticle(article, articleToBeEdited); var editedArticlePath = "//*[@class='col-sm-6']//descendant::a[contains(., '" + article.Title + "')]"; IList <IWebElement> editedArticleList = driver.FindElements(By.XPath(editedArticlePath)); Assert.IsTrue(true, "true", editedArticleList.Count > 0); }