Search in sources :

Example 6 with FilePage

use of com.wikia.webdriver.pageobjectsfactory.pageobject.special.filepage.FilePage in project selenium-tests by Wikia.

the class VideosModuleTests method visitorCanSeeVideosModuleOnArticleAndFilePages.

@Test(groups = { "VideosModule", "VideosModuleTest_001", "Media" })
public void visitorCanSeeVideosModuleOnArticleAndFilePages() {
    new ArticleContent().push(PageContent.ARTICLE_TEXT);
    VideosModuleComponentObject videosModule = new VideosModuleComponentObject(driver);
    new ArticlePageObject().open();
    videosModule.verifyVideosModuleShowing();
    new FilePage().open(VideoContent.YOUTUBE_VIDEO_URL2_FILENAME);
    videosModule.verifyVideosModuleShowing();
}
Also used : ArticleContent(com.wikia.webdriver.common.core.api.ArticleContent) ArticlePageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.article.ArticlePageObject) FilePage(com.wikia.webdriver.pageobjectsfactory.pageobject.special.filepage.FilePage) VideosModuleComponentObject(com.wikia.webdriver.pageobjectsfactory.componentobject.videosmodule.VideosModuleComponentObject) Test(org.testng.annotations.Test)

Example 7 with FilePage

use of com.wikia.webdriver.pageobjectsfactory.pageobject.special.filepage.FilePage 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 8 with FilePage

use of com.wikia.webdriver.pageobjectsfactory.pageobject.special.filepage.FilePage in project selenium-tests by Wikia.

the class ImageServingTests method ImageServing_002_SpecialUploadTest.

@Test(groups = { "ImageServing_002", "ImageServing" }, dataProviderClass = FileDataProvider.class, dataProvider = "getFileNames")
@Execute(asUser = User.USER)
public void ImageServing_002_SpecialUploadTest(String fileName) {
    WikiBasePageObject base = new WikiBasePageObject();
    SpecialUploadPageObject upload = base.openSpecialUpload(wikiURL);
    upload.selectFileToUpload(PageContent.FILE);
    upload.typeFileName(fileName);
    upload.checkIgnoreAnyWarnings();
    FilePage filePage = upload.clickUploadButton();
    filePage.verifySelectedTab("about");
    filePage.verifyHeader(fileName);
    String imageURL = filePage.getImageUrl();
    String imageThumbnailURL = filePage.getImageThumbnailUrl();
    filePage.verifyURLStatus(200, imageURL);
    filePage.verifyURLStatus(200, imageThumbnailURL);
}
Also used : SpecialUploadPageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.special.SpecialUploadPageObject) WikiBasePageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.WikiBasePageObject) FilePage(com.wikia.webdriver.pageobjectsfactory.pageobject.special.filepage.FilePage) Execute(com.wikia.webdriver.common.core.annotations.Execute) Test(org.testng.annotations.Test)

Example 9 with FilePage

use of com.wikia.webdriver.pageobjectsfactory.pageobject.special.filepage.FilePage in project selenium-tests by Wikia.

the class FilePageTests method filePage002_tabsLoggedIn.

/**
   * Verify that file page tabs will save their state for logged in users when they navigate away
   * from the page and back to it.
   */
@Test(groups = { "FilePage", "filePage002_tabsLoggedIn", "Media" })
@Execute(asUser = User.USER)
public void filePage002_tabsLoggedIn() {
    FilePage filePage = new FilePage().open(URLsContent.FILENAME_001);
    filePage.refreshAndVerifyTabs(0);
    filePage.refreshAndVerifyTabs(1);
    filePage.refreshAndVerifyTabs(2);
}
Also used : FilePage(com.wikia.webdriver.pageobjectsfactory.pageobject.special.filepage.FilePage) Execute(com.wikia.webdriver.common.core.annotations.Execute) Test(org.testng.annotations.Test)

Example 10 with FilePage

use of com.wikia.webdriver.pageobjectsfactory.pageobject.special.filepage.FilePage 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)

Aggregations

FilePage (com.wikia.webdriver.pageobjectsfactory.pageobject.special.filepage.FilePage)11 Test (org.testng.annotations.Test)11 Execute (com.wikia.webdriver.common.core.annotations.Execute)6 RelatedIssue (com.wikia.webdriver.common.core.annotations.RelatedIssue)5 DeletePageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.actions.DeletePageObject)5 SpecialVideosPageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.special.SpecialVideosPageObject)4 YoutubeVideo (com.wikia.webdriver.common.core.video.YoutubeVideo)3 VetAddVideoComponentObject (com.wikia.webdriver.pageobjectsfactory.componentobject.vet.VetAddVideoComponentObject)3 WikiBasePageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.WikiBasePageObject)3 SpecialNewFilesPage (com.wikia.webdriver.pageobjectsfactory.pageobject.special.SpecialNewFilesPage)3 InBrowser (com.wikia.webdriver.common.core.annotations.InBrowser)2 UseUnstablePageLoadStrategy (com.wikia.webdriver.common.driverprovider.UseUnstablePageLoadStrategy)2 Notification (com.wikia.webdriver.elements.oasis.components.notifications.Notification)2 LightboxComponentObject (com.wikia.webdriver.pageobjectsfactory.componentobject.lightbox.LightboxComponentObject)2 ArticleContent (com.wikia.webdriver.common.core.api.ArticleContent)1 VideosModuleComponentObject (com.wikia.webdriver.pageobjectsfactory.componentobject.videosmodule.VideosModuleComponentObject)1 RenamePageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.actions.RenamePageObject)1 ArticlePageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.article.ArticlePageObject)1 SpecialRestorePageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.special.SpecialRestorePageObject)1 SpecialUploadPageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.special.SpecialUploadPageObject)1