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