Search in sources :

Example 6 with SpecialNewFilesPage

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

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

the class FacebookButtonTests method facebookButtonIsVisibleOnForcedLoginModal.

@Test(groups = "FacebookButton_facebookButtonIsVisibleOnForcedLoginModal")
public void facebookButtonIsVisibleOnForcedLoginModal() {
    WikiBasePageObject base = new WikiBasePageObject();
    SpecialNewFilesPage specialPage = base.openSpecialNewFiles(wikiURL);
    specialPage.verifyPageHeader(specialPage.getTitle());
    specialPage.addPhoto();
    DetachedRegisterPage registerPage = new DetachedRegisterPage();
    assertTrue(registerPage.isConnectWithFacebookButtonVisible());
}
Also used : DetachedRegisterPage(com.wikia.webdriver.pageobjectsfactory.pageobject.auth.register.DetachedRegisterPage) WikiBasePageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.WikiBasePageObject) SpecialNewFilesPage(com.wikia.webdriver.pageobjectsfactory.pageobject.special.SpecialNewFilesPage) 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