Search in sources :

Example 6 with UseUnstablePageLoadStrategy

use of com.wikia.webdriver.common.driverprovider.UseUnstablePageLoadStrategy 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 UseUnstablePageLoadStrategy

use of com.wikia.webdriver.common.driverprovider.UseUnstablePageLoadStrategy in project selenium-tests by Wikia.

the class TestAdsTrackingPixels method adsTrackingPixelSent.

@UseUnstablePageLoadStrategy
@NetworkTrafficDump(useMITM = true)
@Execute(mockAds = "true")
@Test(groups = "AdsTrackingPixels", dataProviderClass = AdsDataProvider.class, dataProvider = "adsTrackingPixelsSent")
public void adsTrackingPixelSent(String wiki, String urlParam, String[] pixelUrls) {
    networkTrafficInterceptor.startIntercepting();
    String testedPage = urlBuilder.getUrlForPath(wiki, urlParam);
    AdsBaseObject adsBaseObject = new AdsBaseObject(driver, testedPage);
    assertTrackingPixelsSent(adsBaseObject, pixelUrls);
}
Also used : AdsBaseObject(com.wikia.webdriver.pageobjectsfactory.pageobject.adsbase.AdsBaseObject) NetworkTrafficDump(com.wikia.webdriver.common.core.annotations.NetworkTrafficDump) UseUnstablePageLoadStrategy(com.wikia.webdriver.common.driverprovider.UseUnstablePageLoadStrategy) Execute(com.wikia.webdriver.common.core.annotations.Execute) Test(org.testng.annotations.Test)

Example 8 with UseUnstablePageLoadStrategy

use of com.wikia.webdriver.common.driverprovider.UseUnstablePageLoadStrategy 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

UseUnstablePageLoadStrategy (com.wikia.webdriver.common.driverprovider.UseUnstablePageLoadStrategy)8 Test (org.testng.annotations.Test)8 Execute (com.wikia.webdriver.common.core.annotations.Execute)5 Notification (com.wikia.webdriver.elements.oasis.components.notifications.Notification)4 RelatedIssue (com.wikia.webdriver.common.core.annotations.RelatedIssue)3 DeletePageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.actions.DeletePageObject)3 AdsBaseObject (com.wikia.webdriver.pageobjectsfactory.pageobject.adsbase.AdsBaseObject)3 ArticleContent (com.wikia.webdriver.common.core.api.ArticleContent)2 RenamePageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.actions.RenamePageObject)2 ArticlePageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.article.ArticlePageObject)2 SpecialNewFilesPage (com.wikia.webdriver.pageobjectsfactory.pageobject.special.SpecialNewFilesPage)2 SpecialRestorePageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.special.SpecialRestorePageObject)2 FilePage (com.wikia.webdriver.pageobjectsfactory.pageobject.special.filepage.FilePage)2 InBrowser (com.wikia.webdriver.common.core.annotations.InBrowser)1 NetworkTrafficDump (com.wikia.webdriver.common.core.annotations.NetworkTrafficDump)1 AdsEvolveObject (com.wikia.webdriver.pageobjectsfactory.pageobject.adsbase.AdsEvolveObject)1