public class EyesSeleniumUtils extends Object
| Constructor and Description |
|---|
EyesSeleniumUtils() |
| Modifier and Type | Method and Description |
|---|---|
static RectangleSize |
executeViewportSizeExtraction(org.openqa.selenium.JavascriptExecutor executor) |
static RectangleSize |
extractViewportSize(Logger logger,
org.openqa.selenium.WebDriver driver) |
static RectangleSize |
getCurrentFrameContentEntireSize(org.openqa.selenium.JavascriptExecutor executor) |
static Location |
getCurrentScrollPosition(org.openqa.selenium.JavascriptExecutor executor) |
static Map<String,String> |
getCurrentTransform(org.openqa.selenium.JavascriptExecutor executor) |
static float |
getDevicePixelRatio(org.openqa.selenium.JavascriptExecutor executor) |
static Location |
getPageLocation(org.openqa.selenium.interactions.internal.Coordinates coordinates)
Extracts the location relative to the entire page from the coordinates
(e.g.
|
static String |
getPlatformVersion(org.openqa.selenium.HasCapabilities driver) |
static Location |
getViewportLocation(org.openqa.selenium.interactions.internal.Coordinates coordinates)
Extracts the location relative to the viewport from the
coordinates (e.g.
|
static String |
hideScrollbars(org.openqa.selenium.JavascriptExecutor executor,
int stabilizationTimeout)
Hides the scrollbars of the current context's document element.
|
static boolean |
isAndroid(org.openqa.selenium.WebDriver driver) |
static boolean |
isIOS(org.openqa.selenium.WebDriver driver) |
static boolean |
isLandscapeOrientation(org.openqa.selenium.WebDriver driver) |
static boolean |
isMobileDevice(org.openqa.selenium.WebDriver driver) |
static void |
setCurrentScrollPosition(org.openqa.selenium.JavascriptExecutor executor,
Location location)
Sets the scroll position of the current frame.
|
static String |
setOverflow(org.openqa.selenium.JavascriptExecutor executor,
String value)
Sets the overflow of the current context's document element.
|
static void |
setTransform(org.openqa.selenium.JavascriptExecutor executor,
String transform)
Set the given transform to document.documentElement for all style keys
defined in
JS_TRANSFORM_KEYS . |
static void |
setTransforms(org.openqa.selenium.JavascriptExecutor 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(org.openqa.selenium.JavascriptExecutor executor,
Location position)
Translates the current documentElement to the given position.
|
public static Location getPageLocation(org.openqa.selenium.interactions.internal.Coordinates coordinates)
coordinates - The coordinates from which location is extracted.public static Location getViewportLocation(org.openqa.selenium.interactions.internal.Coordinates coordinates)
coordinates - The coordinates from which location is extracted.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(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 setOverflow(org.openqa.selenium.JavascriptExecutor executor, String value)
executor - The executor to use for setting the overflow.value - The overflow value to set.null if undefined).public static String hideScrollbars(org.openqa.selenium.JavascriptExecutor executor, int stabilizationTimeout)
executor - The executor to use for hiding the scrollbars.stabilizationTimeout - The amount of time to wait for the "hide
scrollbars" action to take effect
(Milliseconds). Zero/negative values are
ignored.null).public static Location getCurrentScrollPosition(org.openqa.selenium.JavascriptExecutor executor)
executor - The executor to use.public static void setCurrentScrollPosition(org.openqa.selenium.JavascriptExecutor executor,
Location location)
executor - The executor to use.location - The position to be set.public static RectangleSize getCurrentFrameContentEntireSize(org.openqa.selenium.JavascriptExecutor executor)
executor - The executor to use.public static RectangleSize executeViewportSizeExtraction(org.openqa.selenium.JavascriptExecutor executor)
executor - The executor to use.public static RectangleSize extractViewportSize(Logger logger, org.openqa.selenium.WebDriver driver)
logger - The logger to use.driver - The web driver to use.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 viepwort 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(org.openqa.selenium.JavascriptExecutor executor)
executor - The executor to use.public static Map<String,String> getCurrentTransform(org.openqa.selenium.JavascriptExecutor executor)
executor - The executor to use.JS_TRANSFORM_KEYS.public static void setTransforms(org.openqa.selenium.JavascriptExecutor 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(org.openqa.selenium.JavascriptExecutor executor,
String transform)
JS_TRANSFORM_KEYS .executor - The executor to use.transform - The transform value to set.public static void translateTo(org.openqa.selenium.JavascriptExecutor executor,
Location position)
executor - The executor to use.position - The position to translate to.Copyright © 2016. All rights reserved.