public class EyesSeleniumUtils extends Object
| Constructor and Description |
|---|
EyesSeleniumUtils() |
| Modifier and Type | Method and Description |
|---|---|
static RectangleSize |
getCurrentFrameContentEntireSize(IEyesJsExecutor executor) |
static Location |
getCurrentScrollPosition(IEyesJsExecutor executor) |
static Map<String,String> |
getCurrentTransform(IEyesJsExecutor executor) |
static float |
getDevicePixelRatio(IEyesJsExecutor executor) |
static RectangleSize |
getElementVisibleSize(Logger logger,
org.openqa.selenium.WebElement element)
Returns given element visible portion size.
|
static RectangleSize |
getEntireElementSize(Logger logger,
IEyesJsExecutor executor,
org.openqa.selenium.WebElement element) |
static Location |
getPageLocation(org.openqa.selenium.interactions.Coordinates coordinates)
Extracts the location relative to the entire page from the coordinates
(e.g.
|
static String |
getPlatformVersion(org.openqa.selenium.HasCapabilities driver) |
static org.openqa.selenium.WebDriver |
getUnderlyingDriver(org.openqa.selenium.WebDriver driver)
For EyesWebDriver instances, returns the underlying WebDriver.
|
static Location |
getViewportLocation(org.openqa.selenium.interactions.Coordinates coordinates)
Extracts the location relative to the viewport from the
coordinates (e.g.
|
static RectangleSize |
getViewportSize(org.openqa.selenium.JavascriptExecutor executor) |
static RectangleSize |
getViewportSizeOrDisplaySize(Logger logger,
org.openqa.selenium.WebDriver driver) |
static boolean |
isAndroid(org.openqa.selenium.WebDriver driver) |
static boolean |
isIOS(org.openqa.selenium.WebDriver driver) |
static boolean |
isLandscapeOrientation(Logger logger,
org.openqa.selenium.WebDriver driver) |
static boolean |
isMobileDevice(org.openqa.selenium.WebDriver driver) |
static String |
selectRootElement(org.openqa.selenium.JavascriptExecutor executor) |
static boolean |
setBrowserSize(Logger logger,
org.openqa.selenium.WebDriver driver,
RectangleSize requiredSize) |
static boolean |
setBrowserSizeByViewportSize(Logger logger,
org.openqa.selenium.WebDriver driver,
RectangleSize actualViewportSize,
RectangleSize requiredViewportSize) |
static void |
setCurrentScrollPosition(IEyesJsExecutor executor,
Location location)
Sets the scroll position of the current frame.
|
static String |
setOverflow(org.openqa.selenium.JavascriptExecutor executor,
String value,
org.openqa.selenium.WebElement rootElement)
Sets the overflow of the current context's body.
|
static void |
setTransform(IEyesJsExecutor executor,
String transform)
Set the given transform to document.documentElement for all style keys
defined in
JS_TRANSFORM_KEYS . |
static void |
setTransforms(IEyesJsExecutor executor,
Map<String,String> transforms)
Sets transforms for document.documentElement according to the given
map of style keys and values.
|
static void |
setViewportSize(Logger logger,
org.openqa.selenium.WebDriver driver,
RectangleSize size) |
static void |
translateTo(IEyesJsExecutor executor,
Location position)
Translates the current documentElement to the given position.
|
public static Location getPageLocation(org.openqa.selenium.interactions.Coordinates coordinates)
coordinates - The coordinates from which location is extracted.public static Location getViewportLocation(org.openqa.selenium.interactions.Coordinates coordinates)
coordinates - The coordinates from which location is extracted.public static org.openqa.selenium.WebDriver getUnderlyingDriver(org.openqa.selenium.WebDriver driver)
driver - The driver instance for which to get the underlying WebDriver.public static boolean isMobileDevice(org.openqa.selenium.WebDriver driver)
driver - The driver for which to check if it represents a mobile
device.true if the platform running the test is a mobile
platform. false otherwise.public static boolean isLandscapeOrientation(Logger logger, org.openqa.selenium.WebDriver driver)
driver - The driver for which to check the orientation.true if this is a mobile device and is in landscape
orientation. false otherwise.public static String selectRootElement(org.openqa.selenium.JavascriptExecutor executor)
public static String setOverflow(org.openqa.selenium.JavascriptExecutor executor, String value, org.openqa.selenium.WebElement rootElement)
executor - The executor to use for setting the overflow.value - The overflow value to set.null if undefined).public static Location getCurrentScrollPosition(IEyesJsExecutor executor)
executor - The executor to use.public static void setCurrentScrollPosition(IEyesJsExecutor executor, Location location)
executor - The executor to use.location - The position to be set.public static RectangleSize getCurrentFrameContentEntireSize(IEyesJsExecutor executor)
executor - The executor to use.public static RectangleSize getEntireElementSize(Logger logger, IEyesJsExecutor executor, org.openqa.selenium.WebElement element)
public static RectangleSize getViewportSize(org.openqa.selenium.JavascriptExecutor executor)
executor - The executor to use.public static RectangleSize getViewportSizeOrDisplaySize(Logger logger, org.openqa.selenium.WebDriver driver)
logger - The logger to use.driver - The web driver to use.public static boolean setBrowserSize(Logger logger, org.openqa.selenium.WebDriver driver, RectangleSize requiredSize)
public static boolean setBrowserSizeByViewportSize(Logger logger, org.openqa.selenium.WebDriver driver, RectangleSize actualViewportSize, RectangleSize requiredViewportSize)
public static void setViewportSize(Logger logger, org.openqa.selenium.WebDriver driver, RectangleSize size)
logger - The logger to use.driver - The web driver to use.size - The size to set as the viewport size.public static boolean isAndroid(org.openqa.selenium.WebDriver driver)
driver - The driver to test.true if the driver is an Android driver.
false otherwise.public static boolean isIOS(org.openqa.selenium.WebDriver driver)
driver - The driver to test.true if the driver is an iOS driver.
false otherwise.public static String getPlatformVersion(org.openqa.selenium.HasCapabilities driver)
driver - The driver to get the platform version from.null if it is undefined.public static float getDevicePixelRatio(IEyesJsExecutor executor)
executor - The executor to use.public static Map<String,String> getCurrentTransform(IEyesJsExecutor executor)
executor - The executor to use.JS_TRANSFORM_KEYS.public static void setTransforms(IEyesJsExecutor executor, Map<String,String> transforms)
executor - The executor to use.transforms - The transforms to set. Keys are used as style keys,
and values are the values for those styles.public static void setTransform(IEyesJsExecutor executor, String transform)
JS_TRANSFORM_KEYS .executor - The executor to use.transform - The transform value to set.public static void translateTo(IEyesJsExecutor executor, Location position)
executor - The executor to use.position - The position to translate to.public static RectangleSize getElementVisibleSize(Logger logger, org.openqa.selenium.WebElement element)
element - The element for which to return the size.Copyright © 2019. All rights reserved.