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