use of com.wikia.webdriver.elements.oasis.components.notifications.Notification in project selenium-tests by Wikia.
the class VideosPageTests method VideosPageTest_003_deleteVideo_removedFromRecentVideos.
/**
* Checks if a video can successfully be deleted from the Special:Videos page. Specifically, this
* test checks if, after the video has been deleted, it is no longer present in the list of most
* recent videos on Special:Videos. (Note: in order to accomplish this the test also adds a video
* before hand to ensure that 1.) the test is sustainable, and 2.) it knows what the most recent
* video is).
*/
@Execute(asUser = User.STAFF)
@Test(groups = { "VideosPage", "VideosPageTest_003", "Media" })
@RelatedIssue(issueID = "SUS-863")
public void VideosPageTest_003_deleteVideo_removedFromRecentVideos() {
SpecialVideosPageObject specialVideos = new SpecialVideosPageObject(driver);
YoutubeVideo video = YoutubeVideoProvider.getLatestVideoForQuery(VIDEO_QUERY);
specialVideos.addVideoViaAjax(video.getUrl());
Assertion.assertTrue(specialVideos.isNewVideoAdded());
String addedVideoTitle = specialVideos.getNewestVideoTitle();
specialVideos.deleteNewestVideo();
List<Notification> confirmNotifications = specialVideos.getNotifications(NotificationType.CONFIRM);
Assertion.assertEquals(confirmNotifications.size(), 1, SpecialVideosPageObject.AssertionMessages.INVALID_NUMBER_OF_CONFIRMING_NOTIFICATIONS);
Notification notification = confirmNotifications.stream().findFirst().get();
Assertion.assertTrue(notification.isVisible(), SpecialVideosPageObject.AssertionMessages.BANNER_NOTIFICATION_NOT_VISIBLE);
Assertion.assertStringContains(notification.getMessage(), addedVideoTitle);
Assertion.assertNotEquals(specialVideos.getNewestVideoTitle(), addedVideoTitle, "Video is still visible as newest video");
}
use of com.wikia.webdriver.elements.oasis.components.notifications.Notification in project selenium-tests by Wikia.
the class BlogTests method BlogTests_004_deleteUndelete.
@Test(groups = { "BlogTests_004", "BlogTests" })
public void BlogTests_004_deleteUndelete() {
WikiBasePageObject base = new WikiBasePageObject();
base.loginAs(credentials.userNameStaff, credentials.passwordStaff, wikiURL);
UserProfilePageObject userProfile = base.openProfilePage(credentials.userName4, wikiURL);
userProfile.clickOnBlogTab();
BlogPageObject blogPage = userProfile.openFirstPost();
String blogTitle = blogPage.getBlogName();
DeletePageObject deletePage = blogPage.deleteUsingDropdown();
deletePage.submitDeletion();
List<Notification> confirmNotifications = base.getNotifications(NotificationType.CONFIRM);
Assertion.assertEquals(confirmNotifications.size(), 1, DeletePageObject.AssertionMessages.INVALID_NUMBER_OF_CONFIRMING_NOTIFICATIONS);
SpecialRestorePageObject restore = base.getNotifications(NotificationType.CONFIRM).stream().findFirst().get().undelete();
restore.giveReason(blogPage.getTimeStamp());
restore.restorePage();
confirmNotifications = blogPage.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);
blogPage.verifyBlogTitle(blogTitle);
}
use of com.wikia.webdriver.elements.oasis.components.notifications.Notification in project selenium-tests by Wikia.
the class ImageStorageTests method ImageStorage_002_moveImage.
@Test(groups = { "ImageStorageTests", "ImageStorage_002" })
@UseUnstablePageLoadStrategy
@Execute(asUser = User.STAFF)
@RelatedIssue(issueID = "QAART-921")
public void ImageStorage_002_moveImage() {
String fileName = DateTime.now().getMillis() + PageContent.FILE;
new SpecialNewFilesPage().openSpecialNewFiles(wikiURL).addPhoto().selectFileToUpload(PageContent.FILE).hideWarnings().clickOnMoreOptions().setFileName(fileName).checkIgnoreAnyWarnings().clickUploadButton().verifyFileUploaded(fileName);
FilePage file = new FilePage().open(fileName, true);
RenamePageObject renamePage = file.renameUsingDropdown();
String imageNewName = DateTime.now().getMillis() + PageContent.FILERENAME;
renamePage.rename(imageNewName, true);
List<Notification> confirmNotifications = file.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);
file.verifyHeader(imageNewName);
file = new FilePage().open(imageNewName, true);
renamePage = file.renameUsingDropdown();
renamePage.rename(fileName, true);
confirmNotifications = file.getNotifications(NotificationType.CONFIRM);
Assertion.assertTrue(confirmNotifications.size() == 1, RenamePageObject.AssertionMessages.INVALID_NUMBER_OF_CONFIRMING_NOTIFICATIONS);
Assertion.assertTrue(confirmNotifications.stream().findFirst().get().isVisible(), RenamePageObject.AssertionMessages.BANNER_NOTIFICATION_NOT_VISIBLE);
file.verifyHeader(fileName);
DeletePageObject delete = file.deletePage();
delete.submitDeletion();
}
use of com.wikia.webdriver.elements.oasis.components.notifications.Notification in project selenium-tests by Wikia.
the class UserAndRights method blockedUserShouldBeAbleToChangeEmail.
@Test(groups = { "usersAndRights003" }, dependsOnMethods = { "staffCanBlockUser" })
@Execute(asUser = User.BLOCKED_USER)
public void blockedUserShouldBeAbleToChangeEmail() {
String username = Configuration.getCredentials().emailQaart2;
String password = Configuration.getCredentials().emailPasswordQaart2;
EditPreferencesPage editPrefPage = new EditPreferencesPage(driver).openEmailSection();
editPrefPage.verifyUserLoggedIn(User.BLOCKED_USER);
editPrefPage.openEmailSection();
EmailUtils.deleteAllEmails(username, password);
String newEmailAddress = EmailUtils.getEmail(editPrefPage.getEmailAdress());
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);
prefPage.enterEmailChangeLink(username, password);
editPrefPage.openEmailSection();
Assertion.assertEquals(editPrefPage.getEmailAdress(), newEmailAddress);
}
use of com.wikia.webdriver.elements.oasis.components.notifications.Notification in project selenium-tests by Wikia.
the class VideosPageTests method VideosPageTest_002_deleteVideo_notificationContainsTitle.
/**
* Checks if a video can successfully be deleted from the Special:Videos page. Specifically, this
* test checks if, after the video has been deleted, its title shows up in the delete confirmation
* presented by Global Notifications. (Note: This test also adds a video beforehand to make sure
* running this test is sustainable).
*/
@Execute(asUser = User.STAFF)
@Test(groups = { "VideosPage", "VideosPageTest_002", "Media" })
@RelatedIssue(issueID = "SUS-755")
public void VideosPageTest_002_deleteVideo_notificationContainsTitle() {
SpecialVideosPageObject specialVideos = new SpecialVideosPageObject(driver);
YoutubeVideo video = YoutubeVideoProvider.getLatestVideoForQuery(VIDEO_QUERY);
specialVideos.addVideoViaAjax(video.getUrl());
Assertion.assertTrue(specialVideos.isNewVideoAdded());
String addedVideoTitle = specialVideos.getNewestVideoTitle();
String addedVideoTitlePattern = addedVideoTitle;
if (addedVideoTitle.endsWith(SUFFIX_FOR_LONG_TITLE)) {
addedVideoTitlePattern = addedVideoTitle.replace(SUFFIX_FOR_LONG_TITLE, "");
}
specialVideos.deleteNewestVideo();
List<Notification> confirmNotifications = specialVideos.getNotifications(NotificationType.CONFIRM);
Assertion.assertEquals(confirmNotifications.size(), 1, SpecialVideosPageObject.AssertionMessages.INVALID_NUMBER_OF_CONFIRMING_NOTIFICATIONS);
Notification notification = confirmNotifications.stream().findFirst().get();
Assertion.assertTrue(notification.isVisible(), SpecialVideosPageObject.AssertionMessages.BANNER_NOTIFICATION_NOT_VISIBLE);
Assertion.assertStringContains(notification.getMessage(), addedVideoTitlePattern);
}
Aggregations