use of com.wikia.webdriver.pageobjectsfactory.pageobject.adsbase.helpers.AdsComparison in project selenium-tests by Wikia.
the class AdsOoyalaObject method verifyColorAd.
private void verifyColorAd(WebElement element, Color color, int durationSec) {
AdsComparison adsComparison = new AdsComparison();
waitForColorAds(element, color);
adsComparison.verifyColorAd(element, color, durationSec, driver);
}
use of com.wikia.webdriver.pageobjectsfactory.pageobject.adsbase.helpers.AdsComparison in project selenium-tests by Wikia.
the class AdsBaseObject method verifyMonocolorAd.
public void verifyMonocolorAd(String slotName) {
String slotSelector = AdsContent.getSlotSelector(slotName);
WebElement slot = driver.findElement(By.cssSelector(slotSelector));
waitForSlotExpanded(slot);
Assertion.assertFalse(new AdsComparison().isAdVisible(slot, slotSelector, driver));
}
use of com.wikia.webdriver.pageobjectsfactory.pageobject.adsbase.helpers.AdsComparison in project selenium-tests by Wikia.
the class AdsBaseObject method verifyAdVisibleInSlot.
protected void verifyAdVisibleInSlot(String slotSelector, WebElement slot) {
if (!checkIfSlotExpanded(slot)) {
Optional<WebElement> lastGptDiv = getLastGptDiv(slotSelector);
if (lastGptDiv.isPresent() && checkIfGptSlotHasCreativeContent(lastGptDiv.get(), HOP_AD_TYPE)) {
PageObjectLogging.log("verifyAdVisibleInSlot", "Slot has " + HOP_AD_TYPE, true);
return;
}
throw new WebDriverException(slot.getAttribute("id") + " is collapsed");
}
boolean adVisible = new AdsComparison().isAdVisible(slot, slotSelector, driver);
extractGptInfo(slotSelector);
if (!adVisible) {
throw new WebDriverException("Ad is not present in " + slotSelector);
}
PageObjectLogging.log("ScreenshotsComparison", "Ad is present in " + slotSelector, true);
}
use of com.wikia.webdriver.pageobjectsfactory.pageobject.adsbase.helpers.AdsComparison in project selenium-tests by Wikia.
the class AdsBaseObject method verifyExpandedAdVisibleInSlot.
public void verifyExpandedAdVisibleInSlot(String slotSelector, WebElement slot) {
waitForSlotExpanded(slot);
boolean adVisible = new AdsComparison().isAdVisible(slot, slotSelector, driver);
extractGptInfo(slotSelector);
if (!adVisible) {
throw new WebDriverException("Ad is not present in " + slotSelector);
}
PageObjectLogging.log("ScreenshotsComparison", "Ad is present in " + slotSelector, true);
}
use of com.wikia.webdriver.pageobjectsfactory.pageobject.adsbase.helpers.AdsComparison in project selenium-tests by Wikia.
the class AdsBaseObject method verifySpotlights.
public void verifySpotlights() {
AdsComparison adsComparison = new AdsComparison();
for (String spotlightSelector : SPOTLIGHT_SLOTS) {
WebElement slot = wait.forElementVisible(By.cssSelector(spotlightSelector + " img"));
verifySlotExpanded(slot);
Assertion.assertTrue(adsComparison.isAdVisible(slot, spotlightSelector, driver));
}
}
Aggregations