use of com.wikia.webdriver.pageobjectsfactory.pageobject.actions.DeletePageObject in project selenium-tests by Wikia.
the class BlogCommentsTests method BlogComments_004_Admin_deleteComment.
@Test(groups = "BlogComments_004")
public void BlogComments_004_Admin_deleteComment() {
WikiBasePageObject base = new WikiBasePageObject();
base.loginAs(credentials.userNameStaff, credentials.passwordStaff, wikiURL);
UserProfilePageObject userProfile = base.openProfilePage(credentials.userName, wikiURL);
userProfile.clickOnBlogTab();
BlogPageObject blogPage = userProfile.openFirstPost();
MiniEditorComponentObject editor = blogPage.triggerCommentArea();
String comment = PageContent.COMMENT_TEXT + blogPage.getTimeStamp();
editor.switchAndWrite(comment);
blogPage.submitComment();
blogPage.verifyCommentText(comment);
blogPage.verifyCommentCreator(credentials.userNameStaff);
String commentText = blogPage.getFirstCommentText();
DeletePageObject delete = blogPage.deleteFirstComment();
delete.submitDeletion();
List<Notification> confirmNotifications = blogPage.getNotifications(NotificationType.CONFIRM);
Assertion.assertEquals(confirmNotifications.size(), 1, DeletePageObject.AssertionMessages.INVALID_NUMBER_OF_CONFIRMING_NOTIFICATIONS);
Assertion.assertTrue(confirmNotifications.stream().findFirst().get().isVisible(), DeletePageObject.AssertionMessages.BANNER_NOTIFICATION_NOT_VISIBLE);
blogPage.verifyCommentDeleted(commentText);
}
Aggregations