Search in sources :

Example 66 with AdsBaseObject

use of com.wikia.webdriver.pageobjectsfactory.pageobject.adsbase.AdsBaseObject in project selenium-tests by Wikia.

the class TestUap method adsUapMercury.

@InBrowser(browser = Browser.CHROME, emulator = Emulator.GOOGLE_NEXUS_5)
@Test(dataProviderClass = AdsDataProvider.class, dataProvider = "adsUapMercury", groups = "AdsUapMercury")
public void adsUapMercury(Page page, List<Map<String, Object>> mobileTopLeaderboard, List<Map<String, Object>> mobileInContent, List<Map<String, Object>> mobilePrefooter, List<Map<String, Object>> mobileBottomLeaderboard) {
    AdsBaseObject ads = new AdsBaseObject(driver, urlBuilder.getUrlForPage(page));
    verifySlotsUnblocked(ads, mobileTopLeaderboard);
    verifySlotsBlocked(ads, mobileInContent);
    verifySlotsBlocked(ads, mobilePrefooter);
    verifySlotsBlocked(ads, mobileBottomLeaderboard);
    ads.scrollToPosition(MOBILE_IN_CONTENT);
    Assertion.assertTrue(ads.isMobileInContentAdDisplayed(), "Mobile in content ad is not displayed");
    verifySlotsUnblocked(ads, mobileTopLeaderboard);
    verifySlotsUnblocked(ads, mobileInContent);
    verifySlotsBlocked(ads, mobilePrefooter);
    verifySlotsBlocked(ads, mobileBottomLeaderboard);
    ads.scrollToPosition(MOBILE_PREFOOTER);
    Assertion.assertTrue(ads.isMobilePrefooterAdDisplayed(), "Mobile prefooter ad is not displayed");
    ads.scrollToPosition(MOBILE_BOTTOM_LEADERBOARD);
    Assertion.assertTrue(ads.isMobileBottomLeaderboardAdDisplayed(), "Mobile bottom leaderboard ad is not dispalyed");
    verifySlotsUnblocked(ads, mobileTopLeaderboard);
    verifySlotsUnblocked(ads, mobileInContent);
    verifySlotsUnblocked(ads, mobilePrefooter);
    verifySlotsUnblocked(ads, mobileBottomLeaderboard);
}
Also used : AdsBaseObject(com.wikia.webdriver.pageobjectsfactory.pageobject.adsbase.AdsBaseObject) Test(org.testng.annotations.Test) InBrowser(com.wikia.webdriver.common.core.annotations.InBrowser)

Example 67 with AdsBaseObject

use of com.wikia.webdriver.pageobjectsfactory.pageobject.adsbase.AdsBaseObject in project selenium-tests by Wikia.

the class TestUap method verifySlotsUnblocked.

private void verifySlotsUnblocked(AdsBaseObject ads, List<Map<String, Object>> slotsData) {
    for (Map<String, Object> slotData : slotsData) {
        String slotName = slotData.get("slotName").toString();
        Dimension slotSize = (Dimension) slotData.get("slotSize");
        ads.verifyLineItemId(slotName, Integer.valueOf(slotData.get("lineItemId").toString()));
        ads.verifyIframeSize(slotName, slotData.get("src").toString(), slotSize.getWidth(), slotSize.getHeight());
    }
}
Also used : AdsBaseObject(com.wikia.webdriver.pageobjectsfactory.pageobject.adsbase.AdsBaseObject) Dimension(org.openqa.selenium.Dimension)

Example 68 with AdsBaseObject

use of com.wikia.webdriver.pageobjectsfactory.pageobject.adsbase.AdsBaseObject in project selenium-tests by Wikia.

the class TestAdsVuapTheNewGeneration method vuapResolvedStateShouldHaveLinkToProject43ArticleOnImage.

