Search in sources :

Example 1 with AdsComparison

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);
}
Also used : AdsComparison(com.wikia.webdriver.pageobjectsfactory.pageobject.adsbase.helpers.AdsComparison)

Example 2 with AdsComparison

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));
}
Also used : AdsComparison(com.wikia.webdriver.pageobjectsfactory.pageobject.adsbase.helpers.AdsComparison) WebElement(org.openqa.selenium.WebElement)

Example 3 with AdsComparison

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);
}
Also used : AdsComparison(com.wikia.webdriver.pageobjectsfactory.pageobject.adsbase.helpers.AdsComparison) WebElement(org.openqa.selenium.WebElement) WebDriverException(org.openqa.selenium.WebDriverException)

Example 4 with AdsComparison

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);
}
Also used : AdsComparison(com.wikia.webdriver.pageobjectsfactory.pageobject.adsbase.helpers.AdsComparison) WebDriverException(org.openqa.selenium.WebDriverException)

Example 5 with AdsComparison

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));
    }
}
Also used : AdsComparison(com.wikia.webdriver.pageobjectsfactory.pageobject.adsbase.helpers.AdsComparison) WebElement(org.openqa.selenium.WebElement)

Aggregations

AdsComparison (com.wikia.webdriver.pageobjectsfactory.pageobject.adsbase.helpers.AdsComparison)5 WebElement (org.openqa.selenium.WebElement)3 WebDriverException (org.openqa.selenium.WebDriverException)2