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