Search in sources :

Example 1 with SpecialRestorePageObject

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

the class Notification method undelete.

public SpecialRestorePageObject undelete() {
    WebElement undeleteLink = wait.forElementVisible(undeleteLinkBy);
    undeleteLink.click();
    return new SpecialRestorePageObject(driver);
}
Also used : SpecialRestorePageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.special.SpecialRestorePageObject) WebElement(org.openqa.selenium.WebElement)

Example 2 with SpecialRestorePageObject

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

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

the class BlogTests method BlogTests_004_deleteUndelete.

@Test(groups = { "BlogTests_004", "BlogTests" })
public void BlogTests_004_deleteUndelete() {
    WikiBasePageObject base = new WikiBasePageObject();
    base.loginAs(credentials.userNameStaff, credentials.passwordStaff, wikiURL);
    UserProfilePageObject userProfile = base.openProfilePage(credentials.userName4, wikiURL);
    userProfile.clickOnBlogTab();
    BlogPageObject blogPage = userProfile.openFirstPost();
    String blogTitle = blogPage.getBlogName();
    DeletePageObject deletePage = blogPage.deleteUsingDropdown();
    deletePage.submitDeletion();
    List<Notification> confirmNotifications = base.getNotifications(NotificationType.CONFIRM);
    Assertion.assertEquals(confirmNotifications.size(), 1, DeletePageObject.AssertionMessages.INVALID_NUMBER_OF_CONFIRMING_NOTIFICATIONS);
    SpecialRestorePageObject restore = base.getNotifications(NotificationType.CONFIRM).stream().findFirst().get().undelete();
    restore.giveReason(blogPage.getTimeStamp());
    restore.restorePage();
    confirmNotifications = blogPage.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);
    blogPage.verifyBlogTitle(blogTitle);
}
Also used : BlogPageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.wikipage.blog.BlogPageObject) DeletePageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.actions.DeletePageObject) WikiBasePageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.WikiBasePageObject) SpecialRestorePageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.special.SpecialRestorePageObject) UserProfilePageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.UserProfilePageObject) Notification(com.wikia.webdriver.elements.oasis.components.notifications.Notification) Test(org.testng.annotations.Test)

Example 4 with SpecialRestorePageObject

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

Aggregations

SpecialRestorePageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.special.SpecialRestorePageObject)4 Notification (com.wikia.webdriver.elements.oasis.components.notifications.Notification)3 DeletePageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.actions.DeletePageObject)3 Test (org.testng.annotations.Test)3 Execute (com.wikia.webdriver.common.core.annotations.Execute)2 RelatedIssue (com.wikia.webdriver.common.core.annotations.RelatedIssue)2 UseUnstablePageLoadStrategy (com.wikia.webdriver.common.driverprovider.UseUnstablePageLoadStrategy)2 ArticleContent (com.wikia.webdriver.common.core.api.ArticleContent)1 UserProfilePageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.UserProfilePageObject)1 WikiBasePageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.WikiBasePageObject)1 ArticlePageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.article.ArticlePageObject)1 SpecialNewFilesPage (com.wikia.webdriver.pageobjectsfactory.pageobject.special.SpecialNewFilesPage)1 FilePage (com.wikia.webdriver.pageobjectsfactory.pageobject.special.filepage.FilePage)1 BlogPageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.wikipage.blog.BlogPageObject)1 WebElement (org.openqa.selenium.WebElement)1