public class Eyes extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_CHARSET_NAME |
| 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()
If a test is running, aborts it.
|
protected void |
addMouseTrigger(com.applitools.eyes.MouseAction action,
com.applitools.eyes.Region control,
Location cursor)
Adds a mouse trigger.
|
protected void |
addTextTrigger(com.applitools.eyes.Region control,
String text)
Adds a keyboard trigger.
|
protected void |
addUserInput(com.applitools.eyes.Trigger trigger)
Adds a trigger to the current list of user inputs.
|
void |
checkRegion(org.openqa.selenium.By selector,
String tag)
Takes a snapshot of the specified region of the application under test
and matches it with the expected region output.
|
void |
checkWindow()
Takes a snapshot of the application under test and matches it with
the expected output.
|
protected void |
checkWindow(com.applitools.eyes.Region region,
String tag)
Takes a snapshot of the application under test and matches it with
the expected output.
|
void |
checkWindow(String tag)
Takes a snapshot of the application under test and matches it with
the expected output.
|
protected void |
clearUserInputs()
Clears the user inputs list.
|
TestResults |
close()
Ends the test.
|
static String |
getApiKey()
Gets the currently set API key or
null if no key is set. |
boolean |
getIsDisabled() |
boolean |
getSaveFailedTests() |
boolean |
getSaveNewTests() |
protected com.applitools.eyes.Trigger[] |
getUserInputs()
Returns all user inputs.
|
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,
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,
RectangleSize viewportSize,
FailureReports failureReports)
Starts a test.
|
org.openqa.selenium.WebDriver |
open(org.openqa.selenium.WebDriver driver,
String appName,
String testName,
RectangleSize viewportSize,
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,
RectangleSize viewportSize,
MatchLevel matchLevel,
FailureReports failureReports)
Starts a test.
|
static void |
setApiKey(String apiKey)
Sets the API key of your applitools Eyes account.
|
void |
setAppEnvironment(String hostOS,
String hostApp)
Sets the OS (e.g., Windows) and application (e.g., Chrome) that host the
application under test.
|
void |
setBatch(BatchInfo batch)
Sets the batch in which context future tests will run or
null
if tests are to run standalone. |
void |
setBranchName(String branchName)
Sets the branch in which the baseline for subsequent test runs resides.
|
static void |
setLogHandler(LogHandler logHandler)
Sets a handler of log messages generated by this API.
|
void |
setMatchTimeout(int seconds)
Sets the maximal time (in seconds)
checkWindow(com.applitools.eyes.Region, java.lang.String) waits for a
match. |
protected void |
setMatchWindowTask(com.applitools.eyes.MatchWindowTask matchWindowTask) |
void |
setParentBranchName(String branchName)
Sets the branch under which new branches are created.
|
void |
setSaveFailedTests(boolean saveFailedTests)
Set whether or not failed tests are saved by default.
|
void |
setSaveNewTests(boolean saveNewTests)
Set whether or not new tests are saved by default.
|
public static final String DEFAULT_CHARSET_NAME
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(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 boolean getIsDisabled()
public boolean getSaveNewTests()
public void setSaveNewTests(boolean saveNewTests)
saveNewTests - True if new tests should be saved by default.
False otherwise.public boolean getSaveFailedTests()
public void setSaveFailedTests(boolean saveFailedTests)
saveFailedTests - True if failed tests should be saved by
default, false otherwise.public org.openqa.selenium.WebDriver open(org.openqa.selenium.WebDriver driver,
String appName,
String testName,
RectangleSize viewportSize,
MatchLevel matchLevel,
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,
RectangleSize viewportSize,
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,
RectangleSize viewportSize,
FailureReports failureReports)
public org.openqa.selenium.WebDriver open(org.openqa.selenium.WebDriver driver,
String appName,
String testName,
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 setMatchWindowTask(com.applitools.eyes.MatchWindowTask matchWindowTask)
protected void checkWindow(com.applitools.eyes.Region region,
String tag)
region - The screen region to check or the empty rectangle to check
the entire window.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(String tag)
tag - A tag to be associated with the snapshot.TestFailedException - Thrown if a mismatch is detected and
immediate failure reports are enabled.public void checkWindow()
TestFailedException - Thrown if a mismatch is detected and
immediate failure reports are enabled.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 TestResults close()
TestFailedException - Thrown if mismatches were found.public void abortIfNotClosed()
public void setBranchName(String branchName)
setParentBranchName(java.lang.String)).
Changes to the baseline or model of a branch do not propagate to other
branches.branchName - Branch name or null to specify the default
branch.public void setParentBranchName(String branchName)
branchName - Branch name or null to specify the default
branch.public void setMatchTimeout(int seconds)
checkWindow(com.applitools.eyes.Region, java.lang.String) waits for a
match.seconds - Total number of seconds to wait for a match.public void setAppEnvironment(String hostOS, String hostApp)
hostOS - The name of the OS hosting the application under test or
null to auto-detect.hostApp - The name of the application hosting the application under
test or null to auto-detect.public void setBatch(BatchInfo batch)
null
if tests are to run standalone.protected void addUserInput(com.applitools.eyes.Trigger trigger)
protected void clearUserInputs()
protected com.applitools.eyes.Trigger[] getUserInputs()
protected void addMouseTrigger(com.applitools.eyes.MouseAction action,
com.applitools.eyes.Region control,
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 addTextTrigger(com.applitools.eyes.Region control,
String text)
control - The control's position relative to the window.text - The trigger's text.Copyright © 2013. All rights reserved.