Search in sources :

Example 1 with VideoFanTakeover

use of com.wikia.webdriver.pageobjectsfactory.componentobject.ad.VideoFanTakeover in project selenium-tests by Wikia.

the class TestAdsVuapOasis method adsVuapVideoPauseOasis.

@NetworkTrafficDump
@Test(dataProviderClass = AdsDataProvider.class, dataProvider = "adsVuapDesktop", groups = "AdsVuapVideoPauseOasis")
public void adsVuapVideoPauseOasis(Page page, String slotName, String iframeId) throws InterruptedException {
    networkTrafficInterceptor.startIntercepting();
    AdsBaseObject ads = new AdsBaseObject(driver, urlBuilder.getUrlForPage(page), WindowSize.DESKTOP);
    scrollToSlot(slotName, ads);
    VideoFanTakeover videoFanTakeover = new VideoFanTakeover(driver, iframeId, slotName);
    videoFanTakeover.play();
    ads.wait.forSuccessfulResponse(networkTrafficInterceptor, URL_FIRSTQUARTILE);
    videoFanTakeover.pause();
    double time = videoFanTakeover.getCurrentVideoTimeOnDesktop().doubleValue();
    Thread.sleep(DELAY * 1000);
    Assert.assertNotEquals(0, videoFanTakeover.getCurrentVideoTimeOnDesktop().doubleValue());
    Assert.assertEquals(time, videoFanTakeover.getCurrentVideoTimeOnDesktop().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)

Example 2 with VideoFanTakeover

use of com.wikia.webdriver.pageobjectsfactory.componentobject.ad.VideoFanTakeover in project selenium-tests by Wikia.

the class TestAdsVuapOasis method adsVuapCheckSlotSizesOasis.

@Test(dataProviderClass = AdsDataProvider.class, dataProvider = "adsVuapDesktop", groups = "AdsVuapCheckSlotSizesOasis")
public void adsVuapCheckSlotSizesOasis(Page page, String slotName, String iframeId) throws InterruptedException {
    String slotSelector = AdsContent.getSlotSelector(slotName);
    AdsBaseObject ads = new AdsBaseObject(driver, urlBuilder.getUrlForPage(page), WindowSize.DESKTOP);
    scrollToSlot(slotName, ads);
    VideoFanTakeover videoFanTakeover = new VideoFanTakeover(driver, iframeId, slotName);
    videoFanTakeover.waitForAdToLoad();
    double imageHeight = videoFanTakeover.getAdSlotHeight(slotSelector);
    videoFanTakeover.play();
    double videoHeight = videoFanTakeover.getAdVideoHeight();
    Assertion.assertTrue(videoFanTakeover.isVideoAdBiggerThanImageAdOasis(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) Test(org.testng.annotations.Test)

Example 3 with VideoFanTakeover

use of com.wikia.webdriver.pageobjectsfactory.componentobject.ad.VideoFanTakeover in project selenium-tests by Wikia.

the class TestAdsVuapOasis method adsVideoClosedAfterPlayingOasis.

@Test(dataProviderClass = AdsDataProvider.class, dataProvider = "adsVuapDesktop", groups = "AdsVideoClosesWhenFinishPlaysOasis")
public void adsVideoClosedAfterPlayingOasis(Page page, String slotName, String iframeId) {
    AdsBaseObject ads = new AdsBaseObject(driver, urlBuilder.getUrlForPage(page), WindowSize.DESKTOP);
    scrollToSlot(slotName, ads);
    VideoFanTakeover videoFanTakeover = new VideoFanTakeover(driver, iframeId, slotName);
    videoFanTakeover.play();
    videoFanTakeover.waitForVideoPlayerHidden();
}
Also used : AdsBaseObject(com.wikia.webdriver.pageobjectsfactory.pageobject.adsbase.AdsBaseObject) VideoFanTakeover(com.wikia.webdriver.pageobjectsfactory.componentobject.ad.VideoFanTakeover) Test(org.testng.annotations.Test)

Example 4 with VideoFanTakeover

use of com.wikia.webdriver.pageobjectsfactory.componentobject.ad.VideoFanTakeover in project selenium-tests by Wikia.

the class TestAdsVuapOasis method adsVuapTimeProgressingOasis.

@NetworkTrafficDump
@Test(dataProviderClass = AdsDataProvider.class, dataProvider = "adsVuapDesktop", groups = "AdsVuapTimeProgressingOasis")
public void adsVuapTimeProgressingOasis(Page page, String slotName, String iframeId) throws InterruptedException {
    networkTrafficInterceptor.startIntercepting();
    AdsBaseObject ads = new AdsBaseObject(driver, urlBuilder.getUrlForPage(page), WindowSize.DESKTOP);
    scrollToSlot(slotName, ads);
    VideoFanTakeover videoFanTakeover = new VideoFanTakeover(driver, iframeId, slotName);
    videoFanTakeover.play();
    ads.wait.forSuccessfulResponse(networkTrafficInterceptor, URL_FIRSTQUARTILE);
    double quartileTime = videoFanTakeover.getCurrentVideoTimeOnDesktop().doubleValue();
    ads.wait.forSuccessfulResponse(networkTrafficInterceptor, URL_MIDPOINT);
    double midTime = videoFanTakeover.getCurrentVideoTimeOnDesktop().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)

Example 5 with VideoFanTakeover

use of com.wikia.webdriver.pageobjectsfactory.componentobject.ad.VideoFanTakeover in project selenium-tests by Wikia.

the class TestAdsVuapFandom method adsImageClickedOpensNewPageFandomMobile.

@NetworkTrafficDump(useMITM = true)
@InBrowser(browser = Browser.CHROME, emulator = Emulator.GOOGLE_NEXUS_5)
@Test(dataProviderClass = FandomAdsDataProvider.class, dataProvider = "vuapPageMobile", groups = { "AdsVuapFandomMobile", "AdsImageClickedOpensNewPageFandomMobile" })
public void adsImageClickedOpensNewPageFandomMobile(String pageType, String pageName, String slotName, String iframeId, String videoUrl) {
    networkTrafficInterceptor.startIntercepting();
    AdsFandomObject fandomPage = loadPage(pageName, pageType);
    VideoFanTakeover videoFanTakeover = prepareSlot(slotName, iframeId, fandomPage);
    fandomPage.wait.forSuccessfulResponse(networkTrafficInterceptor, videoUrl);
    videoFandomPage(slotName).verifyFandomPageOpened(videoFanTakeover);
}
Also used : VideoFanTakeover(com.wikia.webdriver.pageobjectsfactory.componentobject.ad.VideoFanTakeover) FandomVideoFanTakeover(com.wikia.webdriver.pageobjectsfactory.componentobject.ad.FandomVideoFanTakeover) AdsFandomObject(com.wikia.webdriver.pageobjectsfactory.pageobject.adsbase.AdsFandomObject) NetworkTrafficDump(com.wikia.webdriver.common.core.annotations.NetworkTrafficDump) Test(org.testng.annotations.Test) InBrowser(com.wikia.webdriver.common.core.annotations.InBrowser)

Aggregations

VideoFanTakeover (com.wikia.webdriver.pageobjectsfactory.componentobject.ad.VideoFanTakeover)24 Test (org.testng.annotations.Test)23 NetworkTrafficDump (com.wikia.webdriver.common.core.annotations.NetworkTrafficDump)15 FandomVideoFanTakeover (com.wikia.webdriver.pageobjectsfactory.componentobject.ad.FandomVideoFanTakeover)12 AdsBaseObject (com.wikia.webdriver.pageobjectsfactory.pageobject.adsbase.AdsBaseObject)12 InBrowser (com.wikia.webdriver.common.core.annotations.InBrowser)11 AdsFandomObject (com.wikia.webdriver.pageobjectsfactory.pageobject.adsbase.AdsFandomObject)11