Search in sources :

Example 11 with Notification

use of com.wikia.webdriver.elements.oasis.components.notifications.Notification in project selenium-tests by Wikia.

the class EditingPreferencesTests method changeEmailAddress.

@Test(groups = { "EditPreferences_004" })
@Execute(asUser = User.USER_5)
public void changeEmailAddress() {
    EditPreferencesPage editPrefPage = new EditPreferencesPage(driver).openEmailSection();
    String newEmailAddress = EmailUtils.getEmail(editPrefPage.getEmailAdress());
    EmailUtils.deleteAllEmails(USERNAME, PASSWORD);
    Assertion.assertNotEquals(newEmailAddress, editPrefPage.getEmailAdress(), "New email and old email SHOULD NOT be the same");
    editPrefPage.changeEmail(newEmailAddress);
    PreferencesPageObject prefPage = editPrefPage.clickSaveButton();
    List<Notification> confirmNotifications = prefPage.getNotifications(NotificationType.CONFIRM);
    Assertion.assertEquals(confirmNotifications.size(), 1, PreferencesPageObject.AssertionMessages.INVALID_NUMBER_OF_CONFIRMING_NOTIFICATIONS);
    Assertion.assertTrue(confirmNotifications.stream().findFirst().get().isVisible(), PreferencesPageObject.AssertionMessages.BANNER_NOTIFICATION_NOT_VISIBLE);
    editPrefPage.enterEmailChangeLink(USERNAME, PASSWORD);
    editPrefPage.openEmailSection();
    Assertion.assertEquals(editPrefPage.getEmailAdress(), newEmailAddress, "Email address doesn't equal to new email address");
}
Also used : EditPreferencesPage(com.wikia.webdriver.pageobjectsfactory.pageobject.special.preferences.EditPreferencesPage) PreferencesPageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.special.preferences.PreferencesPageObject) Notification(com.wikia.webdriver.elements.oasis.components.notifications.Notification) Execute(com.wikia.webdriver.common.core.annotations.Execute) Test(org.testng.annotations.Test)

Example 12 with Notification

use of com.wikia.webdriver.elements.oasis.components.notifications.Notification in project selenium-tests by Wikia.

the class EditingPreferencesTests method EditPreferences_003_selectSource.

@Test(groups = { "EditPreferences_003" })
@Execute(asUser = User.USER_5, onWikia = URLsContent.VE_ENABLED_WIKI)
public void EditPreferences_003_selectSource() {
    EditPreferencesPage editPrefPage = new EditPreferencesPage(driver).openEditingSection();
    editPrefPage.selectPreferredEditor(SOURCE);
    PreferencesPageObject prefPage = editPrefPage.clickSaveButton();
    List<Notification> confirmNotifications = prefPage.getNotifications(NotificationType.CONFIRM);
    Assertion.assertEquals(confirmNotifications.size(), 1, PreferencesPageObject.AssertionMessages.INVALID_NUMBER_OF_CONFIRMING_NOTIFICATIONS);
    Assertion.assertTrue(confirmNotifications.stream().findFirst().get().isVisible(), PreferencesPageObject.AssertionMessages.BANNER_NOTIFICATION_NOT_VISIBLE);
    String articleName = PageContent.ARTICLE_NAME_PREFIX + DateTime.now().getMillis();
    ArticlePageObject aritclePage = new ArticlePageObject().open(articleName);
    SourceEditModePageObject src = aritclePage.openSrcModeWithMainEditButton();
    src.verifySourceOnlyMode();
}
Also used : ArticlePageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.article.ArticlePageObject) EditPreferencesPage(com.wikia.webdriver.pageobjectsfactory.pageobject.special.preferences.EditPreferencesPage) SourceEditModePageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.article.editmode.SourceEditModePageObject) PreferencesPageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.special.preferences.PreferencesPageObject) Notification(com.wikia.webdriver.elements.oasis.components.notifications.Notification) Execute(com.wikia.webdriver.common.core.annotations.Execute) Test(org.testng.annotations.Test)

Example 13 with Notification

use of com.wikia.webdriver.elements.oasis.components.notifications.Notification in project selenium-tests by Wikia.

the class EditingPreferencesTests method EditPreferences_002_selectCK.

@Test(groups = { "EditPreferences_002" })
@Execute(asUser = User.USER_5, onWikia = URLsContent.VE_ENABLED_WIKI)
@RelatedIssue(issueID = "MAIN-9722", comment = "test failing randomly")
public void EditPreferences_002_selectCK() {
    EditPreferencesPage editPrefPage = new EditPreferencesPage(driver).openEditingSection();
    editPrefPage.selectPreferredEditor(CK);
    PreferencesPageObject prefPage = editPrefPage.clickSaveButton();
    List<Notification> confirmNotifications = prefPage.getNotifications(NotificationType.CONFIRM);
    Assertion.assertEquals(confirmNotifications.size(), 1, PreferencesPageObject.AssertionMessages.INVALID_NUMBER_OF_CONFIRMING_NOTIFICATIONS);
    Assertion.assertTrue(confirmNotifications.stream().findFirst().get().isVisible(), PreferencesPageObject.AssertionMessages.BANNER_NOTIFICATION_NOT_VISIBLE);
    String articleName = PageContent.ARTICLE_NAME_PREFIX + DateTime.now().getMillis();
    ArticlePageObject aritclePage = new ArticlePageObject().open(articleName);
    VisualEditModePageObject ck = aritclePage.navigateToArticleEditPage();
    Assertion.assertTrue(ck.isContentLoaded(), "Content is not loaded");
    ck.clickPublishButton();
}
Also used : ArticlePageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.article.ArticlePageObject) EditPreferencesPage(com.wikia.webdriver.pageobjectsfactory.pageobject.special.preferences.EditPreferencesPage) PreferencesPageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.special.preferences.PreferencesPageObject) VisualEditModePageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.article.editmode.VisualEditModePageObject) Notification(com.wikia.webdriver.elements.oasis.components.notifications.Notification) Execute(com.wikia.webdriver.common.core.annotations.Execute) Test(org.testng.annotations.Test) RelatedIssue(com.wikia.webdriver.common.core.annotations.RelatedIssue)

