Search in sources :

Example 16 with NetworkTrafficDump

use of com.wikia.webdriver.common.core.annotations.NetworkTrafficDump in project selenium-tests by Wikia.

the class TestAdsVuapMercury method adsVuapTimeProgressingMercury.

@InBrowser(browser = Browser.CHROME, emulator = Emulator.GOOGLE_NEXUS_5)
@NetworkTrafficDump(useMITM = true)
@Test(dataProviderClass = AdsDataProvider.class, dataProvider = "adsVuapMercury", groups = "AdsVuapTimeProgressingMercury")
public void adsVuapTimeProgressingMercury(Page page, String slotName, String iframeId, String videoUrl) throws InterruptedException {
    networkTrafficInterceptor.startIntercepting();
    AdsBaseObject ads = new AdsBaseObject(driver, urlBuilder.getUrlForPage(page));
    scrollToSlot(slotName, ads);
    ads.wait.forSuccessfulResponse(networkTrafficInterceptor, videoUrl);
    VideoFanTakeover videoFanTakeover = new VideoFanTakeover(driver, iframeId, slotName);
    videoFanTakeover.play();
    ads.wait.forSuccessfulResponse(networkTrafficInterceptor, URL_FIRSTQUARTILE);
    double quartileTime = videoFanTakeover.getCurrentVideoTimeOnMobile().doubleValue();
    ads.wait.forSuccessfulResponse(networkTrafficInterceptor, URL_MIDPOINT);
    double midTime = videoFanTakeover.getCurrentVideoTimeOnMobile().doubleValue();
    Assertion.assertTrue(videoFanTakeover.isTimeProgressing(quartileTime, midTime));
}
Also used : AdsBaseObject(com.wikia.webdriver.pageobjectsfactory.pageobject.adsbase.AdsBaseObject) VideoFanTakeover(com.wikia.webdriver.pageobjectsfactory.componentobject.ad.VideoFanTakeover) NetworkTrafficDump(com.wikia.webdriver.common.core.annotations.NetworkTrafficDump) Test(org.testng.annotations.Test) InBrowser(com.wikia.webdriver.common.core.annotations.InBrowser)

Example 17 with NetworkTrafficDump

use of com.wikia.webdriver.common.core.annotations.NetworkTrafficDump in project selenium-tests by Wikia.

the class TestAdsVuapMercury method adsVuapCheckSlotSizesMercury.

@InBrowser(browser = Browser.CHROME, emulator = Emulator.APPLE_IPHONE_6)
@NetworkTrafficDump(useMITM = true)
@Test(dataProviderClass = AdsDataProvider.class, dataProvider = "adsVuapMercury", groups = "AdsVuapCheckSlotSizesMercury")
public void adsVuapCheckSlotSizesMercury(Page page, String slotName, String iframeId, String videoUrl) throws InterruptedException {
    networkTrafficInterceptor.startIntercepting();
    String slotSelector = AdsContent.getSlotSelector(slotName);
    AdsBaseObject ads = new AdsBaseObject(driver, urlBuilder.getUrlForPage(page));
    scrollToSlot(slotName, ads);
    ads.wait.forSuccessfulResponse(networkTrafficInterceptor, videoUrl);
    VideoFanTakeover videoFanTakeover = new VideoFanTakeover(driver, iframeId, slotName);
    videoFanTakeover.waitForAdToLoad();
    double imageHeight = videoFanTakeover.getAdSlotHeight(slotSelector);
    videoFanTakeover.play();
    double videoHeight = videoFanTakeover.getAdVideoHeight();
    Assertion.assertTrue(videoFanTakeover.isVideoAdBiggerThanImageAdMobile(videoHeight, imageHeight));
    videoFanTakeover.waitForVideoPlayerHidden();
    Assertion.assertTrue(videoFanTakeover.isImageAdInCorrectSize(imageHeight, slotSelector));
}
Also used : AdsBaseObject(com.wikia.webdriver.pageobjectsfactory.pageobject.adsbase.AdsBaseObject) VideoFanTakeover(com.wikia.webdriver.pageobjectsfactory.componentobject.ad.VideoFanTakeover) NetworkTrafficDump(com.wikia.webdriver.common.core.annotations.NetworkTrafficDump) Test(org.testng.annotations.Test) InBrowser(com.wikia.webdriver.common.core.annotations.InBrowser)

Example 18 with NetworkTrafficDump

use of com.wikia.webdriver.common.core.annotations.NetworkTrafficDump in project selenium-tests by Wikia.

the class TestAdsTaboolaOasis method adsTaboolaOasis.

