Search in sources :

Example 6 with DeletePageObject

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();
}
Also used : RenamePageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.actions.RenamePageObject) DeletePageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.actions.DeletePageObject) FilePage(com.wikia.webdriver.pageobjectsfactory.pageobject.special.filepage.FilePage) SpecialNewFilesPage(com.wikia.webdriver.pageobjectsfactory.pageobject.special.SpecialNewFilesPage) 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 7 with DeletePageObject

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();
}
Also used : DeletePageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.actions.DeletePageObject) YoutubeVideo(com.wikia.webdriver.common.core.video.YoutubeVideo) VetAddVideoComponentObject(com.wikia.webdriver.pageobjectsfactory.componentobject.vet.VetAddVideoComponentObject) FilePage(com.wikia.webdriver.pageobjectsfactory.pageobject.special.filepage.FilePage) SpecialVideosPageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.special.SpecialVideosPageObject) Test(org.testng.annotations.Test) RelatedIssue(com.wikia.webdriver.common.core.annotations.RelatedIssue)

Example 8 with DeletePageObject

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);
}
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 9 with DeletePageObject

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();
}
Also used : DeletePageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.actions.DeletePageObject) YoutubeVideo(com.wikia.webdriver.common.core.video.YoutubeVideo) VetAddVideoComponentObject(com.wikia.webdriver.pageobjectsfactory.componentobject.vet.VetAddVideoComponentObject) FilePage(com.wikia.webdriver.pageobjectsfactory.pageobject.special.filepage.FilePage) SpecialVideosPageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.special.SpecialVideosPageObject) Execute(com.wikia.webdriver.common.core.annotations.Execute) Test(org.testng.annotations.Test)

Example 10 with DeletePageObject

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);
}
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

DeletePageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.actions.DeletePageObject)11 Test (org.testng.annotations.Test)10 Execute (com.wikia.webdriver.common.core.annotations.Execute)6 Notification (com.wikia.webdriver.elements.oasis.components.notifications.Notification)6 RelatedIssue (com.wikia.webdriver.common.core.annotations.RelatedIssue)5 FilePage (com.wikia.webdriver.pageobjectsfactory.pageobject.special.filepage.FilePage)5 YoutubeVideo (com.wikia.webdriver.common.core.video.YoutubeVideo)3 UseUnstablePageLoadStrategy (com.wikia.webdriver.common.driverprovider.UseUnstablePageLoadStrategy)3 VetAddVideoComponentObject (com.wikia.webdriver.pageobjectsfactory.componentobject.vet.VetAddVideoComponentObject)3 WikiBasePageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.WikiBasePageObject)3 ArticlePageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.article.ArticlePageObject)3 SpecialRestorePageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.special.SpecialRestorePageObject)3 SpecialVideosPageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.special.SpecialVideosPageObject)3 ArticleContent (com.wikia.webdriver.common.core.api.ArticleContent)2 MiniEditorComponentObject (com.wikia.webdriver.pageobjectsfactory.componentobject.minieditor.MiniEditorComponentObject)2 UserProfilePageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.UserProfilePageObject)2 SpecialNewFilesPage (com.wikia.webdriver.pageobjectsfactory.pageobject.special.SpecialNewFilesPage)2 BlogPageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.wikipage.blog.BlogPageObject)2 RenamePageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.actions.RenamePageObject)1 CreateNewWikiPageObjectStep1 (com.wikia.webdriver.pageobjectsfactory.pageobject.createnewwiki.CreateNewWikiPageObjectStep1)1