Search in sources :

Example 1 with SpecialNewFilesPage

use of com.wikia.webdriver.pageobjectsfactory.pageobject.special.SpecialNewFilesPage 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();
}
Also used : DeletePageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.actions.DeletePageObject) SpecialRestorePageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.special.SpecialRestorePageObject) 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 2 with SpecialNewFilesPage

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

the class ImageServingTests method ImageServing_001_SpecialNewFilesTest.

@Test(groups = { "ImageServing_001", "ImageServing", "Smoke3" })
@Execute(asUser = User.USER)
public void ImageServing_001_SpecialNewFilesTest() {
    WikiBasePageObject base = new WikiBasePageObject();
    SpecialNewFilesPage newFiles = base.openSpecialNewFiles(wikiURL);
    newFiles.addPhoto();
    newFiles.clickOnMoreOptions();
    newFiles.checkIgnoreAnyWarnings();
    newFiles.clickOnFewerOptions();
    newFiles.selectFileToUpload(PageContent.FILE);
    newFiles.clickUploadButton();
    newFiles.verifyFileUploaded(PageContent.FILE);
    String imageURL = newFiles.getImageUrl(PageContent.FILE);
    newFiles.verifyURLStatus(200, imageURL);
}
Also used : WikiBasePageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.WikiBasePageObject) SpecialNewFilesPage(com.wikia.webdriver.pageobjectsfactory.pageobject.special.SpecialNewFilesPage) Execute(com.wikia.webdriver.common.core.annotations.Execute) Test(org.testng.annotations.Test)

Example 3 with SpecialNewFilesPage

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

the class ForcedLoginTests method anonCanLogInViaAuthModalWhenAddingFile.

@Test(groups = "ForcedLogin_anonCanLogInViaAuthModalWhenAddingFile")
public void anonCanLogInViaAuthModalWhenAddingFile() {
    WikiBasePageObject base = new WikiBasePageObject();
    SpecialNewFilesPage specialPage = base.openSpecialNewFiles(wikiURL);
    specialPage.verifyPageHeader(specialPage.getTitle());
    specialPage.addPhoto();
    DetachedSignInPage authModal = new DetachedRegisterPage().navigateToSignIn();
    authModal.login(credentials.userName10, credentials.password10);
    AddMediaModalComponentObject modal = new AddMediaModalComponentObject(driver);
    modal.closeAddPhotoModal();
    specialPage.verifyUserLoggedIn(credentials.userName10);
}
Also used : AddMediaModalComponentObject(com.wikia.webdriver.pageobjectsfactory.componentobject.modalwindows.AddMediaModalComponentObject) DetachedRegisterPage(com.wikia.webdriver.pageobjectsfactory.pageobject.auth.register.DetachedRegisterPage) WikiBasePageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.WikiBasePageObject) DetachedSignInPage(com.wikia.webdriver.pageobjectsfactory.pageobject.auth.signin.DetachedSignInPage) SpecialNewFilesPage(com.wikia.webdriver.pageobjectsfactory.pageobject.special.SpecialNewFilesPage) Test(org.testng.annotations.Test)

Example 4 with SpecialNewFilesPage

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

the class LightboxTests method LightboxTest_009_filepage_image.

/**
   * Open lightbox from Special:NewFiles, verify title url, verify More Info button and verify file
   * page (logged-in user)
   */
@Test(groups = "LightboxTest_009")
@RelatedIssue(issueID = "MAIN-6170", comment = "Test manually")
@InBrowser(browser = Browser.FIREFOX, browserSize = BROWSER_SIZE)
public void LightboxTest_009_filepage_image() {
    WikiBasePageObject base = new WikiBasePageObject();
    base.loginAs(credentials.userNameStaff, credentials.passwordStaff, wikiURL);
    SpecialNewFilesPage specialNewFiles = base.openSpecialNewFiles(wikiURL);
    int itemNumber = 2;
    LightboxComponentObject lightbox = specialNewFiles.openLightbox(itemNumber);
    lightbox.verifyLightboxPopup();
    lightbox.verifyLightboxImage();
    // lightbox.verifyTitleUrl(fileUrl);
    // lightbox.verifyMoreInfoUrl(fileUrl);
    FilePage filePage = lightbox.clickTitle();
    filePage.verifyTabsExistImage();
}
Also used : WikiBasePageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.WikiBasePageObject) FilePage(com.wikia.webdriver.pageobjectsfactory.pageobject.special.filepage.FilePage) LightboxComponentObject(com.wikia.webdriver.pageobjectsfactory.componentobject.lightbox.LightboxComponentObject) SpecialNewFilesPage(com.wikia.webdriver.pageobjectsfactory.pageobject.special.SpecialNewFilesPage) Test(org.testng.annotations.Test) RelatedIssue(com.wikia.webdriver.common.core.annotations.RelatedIssue) InBrowser(com.wikia.webdriver.common.core.annotations.InBrowser)

Example 5 with SpecialNewFilesPage

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

the class FollowPhotosTests method FollowPhoto_001_setup.

@Test(groups = "FollowPhoto")
@Execute(asUser = User.USER)
public void FollowPhoto_001_setup() {
    WikiBasePageObject base = new WikiBasePageObject();
    SpecialNewFilesPage special = base.openSpecialNewFiles(wikiURL);
    imageName = special.getRandomImageName();
    WatchPageObject watch = special.unfollowImage(wikiURL, imageName);
    watch.confirmWatchUnwatch();
    special.verifyPageUnfollowed();
}
Also used : WatchPageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.special.watch.WatchPageObject) WikiBasePageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.WikiBasePageObject) SpecialNewFilesPage(com.wikia.webdriver.pageobjectsfactory.pageobject.special.SpecialNewFilesPage) Execute(com.wikia.webdriver.common.core.annotations.Execute) Test(org.testng.annotations.Test)

Aggregations

SpecialNewFilesPage (com.wikia.webdriver.pageobjectsfactory.pageobject.special.SpecialNewFilesPage)7 Test (org.testng.annotations.Test)7 WikiBasePageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.WikiBasePageObject)5 Execute (com.wikia.webdriver.common.core.annotations.Execute)4 RelatedIssue (com.wikia.webdriver.common.core.annotations.RelatedIssue)3 FilePage (com.wikia.webdriver.pageobjectsfactory.pageobject.special.filepage.FilePage)3 UseUnstablePageLoadStrategy (com.wikia.webdriver.common.driverprovider.UseUnstablePageLoadStrategy)2 Notification (com.wikia.webdriver.elements.oasis.components.notifications.Notification)2 DeletePageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.actions.DeletePageObject)2 DetachedRegisterPage (com.wikia.webdriver.pageobjectsfactory.pageobject.auth.register.DetachedRegisterPage)2 InBrowser (com.wikia.webdriver.common.core.annotations.InBrowser)1 LightboxComponentObject (com.wikia.webdriver.pageobjectsfactory.componentobject.lightbox.LightboxComponentObject)1 AddMediaModalComponentObject (com.wikia.webdriver.pageobjectsfactory.componentobject.modalwindows.AddMediaModalComponentObject)1 RenamePageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.actions.RenamePageObject)1 DetachedSignInPage (com.wikia.webdriver.pageobjectsfactory.pageobject.auth.signin.DetachedSignInPage)1 SpecialRestorePageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.special.SpecialRestorePageObject)1 WatchPageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.special.watch.WatchPageObject)1