use of com.wikia.webdriver.pageobjectsfactory.pageobject.actions.DeletePageObject in project selenium-tests by Wikia.
the class CreateWikiTests_loggedInUser method CreateNewWiki_001_createDeleteWiki.
@Test(groups = { "CNW", "CreateNewWikiLoggedIn_001" })
@Execute(asUser = User.USER_CNW)
public void CreateNewWiki_001_createDeleteWiki() {
WikiBasePageObject base = new WikiBasePageObject();
CreateNewWikiPageObjectStep1 cnw1 = base.openSpecialCreateNewWikiPage(wikiCorporateURL);
String wikiName = cnw1.getWikiName();
cnw1.typeInWikiName(wikiName);
cnw1.verifyNextButtonEnabled();
CreateNewWikiPageObjectStep2 cnw2 = cnw1.submit();
cnw2.selectCategory(CreateWikiMessages.WIKI_CATEGORY_ID);
CreateNewWikiPageObjectStep3 cnw3 = cnw2.submit();
cnw3.selectThemeByName(CreateWikiMessages.WIKI_THEME);
ArticlePageObject article = cnw3.submit();
article.verifyWikiTitleOnCongratualtionsLightBox(wikiName);
article.closeNewWikiCongratulationsLightBox();
article.verifyWikiTitleHeader(wikiName);
DeletePageObject deletePage = article.deleteUsingDropdown();
deletePage.submitDeletion();
article.verifyUserLoggedIn(User.USER_CNW.getUserName());
}
use of com.wikia.webdriver.pageobjectsfactory.pageobject.actions.DeletePageObject in project selenium-tests by Wikia.
the class ArticlePageObject method deleteFirstComment.
public DeletePageObject deleteFirstComment() {
jsActions.scrollToElement(allCommentsArea);
WebElement mostRecentComment = articleComments.get(0);
JavascriptExecutor js = (JavascriptExecutor) driver;
js.executeScript("arguments[0].querySelector(arguments[1]).click()", mostRecentComment, DELETE_BUTTON_SELECTOR);
return new DeletePageObject(driver);
}
use of com.wikia.webdriver.pageobjectsfactory.pageobject.actions.DeletePageObject 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.actions.DeletePageObject in project selenium-tests by Wikia.
the class FilePageTests method filePage005_deleteFromHistory.
/**
* Verify that a video can be deleted from the File page
*/
@Test(groups = { "FilePage", "filePage005_deleteFromHistory", "Media" })
@RelatedIssue(issueID = "SUS-317", comment = "Product code defect. Test manually that the video can be deleted")
public void filePage005_deleteFromHistory() {
YoutubeVideo video = YoutubeVideoProvider.getLatestVideoForQuery("pokemon");
// Go to Special:Videos to add a video
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());
// Go to the history tab and add a second video to test deleting a version
FilePage filePage = new FilePage().open(video.getFileName());
filePage.selectHistoryTab();
filePage.replaceVideo(VideoContent.YOUTUBE_VIDEO_URL5);
// Load the file page again, should have the same name
filePage.open(video.getFileName()).verifyEmbeddedVideoIsPresent();
//Removed following lines until SUS-317 is fixed
//// Go to the history tab and verify there are at least two videos
//filePage.selectHistoryTab();
//filePage.verifyVersionCountAtLeast(2);
//// Delete the second version
//DeletePageObject deletePage = filePage.deleteVersion(2);
//deletePage.submitDeletion();
//Removed above lines until SUS-317is fixed
// Load the file page again, should have the same name
filePage.open(video.getFileName()).verifyEmbeddedVideoIsPresent();
// Delete the first version and thus the whole page
DeletePageObject deletePage = filePage.deleteVersion(1);
deletePage.submitDeletion();
// Go back to the file page and make sure its gone
filePage.open(video.getFileName()).verifyEmptyFilePage();
}
use of com.wikia.webdriver.pageobjectsfactory.pageobject.actions.DeletePageObject 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);
}
Aggregations