public class Eyes extends Object
| Modifier and Type | Field and Description |
|---|---|
protected com.applitools.eyes.AgentConnector |
agentConnector |
static String |
DEFAULT_CHARSET_NAME |
protected static com.applitools.eyes.MatchLevel |
DEFAULT_MATCH_LEVEL |
protected com.applitools.eyes.EyesScreenshot |
lastScreenshot |
protected com.applitools.eyes.RunningSession |
runningSession |
protected com.applitools.eyes.SessionStartInfo |
sessionStartInfo |
protected com.applitools.eyes.RectangleSize |
viewportSize |
| Constructor and Description |
|---|
Eyes()
Creates a new Eyes instance that interacts with the Eyes cloud
service.
|
Eyes(URI serverUrl)
Creates a new Eyes instance that interacts with the Eyes Server at the
specified url.
|
Eyes(URI serverUrl,
boolean isDisabled)
Creates a new (possibly disabled) Eyes instance that interacts with the
Eyes Server at the specified url.
|
| Modifier and Type | Method and Description |
|---|---|
void |
abortIfNotClosed() |
protected void |
addMouseTrigger(com.applitools.eyes.MouseAction action,
com.applitools.eyes.Region control,
com.applitools.eyes.Location cursor)
Adds a mouse trigger.
|
protected void |
addMouseTrigger(com.applitools.eyes.MouseAction action,
org.openqa.selenium.WebElement element)
Adds a mouse trigger.
|
protected void |
addTextTrigger(com.applitools.eyes.Region control,
String text)
Adds a keyboard trigger.
|
protected void |
addTextTrigger(org.openqa.selenium.WebElement element,
String text)
Adds a keyboard trigger.
|
protected void |
addUserInput(com.applitools.eyes.Trigger arg0) |
protected void |
checkRegion(BufferedImage arg0,
com.applitools.eyes.Region arg1,
String arg2,
boolean arg3) |
void |
checkRegion(org.openqa.selenium.By selector)
|
void |
checkRegion(org.openqa.selenium.By selector,
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(com.applitools.eyes.Region region)
|
void |
checkRegion(com.applitools.eyes.Region region,
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,
String tag)
Takes a snapshot of the application under test and matches a region of
a specific element with the expected region output.
|
void |
checkRegionInFrame(int frameIndex,
org.openqa.selenium.By selector)
|
void |
checkRegionInFrame(int frameIndex,
org.openqa.selenium.By selector,
String tag)
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)
|
void |
checkRegionInFrame(String frameNameOrId,
org.openqa.selenium.By selector,
String tag)
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)
|
void |
checkRegionInFrame(org.openqa.selenium.WebElement frameReference,
org.openqa.selenium.By selector,
String tag)
Switches into the given frame, takes a snapshot of the application under
test and matches a region specified by the given selector.
|
void |
checkWindow()
|
protected void |
checkWindow(BufferedImage arg0,
String arg1,
boolean arg2) |
void |
checkWindow(String tag)
Takes a snapshot of the application under test and matches it with
the expected output.
|
protected void |
clearUserInputs() |
com.applitools.eyes.TestResults |
close() |
com.applitools.eyes.TestResults |
close(boolean arg0) |
String |
getAgentId() |
static String |
getApiKey()
Gets the currently set API key or
null if no key is set. |
static URI |
getDefaultServerUrl() |
protected com.applitools.eyes.AppEnvironment |
getEnvironment()
This override also checks for mobile operating system.
|
com.applitools.eyes.FailureReports |
getFailureReports() |
protected String |
getInferredEnvironment() |
boolean |
getIsDisabled() |
boolean |
getIsOpen() |
protected com.applitools.eyes.EyesScreenshot |
getLastScreenshot() |
static com.applitools.eyes.ProxySettings |
getProxy()
Get the current proxy settings.
|
boolean |
getSaveFailedTests() |
boolean |
getSaveNewTests() |
protected String |
getTitle() |
protected com.applitools.eyes.Trigger[] |
getUserInputs() |
protected com.applitools.eyes.RectangleSize |
getViewportSize() |
protected void |
handleMatchResult(com.applitools.eyes.MatchResult matchResult,
String tag) |
void |
open(String arg0,
String arg1,
com.applitools.eyes.RectangleSize arg2,
com.applitools.eyes.MatchLevel arg3,
com.applitools.eyes.FailureReports arg4) |
org.openqa.selenium.WebDriver |
open(org.openqa.selenium.WebDriver driver,
String appName,
String testName)
Starts a test for any viewport size that reports failures upon test
completion.
|
org.openqa.selenium.WebDriver |
open(org.openqa.selenium.WebDriver driver,
String appName,
String testName,
com.applitools.eyes.RectangleSize viewportSize)
Starts a test that reports failures upon test completion.
|
org.openqa.selenium.WebDriver |
open(org.openqa.selenium.WebDriver driver,
String appName,
String testName,
com.applitools.eyes.RectangleSize viewportSize,
com.applitools.eyes.FailureReports failureReports)
Starts a test.
|
org.openqa.selenium.WebDriver |
open(org.openqa.selenium.WebDriver driver,
String appName,
String testName,
com.applitools.eyes.RectangleSize viewportSize,
com.applitools.eyes.MatchLevel matchLevel)
Starts a test that reports failures upon test completion.
|
org.openqa.selenium.WebDriver |
open(org.openqa.selenium.WebDriver driver,
String appName,
String testName,
com.applitools.eyes.RectangleSize viewportSize,
com.applitools.eyes.MatchLevel matchLevel,
com.applitools.eyes.FailureReports failureReports)
Starts a test.
|
protected void |
resetLastScreenshot() |
static void |
setApiKey(String apiKey)
Sets the API key of your applitools Eyes account.
|
void |
setAppEnvironment(String arg0,
String arg1) |
void |
setBatch(com.applitools.eyes.BatchInfo arg0) |
void |
setBranchName(String arg0) |
void |
setForceFullPageScreenshot(boolean shouldForce)
Tells Eyes whether to force a full page screenshot if the browser only
provides a screenshot of the viewport (full screenshot will be
composed by scrolling and stitching viewport screenshots).
|
static void |
setLogHandler(com.applitools.eyes.LogHandler logHandler)
Sets a handler of log messages generated by this API.
|
void |
setMatchTimeout(int seconds)
Sets the maximal time (in seconds)
checkWindow(java.lang.String) waits for a
match. |
protected void |
setMatchWindowTask(com.applitools.eyes.MatchWindowTask matchWindowTask)
Used for unit testing.
|
void |
setParentBranchName(String arg0) |
static void |
setProxy(com.applitools.eyes.ProxySettings proxySettings)
Sets a proxy.
|
void |
setSaveFailedTests(boolean arg0) |
void |
setSaveNewTests(boolean arg0) |
protected void |
setViewportSize(com.applitools.eyes.RectangleSize size) |
protected void |
startSession() |
protected static final com.applitools.eyes.MatchLevel DEFAULT_MATCH_LEVEL
public static final String DEFAULT_CHARSET_NAME
protected com.applitools.eyes.AgentConnector agentConnector
protected com.applitools.eyes.RunningSession runningSession
protected com.applitools.eyes.SessionStartInfo sessionStartInfo
protected com.applitools.eyes.RectangleSize viewportSize
protected com.applitools.eyes.EyesScreenshot lastScreenshot
public Eyes(URI serverUrl, boolean isDisabled)
serverUrl - The Eyes server URL.isDisabled - If true, all interactions with this API will be
silently ignored.public Eyes(URI serverUrl)
serverUrl - The Eyes server URL.public Eyes()
public static void setLogHandler(com.applitools.eyes.LogHandler logHandler)
logHandler - Handles log messages generated by this API.public static void setApiKey(String apiKey)
public static String getApiKey()
null if no key is set.public static void setProxy(com.applitools.eyes.ProxySettings proxySettings)
null to remove existing proxy settings.public static com.applitools.eyes.ProxySettings getProxy()
public String getAgentId()
public org.openqa.selenium.WebDriver open(org.openqa.selenium.WebDriver driver,
String appName,
String testName,
com.applitools.eyes.RectangleSize viewportSize,
com.applitools.eyes.MatchLevel matchLevel,
com.applitools.eyes.FailureReports failureReports)
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 allow any viewport size.matchLevel - The test-wide match level to use when comparing
actual application outputs with expected outputs
(overrides stricter step-specific match levels).failureReports - Specifies how detected failures are reported.public org.openqa.selenium.WebDriver open(org.openqa.selenium.WebDriver driver,
String appName,
String testName,
com.applitools.eyes.RectangleSize viewportSize,
com.applitools.eyes.MatchLevel matchLevel)
open(org.openqa.selenium.WebDriver, java.lang.String, java.lang.String, com.applitools.eyes.RectangleSize, com.applitools.eyes.MatchLevel, com.applitools.eyes.FailureReports).public org.openqa.selenium.WebDriver open(org.openqa.selenium.WebDriver driver,
String appName,
String testName,
com.applitools.eyes.RectangleSize viewportSize,
com.applitools.eyes.FailureReports failureReports)
public org.openqa.selenium.WebDriver open(org.openqa.selenium.WebDriver driver,
String appName,
String testName,
com.applitools.eyes.RectangleSize viewportSize)
open(org.openqa.selenium.WebDriver, java.lang.String, java.lang.String, com.applitools.eyes.RectangleSize, com.applitools.eyes.MatchLevel, com.applitools.eyes.FailureReports).public org.openqa.selenium.WebDriver open(org.openqa.selenium.WebDriver driver,
String appName,
String testName)
open(org.openqa.selenium.WebDriver, java.lang.String, java.lang.String, com.applitools.eyes.RectangleSize, com.applitools.eyes.MatchLevel, com.applitools.eyes.FailureReports)protected void handleMatchResult(com.applitools.eyes.MatchResult matchResult,
String tag)
public void checkWindow(String tag)
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 checkWindow()
checkWindow(String tag). Tag defaults to null.public void checkRegion(com.applitools.eyes.Region region,
String tag)
region - A non empty region representing the screen region to
check.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(com.applitools.eyes.Region region)
checkRegion(Region region, String tag). Tag defaults to null.
public void checkRegion(org.openqa.selenium.WebElement element,
String tag)
element - The element which represents the region to check.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)
checkRegion(WebElement element, String tag). Tag defaults to null.
public void checkRegion(org.openqa.selenium.By selector,
String tag)
selector - Selects the region to check.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.By selector)
checkRegion(By selector, String tag). Tag defaults to null.
public void checkRegionInFrame(int frameIndex,
org.openqa.selenium.By selector,
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()).selector - A Selector specifying the region to check.tag - An optional tag to be associated with the snapshot.public void checkRegionInFrame(int frameIndex,
org.openqa.selenium.By selector)
checkRegionInFrame(int frameIndex, By selector, String tag).
Tag defaults to nullpublic void checkRegionInFrame(String frameNameOrId, org.openqa.selenium.By selector, String tag)
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.tag - An optional tag to be associated with the snapshot.public void checkRegionInFrame(String frameNameOrId, org.openqa.selenium.By selector)
checkRegionInFrame(String frameNameOrId, By selector, String tag).
Tag defaults to nullpublic void checkRegionInFrame(org.openqa.selenium.WebElement frameReference,
org.openqa.selenium.By selector,
String tag)
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.tag - An optional tag to be associated with the snapshot.public void checkRegionInFrame(org.openqa.selenium.WebElement frameReference,
org.openqa.selenium.By selector)
checkRegionInFrame(WebElement frameReference,
By selector, String tag).
Tag defaults to nullprotected void setMatchWindowTask(com.applitools.eyes.MatchWindowTask matchWindowTask)
public void setMatchTimeout(int seconds)
checkWindow(java.lang.String) waits for a
match.seconds - Total number of seconds to wait for a match.public void setForceFullPageScreenshot(boolean shouldForce)
shouldForce - Weather to force full screenshot or not.protected String getTitle()
protected com.applitools.eyes.RectangleSize getViewportSize()
protected void addMouseTrigger(com.applitools.eyes.MouseAction action,
com.applitools.eyes.Region control,
com.applitools.eyes.Location cursor)
action - Mouse action.control - The control on which the trigger is activated
(location is relative to the window).cursor - The cursor's position relative to the control.protected void addMouseTrigger(com.applitools.eyes.MouseAction action,
org.openqa.selenium.WebElement element)
action - Mouse action.element - The WebElement on which the click was called.protected void addTextTrigger(com.applitools.eyes.Region control,
String text)
control - The control's position relative to the window.text - The trigger's text.protected void addTextTrigger(org.openqa.selenium.WebElement element,
String text)
element - The element for which we sent keys.text - The trigger's text.protected void setViewportSize(com.applitools.eyes.RectangleSize size)
protected String getInferredEnvironment()
protected void startSession()
protected com.applitools.eyes.AppEnvironment getEnvironment()
public boolean getIsDisabled()
public boolean getIsOpen()
public com.applitools.eyes.FailureReports getFailureReports()
public boolean getSaveNewTests()
public void setSaveNewTests(boolean arg0)
public boolean getSaveFailedTests()
public void setSaveFailedTests(boolean arg0)
public void open(String arg0, String arg1, com.applitools.eyes.RectangleSize arg2, com.applitools.eyes.MatchLevel arg3, com.applitools.eyes.FailureReports arg4)
public com.applitools.eyes.TestResults close()
public com.applitools.eyes.TestResults close(boolean arg0)
public void abortIfNotClosed()
public void setBranchName(String arg0)
public void setParentBranchName(String arg0)
public void setBatch(com.applitools.eyes.BatchInfo arg0)
public static URI getDefaultServerUrl()
protected com.applitools.eyes.EyesScreenshot getLastScreenshot()
protected void checkRegion(BufferedImage arg0, com.applitools.eyes.Region arg1, String arg2, boolean arg3)
protected void checkWindow(BufferedImage arg0, String arg1, boolean arg2)
protected void addUserInput(com.applitools.eyes.Trigger arg0)
protected void resetLastScreenshot()
protected void clearUserInputs()
protected com.applitools.eyes.Trigger[] getUserInputs()
Copyright © 2014. All rights reserved.