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