Search in sources :

Example 36 with AdsBaseObject

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

the class TestAdsSlotsOasis method adsSmokeTestSlotsOasis.

@Test(groups = "TestSlotsOasis")
public void adsSmokeTestSlotsOasis() {
    String testedPage = urlBuilder.getUrlForPath("project43", "SyntheticTests/OasisSlots");
    ads = new AdsBaseObject(driver, testedPage);
    ads.waitForPageLoadedWithGpt();
    for (String slotName : AdsDataProvider.OASIS_SLOTS_TO_SMOKE_TEST) {
        smokeTestSlot(slotName);
    }
    Assertion.assertFalse(ads.checkSlotOnPageLoaded(AdsContent.BOTTOM_LB));
}
Also used : AdsBaseObject(com.wikia.webdriver.pageobjectsfactory.pageobject.adsbase.AdsBaseObject) Test(org.testng.annotations.Test)

Example 37 with AdsBaseObject

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

the class TestAdsTrackingPixels method adsTrackingPixelSentAuthPage.

@NetworkTrafficDump(useMITM = true)
@Test(groups = "AdsTrackingPixelsAuthPage", dataProviderClass = AdsDataProvider.class, dataProvider = "adsTrackingPixelsSentAuthPage")
@InBrowser(browser = Browser.CHROME, emulator = Emulator.GOOGLE_NEXUS_5)
@DontRun(env = { "preview", "sandbox" })
public void adsTrackingPixelSentAuthPage(String wiki, String page, String[] pixelUrls) {
    networkTrafficInterceptor.startIntercepting();
    String testedPage = urlBuilder.getUrlForWiki(wiki) + page;
    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) Test(org.testng.annotations.Test) InBrowser(com.wikia.webdriver.common.core.annotations.InBrowser) DontRun(com.wikia.webdriver.common.core.annotations.DontRun)

Example 38 with AdsBaseObject

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

the class TestAdsVelesTracking method adsTrackingVelesTracked.

@NetworkTrafficDump()
@Test(groups = "AdsTrackingVeles", dataProviderClass = AdsDataProvider.class, dataProvider = "adsVelesTracking")
public void adsTrackingVelesTracked(final Page page, final Map<String, String> positionsAndPrices) {
    networkTrafficInterceptor.startIntercepting();
    AdsBaseObject pageObject = new AdsBaseObject(driver, urlBuilder.getUrlForPage(page));
    Set<HarEntry> entries = findEntriesByUrlPart(pageObject, VELES_TRACKING_REQUEST_PART, positionsAndPrices);
    Assertion.assertTrue(wasVelesTrackedIn(entries, positionsAndPrices), "Veles should be tracked only in " + positionsAndPrices);
}
Also used : HarEntry(net.lightbody.bmp.core.har.HarEntry) AdsBaseObject(com.wikia.webdriver.pageobjectsfactory.pageobject.adsbase.AdsBaseObject) NetworkTrafficDump(com.wikia.webdriver.common.core.annotations.NetworkTrafficDump) Test(org.testng.annotations.Test)

Example 39 with AdsBaseObject

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

the class TestAdsSlotSizes method adsSlotSizes.

private void adsSlotSizes(Page page, String urlParamToEnable, Dimension pageSize, Map<String, Object> slotInfo) {
    String slotName = slotInfo.get("slotName").toString();
    Dimension slotSize = (Dimension) slotInfo.get("slotSize");
    String url = urlBuilder.getUrlForPage(page);
    if (StringUtils.isNotEmpty(urlParamToEnable)) {
        url = urlBuilder.appendQueryStringToURL(url, urlParamToEnable);
    }
    log(slotName, slotSize);
    new AdsBaseObject(driver, url, pageSize).triggerAdSlot(slotName).verifyLineItemId(slotName, Integer.valueOf(slotInfo.get("lineItemId").toString())).verifyIframeSize(slotName, slotInfo.get("src").toString(), slotSize.getWidth(), slotSize.getHeight());
}
Also used : AdsBaseObject(com.wikia.webdriver.pageobjectsfactory.pageobject.adsbase.AdsBaseObject) Dimension(org.openqa.selenium.Dimension)

Example 40 with AdsBaseObject

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

the class TestAdsVuapMercury method adsVuapVideoPauseMercury.

@InBrowser(browser = Browser.CHROME, emulator = Emulator.GOOGLE_NEXUS_5)
@NetworkTrafficDump(useMITM = true)
@Test(dataProviderClass = AdsDataProvider.class, dataProvider = "adsVuapMercury", groups = "AdsVuapVideoPauseMercury")
public void adsVuapVideoPauseMercury(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);
    videoFanTakeover.pause();
    double time = videoFanTakeover.getCurrentVideoTimeOnMobile().doubleValue();
    TimeUnit.SECONDS.sleep(DELAY);
    Assert.assertNotEquals(0, videoFanTakeover.getCurrentVideoTimeOnMobile().doubleValue());
    Assert.assertEquals(time, videoFanTakeover.getCurrentVideoTimeOnMobile().doubleValue());
}
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)

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