@Test(groups = { "AdsVuapResolvedStateTng", "AdsVuapResolvedStateClickOasis" }, dataProviderClass = AdsDataProvider.class, dataProvider = "adsVuapTngDesktop")
public void vuapResolvedStateShouldHaveLinkToProject43ArticleOnImage(Page page, String slot, String videoIframeSelector) {
    final AdsBaseObject ads = openPageWithVideoInLocalStorage(page);
    final AutoplayVuap vuap = new AutoplayVuap(driver, slot, videoIframeSelector);
    ads.refreshPage();
    scrollToSlot(slot, ads);
    vuap.clickOnClickArea2();
    final String actual = ads.switchToNewBrowserTab();
    Assert.assertTrue(actual.equals(PROJECT43_TNG_ARTICLE_LINK), "Image should point to page on project43.");
}
Also used : AutoplayVuap(com.wikia.webdriver.pageobjectsfactory.componentobject.ad.AutoplayVuap) AdsBaseObject(com.wikia.webdriver.pageobjectsfactory.pageobject.adsbase.AdsBaseObject) Test(org.testng.annotations.Test)

Example 69 with AdsBaseObject

use of com.wikia.webdriver.pageobjectsfactory.pageobject.adsbase.AdsBaseObject in project selenium-tests by Wikia.

the class TestAdsVuapTheNewGeneration method openPageWithVideoInLocalStorage.

private AdsBaseObject openPageWithVideoInLocalStorage(Page page) {
    final AdsBaseObject ads = new AdsBaseObject(driver);
    ads.getUrl(urlBuilder.getUrlForWiki("project43"));
    JavascriptActions runScript = new JavascriptActions(driver);
    runScript.execute("localStorage.setItem('" + VuapVideos.PORVATA_VAST + VuapVideos.VAST_VIDEO + ");");
    ads.getUrl(page);
    return ads;
}
Also used : JavascriptActions(com.wikia.webdriver.common.core.elemnt.JavascriptActions) AdsBaseObject(com.wikia.webdriver.pageobjectsfactory.pageobject.adsbase.AdsBaseObject)

Example 70 with AdsBaseObject

use of com.wikia.webdriver.pageobjectsfactory.pageobject.adsbase.AdsBaseObject in project selenium-tests by Wikia.

the class TestNoAdsOnAdFreeWikis method TestNoAdsOnAdsFreeWikisMobile_GeoEdgeFree.

@Test(dataProviderClass = AdsDataProvider.class, dataProvider = "adFreeWikis", groups = { "TestNoAdsOnAdsFreeWikisMobile_GeoEdgeFree" })
public void TestNoAdsOnAdsFreeWikisMobile_GeoEdgeFree(String wikiName, String path) {
    String testedPage = urlBuilder.getUrlForPath(wikiName, path);
    AdsBaseObject wikiPage = new AdsBaseObject(driver, testedPage);
    wikiPage.verifyNoAdsOnMobilePage();
}
Also used : AdsBaseObject(com.wikia.webdriver.pageobjectsfactory.pageobject.adsbase.AdsBaseObject) Test(org.testng.annotations.Test)

Aggregations

AdsBaseObject (com.wikia.webdriver.pageobjectsfactory.pageobject.adsbase.AdsBaseObject)87 Test (org.testng.annotations.Test)79 AutoplayVuap (com.wikia.webdriver.pageobjectsfactory.componentobject.ad.AutoplayVuap)29 InBrowser (com.wikia.webdriver.common.core.annotations.InBrowser)15 NetworkTrafficDump (com.wikia.webdriver.common.core.annotations.NetworkTrafficDump)12 VideoFanTakeover (com.wikia.webdriver.pageobjectsfactory.componentobject.ad.VideoFanTakeover)12 Execute (com.wikia.webdriver.common.core.annotations.Execute)3 UseUnstablePageLoadStrategy (com.wikia.webdriver.common.driverprovider.UseUnstablePageLoadStrategy)3 RelatedIssue (com.wikia.webdriver.common.core.annotations.RelatedIssue)2 JavascriptActions (com.wikia.webdriver.common.core.elemnt.JavascriptActions)2 SonySideViewObject (com.wikia.webdriver.pageobjectsfactory.pageobject.adsbase.SonySideViewObject)2 Dimension (org.openqa.selenium.Dimension)2 DontRun (com.wikia.webdriver.common.core.annotations.DontRun)1 HarEntry (net.lightbody.bmp.core.har.HarEntry)1