Search in sources :

Example 11 with MobileAdsBaseObject

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

the class TestAdTypeMobile method adsAdTypeAsyncSuccessWithAd.

@Test(groups = "AdTypeMercury", dataProviderClass = AdTypeDataProvider.class, dataProvider = "asyncSuccessWithAd")
public void adsAdTypeAsyncSuccessWithAd(String wikiName, String article, String adUnit, String slotName, String imgUrl) {
    String testedPage = urlBuilder.getUrlForPath(wikiName, article);
    MobileAdsBaseObject ads = new MobileAdsBaseObject(driver, testedPage);
    ads.waitForSlot(slotName);
    ads.verifyGptIframe(adUnit, slotName, SRC);
    ads.verifyImgAdLoadedInSlot(slotName, imgUrl);
}
Also used : MobileAdsBaseObject(com.wikia.webdriver.pageobjectsfactory.pageobject.adsbase.mobile.MobileAdsBaseObject) Test(org.testng.annotations.Test)

Example 12 with MobileAdsBaseObject

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

the class TestAdsSlotsMercury method adsLeaderboardOnPageWithInfobox.

@InBrowser(browser = Browser.CHROME, emulator = Emulator.GOOGLE_NEXUS_5)
@Test(groups = "AdsSlotsMercury", dataProviderClass = MobileAdsDataProvider.class, dataProvider = "leaderboardSlotOnPageWithInfobox")
public void adsLeaderboardOnPageWithInfobox(String wikiName, String article, String adUnit) {
    String testedPage = urlBuilder.getUrlForPath(wikiName, article);
    MobileAdsBaseObject ads = new MobileAdsBaseObject(driver, testedPage);
    PortableInfobox infobox = new PortableInfobox();
    ads.waitForPageLoadedWithGpt();
    ads.verifyGptIframe(adUnit, MOBILE_TOP_LEADERBOARD, SRC);
    int adPosition = ads.getElementTopPositionByCssSelector(AdsContent.getSlotSelector(AdsContent.MOBILE_TOP_LB));
    int pageElementPosition = infobox.getElementBottomPositionByCssSelector(PORTABLE_INFOBOX);
    PageObjectLogging.log("Ad top position", String.valueOf(adPosition), true);
    PageObjectLogging.log("Infobox bottom position", String.valueOf(pageElementPosition), true);
    Assertion.assertTrue(adPosition >= pageElementPosition, "Verify if ad top position is >= infobox bottom position (ad below infobox)");
}
Also used : PortableInfobox(com.wikia.webdriver.pageobjectsfactory.pageobject.PortableInfobox) MobileAdsBaseObject(com.wikia.webdriver.pageobjectsfactory.pageobject.adsbase.mobile.MobileAdsBaseObject) Test(org.testng.annotations.Test) InBrowser(com.wikia.webdriver.common.core.annotations.InBrowser)

Example 13 with MobileAdsBaseObject

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

the class TestAdsSlotsMercury method adsLeaderboardOnPageWithoutInfobox.

@InBrowser(browser = Browser.CHROME, emulator = Emulator.GOOGLE_NEXUS_5)
@Test(groups = "AdsSlotsMercury", dataProviderClass = MobileAdsDataProvider.class, dataProvider = "leaderboardSlotOnPageWithoutInfobox")
public void adsLeaderboardOnPageWithoutInfobox(String wikiName, String article, String adUnit) {
    String testedPage = urlBuilder.getUrlForPath(wikiName, article);
    MobileAdsBaseObject ads = new MobileAdsBaseObject(driver, testedPage);
    ads.waitForPageLoadedWithGpt();
    ads.verifyGptIframe(adUnit, MOBILE_TOP_LEADERBOARD, SRC);
    int adPosition = ads.getElementTopPositionByCssSelector(AdsContent.getSlotSelector(AdsContent.MOBILE_TOP_LB));
    int pageElementPosition = ads.getElementBottomPositionByCssSelector(ARTICLE_HEADER);
    PageObjectLogging.log("Ad top position", String.valueOf(adPosition), true);
    PageObjectLogging.log("Page header bottom position", String.valueOf(pageElementPosition), true);
    Assertion.assertTrue(adPosition >= pageElementPosition, "Ad top position >= page header position (ad below page header)");
}
Also used : MobileAdsBaseObject(com.wikia.webdriver.pageobjectsfactory.pageobject.adsbase.mobile.MobileAdsBaseObject) Test(org.testng.annotations.Test) InBrowser(com.wikia.webdriver.common.core.annotations.InBrowser)

Aggregations

MobileAdsBaseObject (com.wikia.webdriver.pageobjectsfactory.pageobject.adsbase.mobile.MobileAdsBaseObject)13 Test (org.testng.annotations.Test)13 InBrowser (com.wikia.webdriver.common.core.annotations.InBrowser)2 PortableInfobox (com.wikia.webdriver.pageobjectsfactory.pageobject.PortableInfobox)1