@NetworkTrafficDump
@Test(groups = "AdsTaboolaOasis")
public void adsTaboolaOasis() {
    String testedPage = urlBuilder.getUrlForPath("project43", "SyntheticTests/Taboola?InstantGlobals.wgAdDriverPageFairRecoveryCountries=[]&InstantGlobals.wgAdDriverSourcePointRecoveryCountries=[]");
    networkTrafficInterceptor.startIntercepting();
    AdsTaboolaObject adsTaboolaObject = new AdsTaboolaObject(driver);
    adsTaboolaObject.getUrl(testedPage);
    adsTaboolaObject.verifyTaboolaContainer(AdsTaboolaObject.ABOVE_ARTICLE_CSS_SELECTOR);
    adsTaboolaObject.verifyTaboolaContainer(AdsTaboolaObject.BELOW_ARTICLE_CSS_SELECTOR);
    adsTaboolaObject.wait.forSuccessfulResponse(networkTrafficInterceptor, AdsTaboolaObject.TABOOLA_LOADER_REQUEST);
    PageObjectLogging.log("adsTaboolaOasis", "Taboola loader.js has been requested", true);
}
Also used : AdsTaboolaObject(com.wikia.webdriver.pageobjectsfactory.pageobject.adsbase.AdsTaboolaObject) NetworkTrafficDump(com.wikia.webdriver.common.core.annotations.NetworkTrafficDump) Test(org.testng.annotations.Test)

Example 19 with NetworkTrafficDump

use of com.wikia.webdriver.common.core.annotations.NetworkTrafficDump 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 20 with NetworkTrafficDump

use of com.wikia.webdriver.common.core.annotations.NetworkTrafficDump in project selenium-tests by Wikia.

the class TestAdsTrackingPixels method adsTrackingPixelsOnConsecutivePages.

@NetworkTrafficDump
@Test(groups = "AdsTrackingPixels", dataProviderClass = AdsDataProvider.class, dataProvider = "adsTrackingPixelsOnConsecutivePages")
@Execute(mockAds = "true")
public void adsTrackingPixelsOnConsecutivePages(Page page, String[] articles, String[] urls) {
    // Check tracking pixels on first page view
    networkTrafficInterceptor.startIntercepting();
    String testedPage = urlBuilder.getUrlForPage(page);
    AdsBaseObject adsBaseObject = new AdsBaseObject(driver, testedPage);
    assertTrackingPixelsSent(adsBaseObject, urls);
    // Check tracking pixels on consecutive page views
    for (String linkName : articles) {
        networkTrafficInterceptor.startIntercepting();
        adsBaseObject.clickOnArticleLink(linkName);
        assertTrackingPixelsSent(adsBaseObject, urls);
    }
}
Also used : AdsBaseObject(com.wikia.webdriver.pageobjectsfactory.pageobject.adsbase.AdsBaseObject) NetworkTrafficDump(com.wikia.webdriver.common.core.annotations.NetworkTrafficDump) Execute(com.wikia.webdriver.common.core.annotations.Execute) Test(org.testng.annotations.Test)

Aggregations

NetworkTrafficDump (com.wikia.webdriver.common.core.annotations.NetworkTrafficDump)29 Test (org.testng.annotations.Test)29 VideoFanTakeover (com.wikia.webdriver.pageobjectsfactory.componentobject.ad.VideoFanTakeover)15 InBrowser (com.wikia.webdriver.common.core.annotations.InBrowser)13 AdsBaseObject (com.wikia.webdriver.pageobjectsfactory.pageobject.adsbase.AdsBaseObject)12 FandomVideoFanTakeover (com.wikia.webdriver.pageobjectsfactory.componentobject.ad.FandomVideoFanTakeover)7 AdsFandomObject (com.wikia.webdriver.pageobjectsfactory.pageobject.adsbase.AdsFandomObject)7 Execute (com.wikia.webdriver.common.core.annotations.Execute)5 DontRun (com.wikia.webdriver.common.core.annotations.DontRun)2 HomePage (com.wikia.webdriver.pageobjectsfactory.pageobject.HomePage)2 WikiBasePageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.WikiBasePageObject)2 AdsOoyalaObject (com.wikia.webdriver.pageobjectsfactory.pageobject.adsbase.AdsOoyalaObject)2 AdsPageFairObject (com.wikia.webdriver.pageobjectsfactory.pageobject.adsbase.AdsPageFairObject)2 RelatedIssue (com.wikia.webdriver.common.core.annotations.RelatedIssue)1 UseUnstablePageLoadStrategy (com.wikia.webdriver.common.driverprovider.UseUnstablePageLoadStrategy)1 AdsPrebidObject (com.wikia.webdriver.pageobjectsfactory.pageobject.adsbase.AdsPrebidObject)1 AdsTaboolaObject (com.wikia.webdriver.pageobjectsfactory.pageobject.adsbase.AdsTaboolaObject)1 InteractiveMapPageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.special.interactivemaps.InteractiveMapPageObject)1 HarEntry (net.lightbody.bmp.core.har.HarEntry)1