Example 14 with Notification

use of com.wikia.webdriver.elements.oasis.components.notifications.Notification in project selenium-tests by Wikia.

the class ArticleActionsAdminTests method deleteUndeleteArticle.

@Test(groups = { "ArticleActionsAdmin_001" })
@UseUnstablePageLoadStrategy
@RelatedIssue(issueID = "MAIN-9808", comment = "problems with banner notifications")
@Execute(asUser = User.STAFF)
public void deleteUndeleteArticle() {
    String articleTitle = "DeleteUndeleArticle";
    new ArticleContent().push(PageContent.ARTICLE_TEXT, articleTitle);
    ArticlePageObject article = new ArticlePageObject().open(articleTitle);
    DeletePageObject deletePage = article.deleteUsingDropdown();
    deletePage.submitDeletion();
    List<Notification> confirmNotifications = article.getNotifications(NotificationType.CONFIRM);
    Assertion.assertEquals(confirmNotifications.size(), 1, SpecialRestorePageObject.AssertionMessages.INVALID_NUMBER_OF_CONFIRMING_NOTIFICATIONS);
    SpecialRestorePageObject restore = article.getNotifications(NotificationType.CONFIRM).stream().findFirst().get().undelete();
    restore.verifyRestoredArticleName(articleTitle);
    restore.giveReason(article.getTimeStamp());
    restore.restorePage();
    confirmNotifications = article.getNotifications(NotificationType.CONFIRM);
    Assertion.assertEquals(confirmNotifications.size(), 1, SpecialRestorePageObject.AssertionMessages.INVALID_NUMBER_OF_CONFIRMING_NOTIFICATIONS);
    Assertion.assertTrue(confirmNotifications.stream().findFirst().get().isVisible());
    article.verifyArticleTitle(articleTitle);
}
Also used : ArticleContent(com.wikia.webdriver.common.core.api.ArticleContent) ArticlePageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.article.ArticlePageObject) DeletePageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.actions.DeletePageObject) SpecialRestorePageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.special.SpecialRestorePageObject) Notification(com.wikia.webdriver.elements.oasis.components.notifications.Notification) UseUnstablePageLoadStrategy(com.wikia.webdriver.common.driverprovider.UseUnstablePageLoadStrategy) Execute(com.wikia.webdriver.common.core.annotations.Execute) Test(org.testng.annotations.Test) RelatedIssue(com.wikia.webdriver.common.core.annotations.RelatedIssue)

Example 15 with Notification

use of com.wikia.webdriver.elements.oasis.components.notifications.Notification in project selenium-tests by Wikia.

the class ArticleCommentsTests method ArticleComments_004_deleteComment.

@Test(groups = "ArticleComments_004")
@Execute(asUser = User.STAFF)
public void ArticleComments_004_deleteComment() {
    new ArticleContent().push(PageContent.ARTICLE_TEXT);
    ArticlePageObject article = new ArticlePageObject().open();
    String comment = PageContent.COMMENT_TEXT + article.getTimeStamp();
    MiniEditorComponentObject editor = article.triggerCommentArea();
    editor.switchAndWrite(comment);
    article.submitComment();
    article.verifyCommentText(comment);
    article.verifyCommentCreator(credentials.userNameStaff);
    String commentText = article.getFirstCommentText();
    DeletePageObject delete = article.deleteFirstComment();
    delete.submitDeletion();
    List<Notification> confirmNotifications = article.getNotifications(NotificationType.CONFIRM);
    Assertion.assertEquals(confirmNotifications.size(), 1, DeletePageObject.AssertionMessages.INVALID_NUMBER_OF_CONFIRMING_NOTIFICATIONS);
    Assertion.assertTrue(confirmNotifications.stream().findFirst().get().isVisible());
    article.verifyCommentDeleted(commentText);
}
Also used : MiniEditorComponentObject(com.wikia.webdriver.pageobjectsfactory.componentobject.minieditor.MiniEditorComponentObject) ArticleContent(com.wikia.webdriver.common.core.api.ArticleContent) ArticlePageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.article.ArticlePageObject) DeletePageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.actions.DeletePageObject) Notification(com.wikia.webdriver.elements.oasis.components.notifications.Notification) Execute(com.wikia.webdriver.common.core.annotations.Execute) 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