Search in sources :

Example 1 with UseUnstablePageLoadStrategy

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

the class TestAdsGptPageParam method adsGptPageParamMercury.

@InBrowser(browser = Browser.CHROME, emulator = Emulator.GOOGLE_NEXUS_5)
@Test(dataProviderClass = AdsDataProvider.class, dataProvider = "adsGptPageParam", groups = "AdsGptPageParamMercury")
@UseUnstablePageLoadStrategy
public void adsGptPageParamMercury(String wikiName, String article, String gptPattern, Boolean paramShouldPresent) {
    AdsBaseObject wikiPage = new AdsBaseObject(driver, urlBuilder.getUrlForPath(wikiName, article));
    String gptPageParams = wikiPage.getGptPageParams(AdsContent.MOBILE_TOP_LB);
    if (paramShouldPresent) {
        Assertion.assertStringContains(gptPageParams, gptPattern);
    } else {
        Assertion.assertStringNotContains(gptPageParams, gptPattern);
    }
}
Also used : AdsBaseObject(com.wikia.webdriver.pageobjectsfactory.pageobject.adsbase.AdsBaseObject) UseUnstablePageLoadStrategy(com.wikia.webdriver.common.driverprovider.UseUnstablePageLoadStrategy) Test(org.testng.annotations.Test) InBrowser(com.wikia.webdriver.common.core.annotations.InBrowser)

Example 2 with UseUnstablePageLoadStrategy

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

the class ArticleActionsAdminTests method moveArticle.

@Test(groups = { "ArticleActionsAdmin_002" })
@UseUnstablePageLoadStrategy
@Execute(asUser = User.STAFF)
public void moveArticle() {
    new ArticleContent().push(PageContent.ARTICLE_TEXT);
    ArticlePageObject article = new ArticlePageObject().open();
    String articleOldTitle = article.getArticleTitle();
    String articleNewName = TestContext.getCurrentMethodName() + article.getTimeStamp();
    RenamePageObject renamePage = article.renameUsingDropdown();
    renamePage.rename(articleNewName, false);
    List<Notification> confirmNotifications = article.getNotifications(NotificationType.CONFIRM);
    Assertion.assertEquals(confirmNotifications.size(), 1, SpecialRestorePageObject.AssertionMessages.INVALID_NUMBER_OF_CONFIRMING_NOTIFICATIONS);
    Assertion.assertEquals(confirmNotifications.stream().findFirst().get().getMessage(), "\"" + articleOldTitle + "\" has been renamed \"" + articleNewName + "\"", "Banner notification messsage is invalid");
    Assertion.assertEquals(article.getArticleName(), articleNewName, "New article title is invalid");
}
Also used : ArticleContent(com.wikia.webdriver.common.core.api.ArticleContent) ArticlePageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.article.ArticlePageObject) RenamePageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.actions.RenamePageObject) 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)

Example 3 with UseUnstablePageLoadStrategy

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

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

the class TestAdsEvolveOasis method adsEvolveOasis.

@UseUnstablePageLoadStrategy
@Test(dataProviderClass = AdsDataProvider.class, groups = "AdsEvolveOasis", dataProvider = "evolveTestPage")
public void adsEvolveOasis(String wikiName, String article) {
    AdsEvolveObject wikiPage = new AdsEvolveObject(driver);
    String testedPage = urlBuilder.getUrlForPath(wikiName, article);
    wikiPage.enableEvolve(testedPage);
    wikiPage.verifyEvolveCallOasis();
}
Also used : AdsEvolveObject(com.wikia.webdriver.pageobjectsfactory.pageobject.adsbase.AdsEvolveObject) UseUnstablePageLoadStrategy(com.wikia.webdriver.common.driverprovider.UseUnstablePageLoadStrategy) Test(org.testng.annotations.Test)

Example 5 with UseUnstablePageLoadStrategy

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

the class TestAdsGptPageParam method adsGptPageParamOasis.

@Test(dataProviderClass = AdsDataProvider.class, dataProvider = "adsGptPageParam", groups = "AdsGptPageParamOasis")
@UseUnstablePageLoadStrategy
public void adsGptPageParamOasis(String wikiName, String article, String gptPattern, Boolean paramShouldPresent) {
    AdsBaseObject wikiPage = new AdsBaseObject(driver, urlBuilder.getUrlForPath(wikiName, article));
    String gptPageParams = wikiPage.getGptPageParams(AdsContent.TOP_LB);
    if (paramShouldPresent) {
        Assertion.assertStringContains(gptPageParams, gptPattern);
    } else {
        Assertion.assertStringNotContains(gptPageParams, gptPattern);
    }
}
Also used : AdsBaseObject(com.wikia.webdriver.pageobjectsfactory.pageobject.adsbase.AdsBaseObject) UseUnstablePageLoadStrategy(com.wikia.webdriver.common.driverprovider.UseUnstablePageLoadStrategy) Test(org.testng.annotations.Test)

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