public class Eyes extends EyesBase
Modifier and Type | Class and Description |
---|---|
static interface |
Eyes.WebDriverAction |
Modifier and Type | Field and Description |
---|---|
static double |
DEFAULT_DEVICE_PIXEL_RATIO |
static double |
UNKNOWN_DEVICE_PIXEL_RATIO |
cutProviderHandler, debugScreenshotsProvider, lastScreenshot, logger, positionProvider, runningSession, scaleProviderHandler, serverConnector, sessionStartInfo, stitchingOverlap, USE_DEFAULT_TIMEOUT, viewportSizeHandler
Constructor and Description |
---|
Eyes()
Creates a new Eyes instance that interacts with the Eyes cloud
service.
|
Eyes(URI serverUrl)
Creates a new (possibly disabled) Eyes instance that interacts with the
Eyes Server at the specified url.
|
Modifier and Type | Method and Description |
---|---|
void |
addMouseTrigger(MouseAction action,
Region control,
Location cursor)
Adds a mouse trigger.
|
void |
addMouseTrigger(MouseAction action,
org.openqa.selenium.WebElement element)
Adds a mouse trigger.
|
void |
addTextTrigger(Region control,
String text)
Adds a keyboard trigger.
|
void |
addTextTrigger(org.openqa.selenium.WebElement element,
String text)
Adds a keyboard trigger.
|
protected void |
beforeMatchWindow() |
protected void |
beforeOpen() |
void |
check(String name,
ICheckSettings checkSettings) |
protected void |
checkCurrentFrame(int matchTimeout,
String tag)
Verifies the current frame.
|
void |
checkElement(org.openqa.selenium.By selector)
|
void |
checkElement(org.openqa.selenium.By selector,
int matchTimeout,
String tag)
Takes a snapshot of the application under test and matches an element
specified by the given selector with the expected region output.
|
void |
checkElement(org.openqa.selenium.By selector,
String tag)
|
void |
checkElement(org.openqa.selenium.WebElement element)
|
void |
checkElement(org.openqa.selenium.WebElement element,
int matchTimeout,
String tag)
Takes a snapshot of the application under test and matches a specific
element with the expected region output.
|
void |
checkElement(org.openqa.selenium.WebElement element,
String tag)
|
void |
checkFrame(int frameIndex)
|
void |
checkFrame(int frameIndex,
int matchTimeout,
String tag)
Matches the frame given as parameter, by switching into the frame and
using stitching to get an image of the frame.
|
void |
checkFrame(int frameIndex,
String tag)
|
void |
checkFrame(String frameNameOrId)
|
void |
checkFrame(String[] framesPath)
|
void |
checkFrame(String[] framePath,
int matchTimeout,
String tag)
Matches the frame given by the frames path, by switching into the frame
and using stitching to get an image of the frame.
|
void |
checkFrame(String[] framesPath,
String tag)
|
void |
checkFrame(String frameNameOrId,
int matchTimeout,
String tag)
Matches the frame given as parameter, by switching into the frame and
using stitching to get an image of the frame.
|
void |
checkFrame(String frameNameOrId,
String tag)
|
void |
checkFrame(org.openqa.selenium.WebElement frameReference)
|
void |
checkFrame(org.openqa.selenium.WebElement frameReference,
int matchTimeout,
String tag)
Matches the frame given as parameter, by switching into the frame and
using stitching to get an image of the frame.
|
void |
checkFrame(org.openqa.selenium.WebElement frameReference,
String tag)
|
protected void |
checkFrameFluent(String name,
ICheckSettings checkSettings) |
void |
checkRegion(org.openqa.selenium.By selector)
|
void |
checkRegion(org.openqa.selenium.By selector,
boolean stitchContent)
|
void |
checkRegion(org.openqa.selenium.By selector,
int matchTimeout,
String tag)
Takes a snapshot of the application under test and matches a region
specified by the given selector with the expected region output.
|
void |
checkRegion(org.openqa.selenium.By selector,
int matchTimeout,
String tag,
boolean stitchContent)
If
stitchContent is false then behaves the same as
checkRegion(org.openqa.selenium.By, int, String) . |
void |
checkRegion(org.openqa.selenium.By selector,
String tag)
|
void |
checkRegion(org.openqa.selenium.By selector,
String tag,
boolean stitchContent)
|
void |
checkRegion(Region region)
|
void |
checkRegion(Region region,
int matchTimeout,
String tag)
Takes a snapshot of the application under test and matches a specific region within it with the expected output.
|
void |
checkRegion(org.openqa.selenium.WebElement element)
|
void |
checkRegion(org.openqa.selenium.WebElement element,
boolean stitchContent)
If
stitchContent is false then behaves the same as
checkRegion(org.openqa.selenium.WebElement) , otherwise
behaves the same as checkElement(WebElement) . |
void |
checkRegion(org.openqa.selenium.WebElement element,
int matchTimeout,
String tag)
Takes a snapshot of the application under test and matches a region of
a specific element with the expected region output.
|
void |
checkRegion(org.openqa.selenium.WebElement element,
int matchTimeout,
String tag,
boolean stitchContent)
if
stitchContent is false then behaves the same checkRegion(org.openqa.selenium.WebElement, int, String) . |
void |
checkRegion(org.openqa.selenium.WebElement element,
String tag)
|
void |
checkRegion(org.openqa.selenium.WebElement element,
String tag,
boolean stitchContent)
if
stitchContent is false then behaves the same checkRegion(org.openqa.selenium.WebElement, String) . |
void |
checkRegionInFrame(int frameIndex,
org.openqa.selenium.By selector)
|
void |
checkRegionInFrame(int frameIndex,
org.openqa.selenium.By selector,
boolean stitchContent)
|
void |
checkRegionInFrame(int frameIndex,
org.openqa.selenium.By selector,
int matchTimeout,
String tag)
|
void |
checkRegionInFrame(int frameIndex,
org.openqa.selenium.By selector,
int matchTimeout,
String tag,
boolean stitchContent)
Switches into the given frame, takes a snapshot of the application under
test and matches a region specified by the given selector.
|
void |
checkRegionInFrame(int frameIndex,
org.openqa.selenium.By selector,
String tag)
|
void |
checkRegionInFrame(int frameIndex,
org.openqa.selenium.By selector,
String tag,
boolean stitchContent)
|
void |
checkRegionInFrame(String[] framePath,
org.openqa.selenium.By selector)
|
void |
checkRegionInFrame(String[] framePath,
org.openqa.selenium.By selector,
int matchTimeout,
String tag)
|
void |
checkRegionInFrame(String[] framePath,
org.openqa.selenium.By selector,
int matchTimeout,
String tag,
boolean stitchContent)
Switches into the given frame, takes a snapshot of the application under
test and matches a region specified by the given selector.
|
void |
checkRegionInFrame(String[] framePath,
org.openqa.selenium.By selector,
String tag)
|
void |
checkRegionInFrame(String frameNameOrId,
org.openqa.selenium.By selector)
|
void |
checkRegionInFrame(String frameNameOrId,
org.openqa.selenium.By selector,
boolean stitchContent)
|
void |
checkRegionInFrame(String frameNameOrId,
org.openqa.selenium.By selector,
int matchTimeout,
String tag)
|
void |
checkRegionInFrame(String frameNameOrId,
org.openqa.selenium.By selector,
int matchTimeout,
String tag,
boolean stitchContent)
Switches into the given frame, takes a snapshot of the application under
test and matches a region specified by the given selector.
|
void |
checkRegionInFrame(String frameNameOrId,
org.openqa.selenium.By selector,
String tag)
|
void |
checkRegionInFrame(String frameNameOrId,
org.openqa.selenium.By selector,
String tag,
boolean stitchContent)
|
void |
checkRegionInFrame(org.openqa.selenium.WebElement frameReference,
org.openqa.selenium.By selector)
|
void |
checkRegionInFrame(org.openqa.selenium.WebElement frameReference,
org.openqa.selenium.By selector,
boolean stitchContent)
|
void |
checkRegionInFrame(org.openqa.selenium.WebElement frameReference,
org.openqa.selenium.By selector,
int matchTimeout,
String tag)
|
void |
checkRegionInFrame(org.openqa.selenium.WebElement frameReference,
org.openqa.selenium.By selector,
int matchTimeout,
String tag,
boolean stitchContent)
Switches into the given frame, takes a snapshot of the application under
test and matches a region specified by the given selector.
|
void |
checkRegionInFrame(org.openqa.selenium.WebElement frameReference,
org.openqa.selenium.By selector,
String tag)
|
void |
checkRegionInFrame(org.openqa.selenium.WebElement frameReference,
org.openqa.selenium.By selector,
String tag,
boolean stitchContent)
|
void |
checkWindow()
See
checkWindow(String) . |
void |
checkWindow(int matchTimeout,
String tag)
Takes a snapshot of the application under test and matches it with
the expected output.
|
void |
checkWindow(String tag)
|
protected AppEnvironment |
getAppEnvironment() |
String |
getBaseAgentId() |
double |
getDevicePixelRatio() |
org.openqa.selenium.WebDriver |
getDriver() |
PositionProvider |
getElementPositionProvider() |
boolean |
getForceFullPageScreenshot() |
boolean |
getHideScrollbars() |
protected String |
getInferredEnvironment() |
Region |
getRegionToCheck() |
ImageRotation |
getRotation() |
protected EyesScreenshot |
getScreenshot() |
boolean |
getScrollToRegion() |
StitchMode |
getStitchMode() |
protected EyesScreenshot |
getSubScreenshot(EyesScreenshot screenshot,
Region region,
ICheckSettingsInternal checkSettingsInternal) |
protected String |
getTitle() |
RectangleSize |
getViewportSize()
Use this method only if you made a previous call to
(WebDriver, String, String) or one of its variants. |
static RectangleSize |
getViewportSize(org.openqa.selenium.WebDriver driver)
Call this method if for some
reason you don't want to call
open(WebDriver, String, String)
(or one of its variants) yet. |
int |
getWaitBeforeScreenshots() |
org.openqa.selenium.WebDriver |
open(org.openqa.selenium.WebDriver driver,
String appName,
String testName)
|
org.openqa.selenium.WebDriver |
open(org.openqa.selenium.WebDriver driver,
String appName,
String testName,
RectangleSize viewportSize)
|
protected org.openqa.selenium.WebDriver |
open(org.openqa.selenium.WebDriver driver,
String appName,
String testName,
RectangleSize viewportSize,
SessionType sessionType)
Starts a test.
|
protected org.openqa.selenium.WebDriver |
open(org.openqa.selenium.WebDriver driver,
String appName,
String testName,
SessionType sessionType)
|
void |
setForceFullPageScreenshot(boolean shouldForce)
Forces a full page screenshot (by scrolling and stitching) if the
browser only supports viewport screenshots).
|
void |
setHideScrollbars(boolean shouldHide)
Hide the scrollbars when taking screenshots.
|
void |
setRegionToCheck(Region regionToCheck) |
void |
setRotation(ImageRotation rotation) |
void |
setScrollToRegion(boolean shouldScroll)
Turns on/off the automatic scrolling to a region being checked by
checkRegion . |
void |
setStitchMode(StitchMode mode)
Set the type of stitching used for full page screenshots.
|
protected void |
setViewportSize(RectangleSize size)
Use this method only if you made a previous call to
(WebDriver, String, String) or one of its variants. |
static void |
setViewportSize(org.openqa.selenium.WebDriver driver,
RectangleSize size)
Set the viewport size using the driver.
|
void |
setWaitBeforeScreenshots(int waitBeforeScreenshots)
Sets the time to wait just before taking a screenshot (e.g., to allow
positioning to stabilize when performing a full page stitching).
|
boolean |
shouldStitchContent() |
void |
testResponseTime(org.openqa.selenium.WebDriver driver,
String appName,
String testName)
|
void |
testResponseTime(org.openqa.selenium.WebDriver driver,
String appName,
String testName,
Eyes.WebDriverAction action)
|
void |
testResponseTime(org.openqa.selenium.WebDriver driver,
String appName,
String testName,
Eyes.WebDriverAction action,
int deadline)
|
void |
testResponseTime(org.openqa.selenium.WebDriver driver,
String appName,
String testName,
Eyes.WebDriverAction action,
int deadline,
int timeout)
Run a visual performance test.
|
void |
testResponseTime(org.openqa.selenium.WebDriver driver,
String appName,
String testName,
Eyes.WebDriverAction action,
int deadline,
int timeout,
RectangleSize viewportSize)
Similar to
testResponseTime(WebDriver, String, String, WebDriverAction, int, int) ,
except this method sets the viewport size before starting the
performance test. |
void |
testResponseTime(org.openqa.selenium.WebDriver driver,
String appName,
String testName,
Eyes.WebDriverAction action,
int deadline,
RectangleSize viewportSize)
|
void |
testResponseTime(org.openqa.selenium.WebDriver driver,
String appName,
String testName,
Eyes.WebDriverAction action,
RectangleSize viewportSize)
|
void |
testResponseTime(org.openqa.selenium.WebDriver driver,
String appName,
String testName,
int deadline)
|
void |
testResponseTime(org.openqa.selenium.WebDriver driver,
String appName,
String testName,
int deadline,
int timeout,
RectangleSize viewportSize)
|
void |
testResponseTime(org.openqa.selenium.WebDriver driver,
String appName,
String testName,
int deadline,
RectangleSize viewportSize)
|
void |
testResponseTime(org.openqa.selenium.WebDriver driver,
String appName,
String testName,
RectangleSize viewportSize)
|
void |
testWindow(org.openqa.selenium.WebDriver driver,
String testName)
|
void |
testWindow(org.openqa.selenium.WebDriver driver,
String testName,
RectangleSize viewportSize)
|
void |
testWindow(org.openqa.selenium.WebDriver driver,
String appName,
String testName)
|
void |
testWindow(org.openqa.selenium.WebDriver driver,
String appName,
String testName,
RectangleSize viewportSize)
Runs a test on the current window.
|
protected ScaleProviderFactory |
updateScalingParams()
Updates the state of scaling related parameters.
|
abortIfNotClosed, addMouseTriggerBase, addProperty, addTextTriggerBase, addUserInput, afterMatchWindow, afterOpen, checkWindowBase, checkWindowBase, checkWindowBase, clearProperties, clearUserInputs, close, close, closeResponseTime, getAgentId, getApiKey, getAppName, getBaselineEnvName, getBaselineName, getBatch, getBranchName, getDebugScreenshotsPath, getDebugScreenshotsPrefix, getDebugScreenshotsProvider, getDefaultMatchSettings, getDefaultServerUrl, getEnvName, getFailureReports, getFullAgentId, getHostApp, getHostOS, getIgnoreCaret, getIsCutProviderExplicitlySet, getIsDisabled, getIsOpen, getLogHandler, getMatchLevel, getMatchTimeout, getParentBranchName, getPositionProvider, getProxy, getSaveDebugScreenshots, getSaveFailedTests, getSaveNewTests, getScaleRatio, getServerUrl, getStitchOverlap, getUserInputs, openBase, setAgentId, setApiKey, setAppEnvironment, setAppName, setBaselineEnvName, setBaselineName, setBatch, setBranchName, setDebugScreenshotsPath, setDebugScreenshotsPrefix, setDefaultMatchSettings, setEnvName, setExplicitViewportSize, setFailureReports, setHostApp, setHostOS, setIgnoreCaret, setImageCut, setIsDisabled, setLogHandler, setMatchLevel, setMatchTimeout, setParentBranchName, setPositionProvider, setProxy, setSaveDebugScreenshots, setSaveFailedTests, setSaveNewTests, setScaleRatio, setServerUrl, setServerUrl, setStitchOverlap, startSession, testResponseTimeBase
public static final double UNKNOWN_DEVICE_PIXEL_RATIO
public static final double DEFAULT_DEVICE_PIXEL_RATIO
public Eyes(URI serverUrl)
serverUrl
- The Eyes server URL.public Eyes()
public Region getRegionToCheck()
public void setRegionToCheck(Region regionToCheck)
public boolean shouldStitchContent()
public String getBaseAgentId()
getBaseAgentId
in class EyesBase
public org.openqa.selenium.WebDriver getDriver()
public void setForceFullPageScreenshot(boolean shouldForce)
shouldForce
- Whether to force a full page screenshot or not.public boolean getForceFullPageScreenshot()
public void setWaitBeforeScreenshots(int waitBeforeScreenshots)
waitBeforeScreenshots
- The time to wait (Milliseconds). Values
smaller or equal to 0, will cause the
default value to be used.public int getWaitBeforeScreenshots()
public void setScrollToRegion(boolean shouldScroll)
checkRegion
.shouldScroll
- Whether to automatically scroll to a region being validated.public boolean getScrollToRegion()
public void setStitchMode(StitchMode mode)
StitchMode.CSS
.
Default is StitchMode.SCROLL
.mode
- The stitch mode to set.public StitchMode getStitchMode()
public void setHideScrollbars(boolean shouldHide)
shouldHide
- Whether to hide the scrollbars or not.public boolean getHideScrollbars()
public ImageRotation getRotation()
public void setRotation(ImageRotation rotation)
rotation
- The image rotation data.public double getDevicePixelRatio()
UNKNOWN_DEVICE_PIXEL_RATIO
if the DPR is not known yet or if it wasn't possible to extract it.public org.openqa.selenium.WebDriver open(org.openqa.selenium.WebDriver driver, String appName, String testName, RectangleSize viewportSize)
public org.openqa.selenium.WebDriver open(org.openqa.selenium.WebDriver driver, String appName, String testName)
open(WebDriver, String, String, SessionType)
.
viewportSize
defaults to null
.
sessionType
defaults to null
.protected org.openqa.selenium.WebDriver open(org.openqa.selenium.WebDriver driver, String appName, String testName, RectangleSize viewportSize, SessionType sessionType)
driver
- The web driver that controls the browser hosting
the application under test.appName
- The name of the application under test.testName
- The test name.viewportSize
- The required browser's viewport size
(i.e., the visible part of the document's body) or
null
to use the current window's viewport.sessionType
- The type of test (e.g., standard test / visual
performance test).protected org.openqa.selenium.WebDriver open(org.openqa.selenium.WebDriver driver, String appName, String testName, SessionType sessionType)
public void checkWindow()
public void checkWindow(String tag)
checkWindow(int, String)
.
Default match timeout is used.tag
- An optional tag to be associated with the snapshot.public void checkWindow(int matchTimeout, String tag)
matchTimeout
- The amount of time to retry matching (Milliseconds).tag
- An optional tag to be associated with the snapshot.TestFailedException
- Thrown if a mismatch is detected and
immediate failure reports are enabled.public void testWindow(org.openqa.selenium.WebDriver driver, String appName, String testName, RectangleSize viewportSize)
driver
- The web driver that controls the browser hosting
the application under test.appName
- The name of the application under test.testName
- The test name (will also be used as the tag name for the step).viewportSize
- The required browser's viewport size
(i.e., the visible part of the document's body) or
null
to use the current window's viewport.public void testWindow(org.openqa.selenium.WebDriver driver, String appName, String testName)
public void testWindow(org.openqa.selenium.WebDriver driver, String testName, RectangleSize viewportSize)
testWindow(WebDriver, String, String, RectangleSize)
.
appName
defaults to null
(which means the name set in
EyesBase.setAppName(String)
would be used.public void testWindow(org.openqa.selenium.WebDriver driver, String testName)
public void testResponseTime(org.openqa.selenium.WebDriver driver, String appName, String testName, Eyes.WebDriverAction action, int deadline, int timeout)
driver
- The driver to use.appName
- The name of the application being tested.testName
- The test name.action
- Actions to be performed in parallel to starting the test.deadline
- The expected time until the application should have been loaded. (Seconds)timeout
- The maximum time until the application should have been loaded. (Seconds)public void testResponseTime(org.openqa.selenium.WebDriver driver, String appName, String testName, Eyes.WebDriverAction action, int deadline)
testResponseTime(WebDriver, String, String, WebDriverAction, int, int)
.
timeout
defaults to deadline
+ RESPONSE_TIME_DEFAULT_DIFF_FROM_DEADLINE
.public void testResponseTime(org.openqa.selenium.WebDriver driver, String appName, String testName, Eyes.WebDriverAction action)
testResponseTime(WebDriver, String, String, WebDriverAction, int, int)
.
deadline
defaults to RESPONSE_TIME_DEFAULT_DEADLINE
.
timeout
defaults to RESPONSE_TIME_DEFAULT_DEADLINE
+ RESPONSE_TIME_DEFAULT_DIFF_FROM_DEADLINE
.public void testResponseTime(org.openqa.selenium.WebDriver driver, String appName, String testName, int deadline)
testResponseTime(WebDriver, String, String, WebDriverAction, int, int)
.
action
defaults to null
.
timeout
defaults to deadline
+ RESPONSE_TIME_DEFAULT_DIFF_FROM_DEADLINE
.public void testResponseTime(org.openqa.selenium.WebDriver driver, String appName, String testName)
testResponseTime(WebDriver, String, String, WebDriverAction, int, int)
.
deadline
defaults to RESPONSE_TIME_DEFAULT_DEADLINE
.
timeout
defaults to RESPONSE_TIME_DEFAULT_DEADLINE
+ RESPONSE_TIME_DEFAULT_DIFF_FROM_DEADLINE
.
action
defaults to null
.public void testResponseTime(org.openqa.selenium.WebDriver driver, String appName, String testName, Eyes.WebDriverAction action, int deadline, int timeout, RectangleSize viewportSize)
testResponseTime(WebDriver, String, String, WebDriverAction, int, int)
,
except this method sets the viewport size before starting the
performance test.viewportSize
- The required viewport size.public void testResponseTime(org.openqa.selenium.WebDriver driver, String appName, String testName, Eyes.WebDriverAction action, int deadline, RectangleSize viewportSize)
testResponseTime(WebDriver, String, String, WebDriverAction, int, int, RectangleSize)
.
timeout
defaults to deadline
+ RESPONSE_TIME_DEFAULT_DIFF_FROM_DEADLINE
.public void testResponseTime(org.openqa.selenium.WebDriver driver, String appName, String testName, Eyes.WebDriverAction action, RectangleSize viewportSize)
testResponseTime(WebDriver, String, String, WebDriverAction, int, int, RectangleSize)
.
deadline
defaults to RESPONSE_TIME_DEFAULT_DEADLINE
.
timeout
defaults to RESPONSE_TIME_DEFAULT_DEADLINE
+ RESPONSE_TIME_DEFAULT_DIFF_FROM_DEADLINE
.public void testResponseTime(org.openqa.selenium.WebDriver driver, String appName, String testName, int deadline, int timeout, RectangleSize viewportSize)
testResponseTime(WebDriver, String, String, WebDriverAction, int, int, RectangleSize)
.
action
defaults to null
.public void testResponseTime(org.openqa.selenium.WebDriver driver, String appName, String testName, int deadline, RectangleSize viewportSize)
testResponseTime(WebDriver, String, String, int, int, RectangleSize)
.
timeout
defaults to deadline
+ RESPONSE_TIME_DEFAULT_DIFF_FROM_DEADLINE
.public void testResponseTime(org.openqa.selenium.WebDriver driver, String appName, String testName, RectangleSize viewportSize)
testResponseTime(WebDriver, String, String, int, int, RectangleSize)
.
deadline
defaults to RESPONSE_TIME_DEFAULT_DEADLINE
.
timeout
defaults to RESPONSE_TIME_DEFAULT_DEADLINE
+ RESPONSE_TIME_DEFAULT_DIFF_FROM_DEADLINE
.public void check(String name, ICheckSettings checkSettings)
protected void checkFrameFluent(String name, ICheckSettings checkSettings)
public void checkRegion(Region region)
public void checkRegion(Region region, int matchTimeout, String tag)
region
- A non empty region representing the screen region to check.matchTimeout
- The amount of time to retry matching. (Milliseconds)tag
- An optional tag to be associated with the snapshot.TestFailedException
- Thrown if a mismatch is detected and immediate failure reports are enabled.public void checkRegion(org.openqa.selenium.WebElement element)
public void checkRegion(org.openqa.selenium.WebElement element, boolean stitchContent)
stitchContent
is false
then behaves the same as
checkRegion(org.openqa.selenium.WebElement)
, otherwise
behaves the same as checkElement(WebElement)
.public void checkRegion(org.openqa.selenium.WebElement element, String tag)
checkRegion(WebElement, int, String)
.
Default match timeout is used.public void checkRegion(org.openqa.selenium.WebElement element, String tag, boolean stitchContent)
stitchContent
is false
then behaves the same checkRegion(org.openqa.selenium.WebElement, String)
. Otherwise
behaves the same as checkElement(WebElement, String)
.public void checkRegion(org.openqa.selenium.WebElement element, int matchTimeout, String tag)
element
- The element which represents the region to check.matchTimeout
- The amount of time to retry matching. (Milliseconds)tag
- An optional tag to be associated with the snapshot.TestFailedException
- if a mismatch is detected and
immediate failure reports are enabledpublic void checkRegion(org.openqa.selenium.WebElement element, int matchTimeout, String tag, boolean stitchContent)
stitchContent
is false
then behaves the same checkRegion(org.openqa.selenium.WebElement, int, String)
. Otherwise
behaves the same as checkElement(WebElement, String)
.public void checkRegion(org.openqa.selenium.By selector)
public void checkRegion(org.openqa.selenium.By selector, boolean stitchContent)
stitchContent
is false
then behaves the same as
checkRegion(org.openqa.selenium.By)
. Otherwise, behaves the
same as #checkElement(org.openqa.selenium.By)
public void checkRegion(org.openqa.selenium.By selector, String tag)
checkRegion(By, int, String)
.
Default match timeout is used.public void checkRegion(org.openqa.selenium.By selector, String tag, boolean stitchContent)
stitchContent
is false
then behaves the same as
checkRegion(org.openqa.selenium.By, String)
. Otherwise,
behaves the same as checkElement(By, String)
.public void checkRegion(org.openqa.selenium.By selector, int matchTimeout, String tag)
selector
- Selects the region to check.matchTimeout
- The amount of time to retry matching. (Milliseconds)tag
- An optional tag to be associated with the screenshot.TestFailedException
- if a mismatch is detected and
immediate failure reports are enabledpublic void checkRegion(org.openqa.selenium.By selector, int matchTimeout, String tag, boolean stitchContent)
stitchContent
is false
then behaves the same as
checkRegion(org.openqa.selenium.By, int, String)
. Otherwise,
behaves the same as checkElement(By, int, String)
.public void checkRegionInFrame(int frameIndex, org.openqa.selenium.By selector)
public void checkRegionInFrame(int frameIndex, org.openqa.selenium.By selector, boolean stitchContent)
public void checkRegionInFrame(int frameIndex, org.openqa.selenium.By selector, String tag)
public void checkRegionInFrame(int frameIndex, org.openqa.selenium.By selector, String tag, boolean stitchContent)
checkRegionInFrame(int, By, int, String, boolean)
.
Default match timeout is used.public void checkRegionInFrame(int frameIndex, org.openqa.selenium.By selector, int matchTimeout, String tag)
public void checkRegionInFrame(int frameIndex, org.openqa.selenium.By selector, int matchTimeout, String tag, boolean stitchContent)
frameIndex
- The index of the frame to switch to. (The same index
as would be used in a call to
driver.switchTo().frame()).selector
- A Selector specifying the region to check.matchTimeout
- The amount of time to retry matching. (Milliseconds)tag
- An optional tag to be associated with the snapshot.stitchContent
- If true
, stitch the internal content of
the region (i.e., perform
checkElement(By, int, String)
on the
region.public void checkRegionInFrame(String frameNameOrId, org.openqa.selenium.By selector)
public void checkRegionInFrame(String frameNameOrId, org.openqa.selenium.By selector, boolean stitchContent)
public void checkRegionInFrame(String frameNameOrId, org.openqa.selenium.By selector, String tag)
public void checkRegionInFrame(String frameNameOrId, org.openqa.selenium.By selector, String tag, boolean stitchContent)
checkRegionInFrame(String, By, int, String, boolean)
.
Default match timeout is usedpublic void checkRegionInFrame(String frameNameOrId, org.openqa.selenium.By selector, int matchTimeout, String tag)
public void checkRegionInFrame(String frameNameOrId, org.openqa.selenium.By selector, int matchTimeout, String tag, boolean stitchContent)
frameNameOrId
- The name or id of the frame to switch to. (as would
be used in a call to driver.switchTo().frame()).selector
- A Selector specifying the region to check.matchTimeout
- The amount of time to retry matching. (Milliseconds)tag
- An optional tag to be associated with the snapshot.stitchContent
- If true
, stitch the internal content of
the region (i.e., perform
checkElement(By, int, String)
on the region.public void checkRegionInFrame(org.openqa.selenium.WebElement frameReference, org.openqa.selenium.By selector)
public void checkRegionInFrame(org.openqa.selenium.WebElement frameReference, org.openqa.selenium.By selector, boolean stitchContent)
public void checkRegionInFrame(org.openqa.selenium.WebElement frameReference, org.openqa.selenium.By selector, String tag)
public void checkRegionInFrame(org.openqa.selenium.WebElement frameReference, org.openqa.selenium.By selector, String tag, boolean stitchContent)
checkRegionInFrame(WebElement, By, int, String, boolean)
.
Default match timeout is used.public void checkRegionInFrame(org.openqa.selenium.WebElement frameReference, org.openqa.selenium.By selector, int matchTimeout, String tag)
public void checkRegionInFrame(org.openqa.selenium.WebElement frameReference, org.openqa.selenium.By selector, int matchTimeout, String tag, boolean stitchContent)
frameReference
- The element which is the frame to switch to. (as
would be used in a call to
driver.switchTo().frame()).selector
- A Selector specifying the region to check.matchTimeout
- The amount of time to retry matching.
(Milliseconds)tag
- An optional tag to be associated with the snapshot.stitchContent
- If true
, stitch the internal content of
the region (i.e., perform
checkElement(By, int, String)
on the
region.protected ScaleProviderFactory updateScalingParams()
protected void checkCurrentFrame(int matchTimeout, String tag)
matchTimeout
- The amount of time to retry matching. (Milliseconds)tag
- An optional tag to be associated with the snapshot.public void checkFrame(String frameNameOrId)
public void checkFrame(String frameNameOrId, String tag)
checkFrame(String, int, String)
.
Default match timeout is used.public void checkFrame(String frameNameOrId, int matchTimeout, String tag)
frameNameOrId
- The name or id of the frame to check. (The same
name/id as would be used in a call to
driver.switchTo().frame()).matchTimeout
- The amount of time to retry matching. (Milliseconds)tag
- An optional tag to be associated with the match.public void checkFrame(int frameIndex)
public void checkFrame(int frameIndex, String tag)
checkFrame(int, int, String)
.
Default match timeout is used.public void checkFrame(int frameIndex, int matchTimeout, String tag)
frameIndex
- The index of the frame to switch to. (The same index
as would be used in a call to
driver.switchTo().frame()).matchTimeout
- The amount of time to retry matching. (Milliseconds)tag
- An optional tag to be associated with the match.public void checkFrame(org.openqa.selenium.WebElement frameReference)
public void checkFrame(org.openqa.selenium.WebElement frameReference, String tag)
checkFrame(WebElement, int, String)
.
Default match timeout is used.public void checkFrame(org.openqa.selenium.WebElement frameReference, int matchTimeout, String tag)
frameReference
- The element which is the frame to switch to. (as
would be used in a call to
driver.switchTo().frame() ).matchTimeout
- The amount of time to retry matching (milliseconds).tag
- An optional tag to be associated with the match.public void checkFrame(String[] framePath, int matchTimeout, String tag)
framePath
- The path to the frame to check. This is a list of
frame names/IDs (where each frame is nested in the
previous frame).matchTimeout
- The amount of time to retry matching (milliseconds).tag
- An optional tag to be associated with the match.public void checkFrame(String[] framesPath, String tag)
checkFrame(String[], int, String)
.
Default match timeout is used.public void checkFrame(String[] framesPath)
public void checkRegionInFrame(String[] framePath, org.openqa.selenium.By selector, int matchTimeout, String tag, boolean stitchContent)
framePath
- The path to the frame to check. This is a list of
frame names/IDs (where each frame is nested in the previous frame).selector
- A Selector specifying the region to check.matchTimeout
- The amount of time to retry matching (milliseconds).tag
- An optional tag to be associated with the snapshot.stitchContent
- Whether or not to stitch the internal content of the
region (i.e., perform checkElement(By, int, String)
on the region.public void checkRegionInFrame(String[] framePath, org.openqa.selenium.By selector, int matchTimeout, String tag)
public void checkRegionInFrame(String[] framePath, org.openqa.selenium.By selector, String tag)
checkRegionInFrame(String[], By, int, String)
.
Default match timeout is used.public void checkRegionInFrame(String[] framePath, org.openqa.selenium.By selector)
checkRegionInFrame(String[], By, int, String)
.
Default match timeout is used.
tag
defaults to null
.public void checkElement(org.openqa.selenium.WebElement element)
public void checkElement(org.openqa.selenium.WebElement element, String tag)
checkElement(WebElement, int, String)
.
Default match timeout is used.public void checkElement(org.openqa.selenium.WebElement element, int matchTimeout, String tag)
element
- The element to check.matchTimeout
- The amount of time to retry matching. (Milliseconds)tag
- An optional tag to be associated with the snapshot.TestFailedException
- if a mismatch is detected and immediate failure reports are enabledpublic void checkElement(org.openqa.selenium.By selector)
public void checkElement(org.openqa.selenium.By selector, String tag)
checkElement(By, int, String)
.
Default match timeout is used.public void checkElement(org.openqa.selenium.By selector, int matchTimeout, String tag)
selector
- Selects the element to check.matchTimeout
- The amount of time to retry matching. (Milliseconds)tag
- An optional tag to be associated with the screenshot.TestFailedException
- if a mismatch is detected and
immediate failure reports are enabledpublic void addMouseTrigger(MouseAction action, Region control, Location cursor)
action
- Mouse action.control
- The control on which the trigger is activated (context relative coordinates).cursor
- The cursor's position relative to the control.public void addMouseTrigger(MouseAction action, org.openqa.selenium.WebElement element)
action
- Mouse action.element
- The WebElement on which the click was called.public void addTextTrigger(Region control, String text)
control
- The control's context-relative region.text
- The trigger's text.public void addTextTrigger(org.openqa.selenium.WebElement element, String text)
element
- The element for which we sent keys.text
- The trigger's text.public RectangleSize getViewportSize()
(WebDriver, String, String)
or one of its variants.
getViewportSize
in class EyesBase
public static RectangleSize getViewportSize(org.openqa.selenium.WebDriver driver)
open(WebDriver, String, String)
(or one of its variants) yet.driver
- The driver to use for getting the viewport.protected void setViewportSize(RectangleSize size)
(WebDriver, String, String)
or one of its variants.
setViewportSize
in class EyesBase
public static void setViewportSize(org.openqa.selenium.WebDriver driver, RectangleSize size)
open(WebDriver, String, String)
(or one of its variants) yet.driver
- The driver to use for setting the viewport.size
- The required viewport size.protected void beforeOpen()
beforeOpen
in class EyesBase
protected void beforeMatchWindow()
beforeMatchWindow
in class EyesBase
protected EyesScreenshot getSubScreenshot(EyesScreenshot screenshot, Region region, ICheckSettingsInternal checkSettingsInternal)
getSubScreenshot
in class EyesBase
protected EyesScreenshot getScreenshot()
getScreenshot
in class EyesBase
protected String getInferredEnvironment()
getInferredEnvironment
in class EyesBase
protected AppEnvironment getAppEnvironment()
This override also checks for mobile operating system.
getAppEnvironment
in class EyesBase
public PositionProvider getElementPositionProvider()
Copyright © 2018. All rights reserved.