Search in sources :

Example 6 with Dimension

use of org.openqa.selenium.Dimension in project selenium-tests by Wikia.

the class VetOptionsComponentObject method verifyVideoThumbnail.

private void verifyVideoThumbnail() {
    wait.forElementVisible(videoThumbnail);
    Dimension dim = videoThumbnail.getSize();
    int w = dim.getWidth();
    Assertion.assertEquals(w, VIDEO_THUMBNAIL_WIDTH);
    PageObjectLogging.log("verifyVideoThumbnail", "video thumbnail is visible", true);
}
Also used : Dimension(org.openqa.selenium.Dimension)

Example 7 with Dimension

use of org.openqa.selenium.Dimension in project selenium-tests by Wikia.

the class ArticlePageObject method verifyTableSize.

public void verifyTableSize(int width, int height) {
    wait.forElementVisible(table);
    Dimension size = table.getSize();
    Assertion.assertEquals(size.getHeight(), height);
    Assertion.assertEquals(size.getWidth(), width);
    PageObjectLogging.log("verifyTableSize", "table has correct size", true);
}
Also used : Dimension(org.openqa.selenium.Dimension)

Example 8 with Dimension

use of org.openqa.selenium.Dimension in project selenium-tests by Wikia.

the class AdsSkinHelper method getMiddleColor.

public String getMiddleColor() {
    Point startPoint = new Point((articleLeftSideX + articleRightSideX) / 2, startSkinY + 3);
    File pixel = shooter.capturePageAndCrop(startPoint, new Dimension(1, 1), driver);
    return toHex(new Color(imageEditor.fileToImage(pixel).getRGB(0, 0)));
}
Also used : Point(org.openqa.selenium.Point) Dimension(org.openqa.selenium.Dimension) File(java.io.File)

Example 9 with Dimension

use of org.openqa.selenium.Dimension in project selenium-tests by Wikia.

the class AdsSkinHelper method getCutPattern.

private File getCutPattern(BufferedImage patternImage, boolean isLeft) {
    Point startPoint;
    Dimension size;
    if (isLeft) {
        size = new Dimension(articleLeftSideX, patternImage.getHeight());
        startPoint = new Point(patternImage.getWidth() - articleLeftSideX, 0);
    } else {
        size = new Dimension(viewPortWidth - articleRightSideX, patternImage.getHeight());
        startPoint = new Point(0, 0);
    }
    return imageEditor.cropImage(startPoint, size, patternImage);
}
Also used : Point(org.openqa.selenium.Point) Dimension(org.openqa.selenium.Dimension)

Example 10 with Dimension

use of org.openqa.selenium.Dimension in project selenium-tests by Wikia.

the class TestAdsSlotSizes method adsSlotSizes.

private void adsSlotSizes(Page page, String urlParamToEnable, Dimension pageSize, Map<String, Object> slotInfo) {
    String slotName = slotInfo.get("slotName").toString();
    Dimension slotSize = (Dimension) slotInfo.get("slotSize");
    String url = urlBuilder.getUrlForPage(page);
    if (StringUtils.isNotEmpty(urlParamToEnable)) {
        url = urlBuilder.appendQueryStringToURL(url, urlParamToEnable);
    }
    log(slotName, slotSize);
    new AdsBaseObject(driver, url, pageSize).triggerAdSlot(slotName).verifyLineItemId(slotName, Integer.valueOf(slotInfo.get("lineItemId").toString())).verifyIframeSize(slotName, slotInfo.get("src").toString(), slotSize.getWidth(), slotSize.getHeight());
}
Also used : AdsBaseObject(com.wikia.webdriver.pageobjectsfactory.pageobject.adsbase.AdsBaseObject) Dimension(org.openqa.selenium.Dimension)

Aggregations

Dimension (org.openqa.selenium.Dimension)24 File (java.io.File)9 Point (org.openqa.selenium.Point)7 WebDriver (org.openqa.selenium.WebDriver)6 JavascriptExecutor (org.openqa.selenium.JavascriptExecutor)4 WebElement (org.openqa.selenium.WebElement)3 RemoteWebDriver (org.openqa.selenium.remote.RemoteWebDriver)3 PublicAtsApi (com.axway.ats.common.PublicAtsApi)2 VerificationException (com.axway.ats.uiengine.exceptions.VerificationException)2 Execute (com.wikia.webdriver.common.core.annotations.Execute)2 VisualEditorAddMediaDialog (com.wikia.webdriver.pageobjectsfactory.componentobject.visualeditordialogs.VisualEditorAddMediaDialog)2 AdsBaseObject (com.wikia.webdriver.pageobjectsfactory.pageobject.adsbase.AdsBaseObject)2 VisualEditorPageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.visualeditor.VisualEditorPageObject)2 BufferedImage (java.awt.image.BufferedImage)2 IOException (java.io.IOException)2 URL (java.net.URL)2 ArrayList (java.util.ArrayList)2 List (java.util.List)2 FessConfig (org.codelibs.fess.mylasta.direction.FessConfig)2 By (org.openqa.selenium.By)2