Search in sources :

Example 11 with DeletePageObject

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);
}
Also used : MiniEditorComponentObject(com.wikia.webdriver.pageobjectsfactory.componentobject.minieditor.MiniEditorComponentObject) BlogPageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.wikipage.blog.BlogPageObject) DeletePageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.actions.DeletePageObject) WikiBasePageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.WikiBasePageObject) UserProfilePageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.UserProfilePageObject) Notification(com.wikia.webdriver.elements.oasis.components.notifications.Notification) Test(org.testng.annotations.Test)

Aggregations

DeletePageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.actions.DeletePageObject)11 Test (org.testng.annotations.Test)10 Execute (com.wikia.webdriver.common.core.annotations.Execute)6 Notification (com.wikia.webdriver.elements.oasis.components.notifications.Notification)6 RelatedIssue (com.wikia.webdriver.common.core.annotations.RelatedIssue)5 FilePage (com.wikia.webdriver.pageobjectsfactory.pageobject.special.filepage.FilePage)5 YoutubeVideo (com.wikia.webdriver.common.core.video.YoutubeVideo)3 UseUnstablePageLoadStrategy (com.wikia.webdriver.common.driverprovider.UseUnstablePageLoadStrategy)3 VetAddVideoComponentObject (com.wikia.webdriver.pageobjectsfactory.componentobject.vet.VetAddVideoComponentObject)3 WikiBasePageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.WikiBasePageObject)3 ArticlePageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.article.ArticlePageObject)3 SpecialRestorePageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.special.SpecialRestorePageObject)3 SpecialVideosPageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.special.SpecialVideosPageObject)3 ArticleContent (com.wikia.webdriver.common.core.api.ArticleContent)2 MiniEditorComponentObject (com.wikia.webdriver.pageobjectsfactory.componentobject.minieditor.MiniEditorComponentObject)2 UserProfilePageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.UserProfilePageObject)2 SpecialNewFilesPage (com.wikia.webdriver.pageobjectsfactory.pageobject.special.SpecialNewFilesPage)2 BlogPageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.wikipage.blog.BlogPageObject)2 RenamePageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.actions.RenamePageObject)1 CreateNewWikiPageObjectStep1 (com.wikia.webdriver.pageobjectsfactory.pageobject.createnewwiki.CreateNewWikiPageObjectStep1)1