use of com.wikia.webdriver.elements.oasis.components.notifications.Notification in project selenium-tests by Wikia.
the class WikiBasePageObject method getNotifications.
public List<Notification> getNotifications() {
List<Notification> notificationList = new ArrayList<>();
for (WebElement notificationElement : notificationElements) {
Notification notification = new Notification(driver, notificationElement);
notificationList.add(notification);
}
return notificationList;
}
use of com.wikia.webdriver.elements.oasis.components.notifications.Notification in project selenium-tests by Wikia.
the class ArticleActionsAdminTests method moveArticle.
@Test(groups = { "ArticleActionsAdmin_002" })
@UseUnstablePageLoadStrategy
@Execute(asUser = User.STAFF)
public void moveArticle() {
new ArticleContent().push(PageContent.ARTICLE_TEXT);
ArticlePageObject article = new ArticlePageObject().open();
String articleOldTitle = article.getArticleTitle();
String articleNewName = TestContext.getCurrentMethodName() + article.getTimeStamp();
RenamePageObject renamePage = article.renameUsingDropdown();
renamePage.rename(articleNewName, false);
List<Notification> confirmNotifications = article.getNotifications(NotificationType.CONFIRM);
Assertion.assertEquals(confirmNotifications.size(), 1, SpecialRestorePageObject.AssertionMessages.INVALID_NUMBER_OF_CONFIRMING_NOTIFICATIONS);
Assertion.assertEquals(confirmNotifications.stream().findFirst().get().getMessage(), "\"" + articleOldTitle + "\" has been renamed \"" + articleNewName + "\"", "Banner notification messsage is invalid");
Assertion.assertEquals(article.getArticleName(), articleNewName, "New article title is invalid");
}
use of com.wikia.webdriver.elements.oasis.components.notifications.Notification in project selenium-tests by Wikia.
the class BlogTests method BlogTests_005_move.
@Test(groups = { "BlogTests_005", "BlogTests" })
public void BlogTests_005_move() {
WikiBasePageObject base = new WikiBasePageObject();
base.loginAs(credentials.userNameStaff, credentials.passwordStaff, wikiURL);
String blogTitleMove = PageContent.BLOG_POST_NAME_PREFIX + base.getTimeStamp();
UserProfilePageObject userProfile = base.openProfilePage(credentials.userName, wikiURL);
userProfile.clickOnBlogTab();
BlogPageObject blogPage = userProfile.openFirstPost();
RenamePageObject renamePage = blogPage.renameUsingDropdown();
renamePage.rename(credentials.userNameStaff + "/" + blogTitleMove, true);
blogPage.verifyBlogTitle(blogTitleMove);
List<Notification> confirmNotifications = blogPage.getNotifications(NotificationType.CONFIRM);
Assertion.assertEquals(confirmNotifications.size(), 1, RenamePageObject.AssertionMessages.INVALID_NUMBER_OF_CONFIRMING_NOTIFICATIONS);
Assertion.assertTrue(confirmNotifications.stream().findFirst().get().isVisible(), RenamePageObject.AssertionMessages.BANNER_NOTIFICATION_NOT_VISIBLE);
}
use of com.wikia.webdriver.elements.oasis.components.notifications.Notification in project selenium-tests by Wikia.
the class ImageStorageTests method ImageStorage_001_deleteImage.
@Test(groups = { "ImageStorageTests", "ImageStorage_001" })
@UseUnstablePageLoadStrategy
@Execute(asUser = User.USER_2)
@RelatedIssue(issueID = "QAART-1028")
public void ImageStorage_001_deleteImage() {
SpecialNewFilesPage filesPage = new SpecialNewFilesPage().openSpecialNewFiles(wikiURL);
filesPage.addPhoto();
filesPage.selectFileToUpload(PageContent.FILE);
String fileName = DateTime.now().getMillis() + PageContent.FILE;
filesPage.clickOnMoreOptions();
filesPage.setFileName(fileName);
filesPage.checkIgnoreAnyWarnings();
filesPage.clickUploadButton();
filesPage.verifyFileUploaded(fileName);
FilePage file = new FilePage().open(fileName, true);
imageURL = file.getImageUrl();
imageThumbnailURL = file.getImageThumbnailUrl();
file.verifyURLStatus(200, imageURL);
file.verifyURLStatus(200, imageThumbnailURL);
file.loginAs(User.STAFF);
DeletePageObject delete = file.deletePage();
delete.submitDeletion();
List<Notification> confirmNotifications = filesPage.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);
filesPage.verifyURLStatus(404, imageURL);
filesPage.verifyURLStatus(404, imageThumbnailURL);
confirmNotifications = delete.getNotifications(NotificationType.CONFIRM);
Assertion.assertEquals(confirmNotifications.size(), 1, DeletePageObject.AssertionMessages.INVALID_NUMBER_OF_CONFIRMING_NOTIFICATIONS);
SpecialRestorePageObject restore = confirmNotifications.stream().findFirst().get().undelete();
restore.giveReason(PageContent.CAPTION);
restore.restorePage();
confirmNotifications = restore.getNotifications(NotificationType.CONFIRM);
Assertion.assertEquals(confirmNotifications.size(), 1, SpecialRestorePageObject.AssertionMessages.INVALID_NUMBER_OF_CONFIRMING_NOTIFICATIONS);
Assertion.assertTrue(confirmNotifications.stream().findFirst().get().isVisible(), SpecialRestorePageObject.AssertionMessages.BANNER_NOTIFICATION_NOT_VISIBLE);
file.verifyURLStatus(200, imageURL);
file.verifyURLStatus(200, imageThumbnailURL);
file.deletePage();
delete.submitDeletion();
}
use of com.wikia.webdriver.elements.oasis.components.notifications.Notification in project selenium-tests by Wikia.
the class EditingPreferencesTests method EditPreferences_001_selectVE.
@Test(groups = { "EditPreferences_001" })
@Execute(asUser = User.USER_5, onWikia = URLsContent.VE_ENABLED_WIKI)
@RelatedIssue(issueID = "MAIN-9722", comment = "test failing randomly")
public void EditPreferences_001_selectVE() {
EditPreferencesPage editPrefPage = new EditPreferencesPage(driver).openEditingSection();
editPrefPage.selectPreferredEditor(VE);
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);
VisualEditorPageObject ve = aritclePage.openVEModeWithMainEditButton();
ve.verifyVEToolBarPresent();
ve.verifyEditorSurfacePresent();
}
Aggregations