use of com.wikia.webdriver.pageobjectsfactory.pageobject.actions.DeletePageObject 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.pageobjectsfactory.pageobject.actions.DeletePageObject in project selenium-tests by Wikia.
the class FilePageTests method filePage004_delete.
/**
* Verify that a video can be deleted from the File page
*/
@RelatedIssue(issueID = "MAIN-4294")
@Test(groups = { "FilePage", "filePage004_delete", "Media" })
public void filePage004_delete() {
// Go to Special:Videos to add a video
YoutubeVideo video = YoutubeVideoProvider.getLatestVideoForQuery("data");
SpecialVideosPageObject specialVideos = new SpecialVideosPageObject(driver);
specialVideos.loginAs(credentials.userNameStaff, credentials.passwordStaff, wikiURL);
specialVideos.openSpecialVideoPage(wikiURL);
// Add a Youtube video we'll delete
VetAddVideoComponentObject vetAddingVideo = specialVideos.clickAddAVideo();
vetAddingVideo.addVideoByUrl(video.getUrl());
// Verify the video is actually there
specialVideos.verifyVideoAdded(video.getTitle());
// Now delete the video
FilePage filePage = new FilePage().open(video.getFileName());
DeletePageObject deletePage = filePage.deletePage();
deletePage.submitDeletion();
// Go back to the file page and make sure its gone
filePage = filePage.open(video.getFileName());
filePage.verifyEmptyFilePage();
}
use of com.wikia.webdriver.pageobjectsfactory.pageobject.actions.DeletePageObject 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);
}
use of com.wikia.webdriver.pageobjectsfactory.pageobject.actions.DeletePageObject in project selenium-tests by Wikia.
the class VetSpecialVideosTests method SpecialVideos_001_Provider.
@Test(groups = { "VetTests001" })
@Execute(asUser = User.USER)
public void SpecialVideos_001_Provider() {
YoutubeVideo video = YoutubeVideoProvider.getLatestVideoForQuery("flower");
SpecialVideosPageObject specialVideos = new SpecialVideosPageObject(driver);
specialVideos.openSpecialVideoPage(wikiURL);
VetAddVideoComponentObject vetAddingVideo = specialVideos.clickAddAVideo();
vetAddingVideo.addVideoByUrl(video.getUrl());
specialVideos.verifyVideoAdded(video.getTitle());
FilePage filePage = new FilePage().open(video.getFileName());
// filePage.getGlobalNavigation().openAccountNavigation().clickLogOut();
filePage.loginAs(credentials.userNameStaff, credentials.passwordStaff, wikiURL);
DeletePageObject deletePage = filePage.deletePage();
deletePage.submitDeletion();
filePage = filePage.open(video.getFileName());
filePage.verifyEmptyFilePage();
}
use of com.wikia.webdriver.pageobjectsfactory.pageobject.actions.DeletePageObject 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);
}
Aggregations