Search in sources :

Example 16 with Notification

use of com.wikia.webdriver.elements.oasis.components.notifications.Notification 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

Notification (com.wikia.webdriver.elements.oasis.components.notifications.Notification)16 Test (org.testng.annotations.Test)15 Execute (com.wikia.webdriver.common.core.annotations.Execute)12 RelatedIssue (com.wikia.webdriver.common.core.annotations.RelatedIssue)7 DeletePageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.actions.DeletePageObject)6 ArticlePageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.article.ArticlePageObject)6 EditPreferencesPage (com.wikia.webdriver.pageobjectsfactory.pageobject.special.preferences.EditPreferencesPage)5 PreferencesPageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.special.preferences.PreferencesPageObject)5 UseUnstablePageLoadStrategy (com.wikia.webdriver.common.driverprovider.UseUnstablePageLoadStrategy)4 ArticleContent (com.wikia.webdriver.common.core.api.ArticleContent)3 UserProfilePageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.UserProfilePageObject)3 WikiBasePageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.WikiBasePageObject)3 RenamePageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.actions.RenamePageObject)3 SpecialRestorePageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.special.SpecialRestorePageObject)3 BlogPageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.wikipage.blog.BlogPageObject)3 YoutubeVideo (com.wikia.webdriver.common.core.video.YoutubeVideo)2 MiniEditorComponentObject (com.wikia.webdriver.pageobjectsfactory.componentobject.minieditor.MiniEditorComponentObject)2 SpecialNewFilesPage (com.wikia.webdriver.pageobjectsfactory.pageobject.special.SpecialNewFilesPage)2 SpecialVideosPageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.special.SpecialVideosPageObject)2 FilePage (com.wikia.webdriver.pageobjectsfactory.pageobject.special.filepage.FilePage)2