Package com.applitools.eyes.appium
Class Eyes
- java.lang.Object
-
- com.applitools.eyes.appium.Eyes
-
- All Implemented Interfaces:
com.applitools.eyes.IEyesBase
public class Eyes extends Object implements com.applitools.eyes.IEyesBase
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description com.applitools.eyes.TestResultsabort()voidabortAsync()com.applitools.eyes.TestResultsabortIfNotClosed()If a test is running, aborts it.voidaddProperty(String name, String value)Adds a property to be sent to the server.voidcheck(com.applitools.ICheckSettings checkSettings)voidcheck(com.applitools.ICheckSettings... checkSettings)voidcheck(String name, com.applitools.ICheckSettings checkSettings)voidcheckElement(org.openqa.selenium.By selector)voidcheckElement(org.openqa.selenium.By selector, int matchTimeout, String tag)voidcheckElement(org.openqa.selenium.By selector, String tag)voidcheckElement(org.openqa.selenium.WebElement element)voidcheckElement(org.openqa.selenium.WebElement element, int matchTimeout, String tag)voidcheckElement(org.openqa.selenium.WebElement element, String tag)voidcheckRegion(com.applitools.eyes.Region region)voidcheckRegion(com.applitools.eyes.Region region, int matchTimeout, String tag)voidcheckRegion(org.openqa.selenium.By selector)voidcheckRegion(org.openqa.selenium.By selector, boolean stitchContent)voidcheckRegion(org.openqa.selenium.By selector, int matchTimeout, String tag)voidcheckRegion(org.openqa.selenium.By selector, int matchTimeout, String tag, boolean stitchContent)voidcheckRegion(org.openqa.selenium.By selector, String tag)voidcheckRegion(org.openqa.selenium.By selector, String tag, boolean stitchContent)voidcheckRegion(org.openqa.selenium.WebElement element)voidcheckRegion(org.openqa.selenium.WebElement element, int matchTimeout, String tag)voidcheckRegion(org.openqa.selenium.WebElement element, int matchTimeout, String tag, boolean stitchContent)voidcheckRegion(org.openqa.selenium.WebElement element, String tag, boolean stitchContent)voidcheckWindow()voidcheckWindow(int matchTimeout, String tag)voidcheckWindow(String tag)voidcheckWindow(String tag, boolean fully)voidclearProperties()Clears the list of custom properties.com.applitools.eyes.TestResultsclose()Seeclose(boolean).com.applitools.eyes.TestResultsclose(boolean shouldThrowException)Close test results.voidcloseAsync()com.applitools.eyes.config.Configurationconfigure()List<String>extractText(com.applitools.eyes.locators.BaseOcrRegion... ocrRegions)Map<String,List<com.applitools.eyes.locators.TextRegion>>extractTextRegions(com.applitools.eyes.locators.TextRegionSettings textRegionSettings)StringgetAgentId()StringgetApiKey()Gets api key.StringgetBaseAgentId()StringgetBaselineBranchName()StringgetBaselineEnvName()com.applitools.eyes.BatchInfogetBatch()StringgetBranchName()com.applitools.eyes.selenium.ConfigurationgetConfiguration()protected com.applitools.eyes.config.ConfigurationgetConfigurationInstance()Deprecated.com.applitools.eyes.ImageMatchSettingsgetDefaultMatchSettings()doublegetDevicePixelRatio()org.openqa.selenium.WebDrivergetDriver()StringgetEnvName()BooleangetForceFullPageScreenshot()StringgetFullAgentId()Gets full agent id.StringgetHostApp()StringgetHostOS()BooleangetIgnoreCaret()BooleangetIgnoreDisplacements()BooleangetIsDisabled()Gets is disabled.booleangetIsOpen()Gets is open.com.applitools.eyes.LoggergetLogger()Gets logger.com.applitools.eyes.LogHandlergetLogHandler()Gets log handler.com.applitools.eyes.MatchLevelgetMatchLevel()IntegergetMatchTimeout()StringgetParentBranchName()com.applitools.eyes.positioning.PositionProvidergetPositionProvider()Gets position provider.com.applitools.eyes.AbstractProxySettingsgetProxy()Gets proxy.List<com.applitools.eyes.TestResults>getResults()List<com.applitools.eyes.TestResults>getResults(boolean shouldThrowException)com.applitools.eyes.selenium.positioning.ImageRotationgetRotation()BooleangetSaveDebugScreenshots()Gets save debug screenshots.BooleangetSaveDiffs()BooleangetSaveNewTests()Gets save new tests.DoublegetScaleRatio()Gets scale ratio.booleangetScrollToRegion()Deprecated.URIgetServerUrl()IntegergetStitchOverlap()Gets stitch overlap.Map<String,List<com.applitools.eyes.Region>>locate(com.applitools.eyes.locators.VisualLocatorSettings visualLocatorSettings)org.openqa.selenium.WebDriveropen(org.openqa.selenium.WebDriver driver, com.applitools.eyes.config.Configuration configuration)org.openqa.selenium.WebDriveropen(org.openqa.selenium.WebDriver driver, String appName, String testName)org.openqa.selenium.WebDriveropen(org.openqa.selenium.WebDriver driver, String appName, String testName, com.applitools.eyes.RectangleSize viewportSize)protected org.openqa.selenium.WebDriveropen(org.openqa.selenium.WebDriver driver, String appName, String testName, com.applitools.eyes.RectangleSize viewportSize, com.applitools.eyes.SessionType sessionType)Starts a test.voidsetAgentId(String agentId)voidsetApiKey(String apiKey)Sets api key.voidsetBaselineBranchName(String branchName)voidsetBaselineEnvName(String baselineEnvName)com.applitools.eyes.config.ConfigurationsetBatch(com.applitools.eyes.BatchInfo batch)voidsetBranchName(String branchName)voidsetConfiguration(com.applitools.eyes.config.Configuration configuration)voidsetDefaultMatchSettings(com.applitools.eyes.ImageMatchSettings defaultMatchSettings)voidsetEnvName(String envName)voidsetForceFullPageScreenshot(boolean shouldForce)voidsetHostApp(String hostApp)voidsetHostOS(String hostOS)voidsetIgnoreCaret(boolean value)voidsetIgnoreDisplacements(boolean isIgnoreDisplacements)voidsetIsDisabled(Boolean isDisabled)Sets is disabled.voidsetLogHandler(com.applitools.eyes.LogHandler logHandler)Sets a handler of log messages generated by this API.voidsetMatchLevel(com.applitools.eyes.MatchLevel matchLevel)voidsetMatchTimeout(int ms)Sets the maximum time (in ms) a match operation tries to perform a match.static voidsetMobileCapabilities(org.openqa.selenium.remote.DesiredCapabilities caps)static voidsetMobileCapabilities(org.openqa.selenium.remote.DesiredCapabilities caps, String apiKey)static voidsetMobileCapabilities(org.openqa.selenium.remote.DesiredCapabilities caps, String apiKey, String eyesServerUrl)static voidsetMobileCapabilities(org.openqa.selenium.remote.DesiredCapabilities caps, String apiKey, String eyesServerUrl, com.applitools.eyes.ProxySettings proxySettings)static voidsetNMGCapabilities(org.openqa.selenium.remote.DesiredCapabilities caps)static voidsetNMGCapabilities(org.openqa.selenium.remote.DesiredCapabilities caps, String apiKey)static voidsetNMGCapabilities(org.openqa.selenium.remote.DesiredCapabilities caps, String apiKey, String eyesServerUrl)static voidsetNMGCapabilities(org.openqa.selenium.remote.DesiredCapabilities caps, String apiKey, String eyesServerUrl, com.applitools.eyes.ProxySettings proxySettings)voidsetParentBranchName(String branchName)voidsetPositionProvider(com.applitools.eyes.positioning.PositionProvider positionProvider)Sets position provider.voidsetProxy(com.applitools.eyes.AbstractProxySettings proxySettings)Sets the proxy settings to be used by the server.voidsetRotation(com.applitools.eyes.selenium.positioning.ImageRotation rotation)voidsetSaveDebugScreenshots(Boolean saveDebugScreenshots)Sets save debug screenshots.voidsetSaveDiffs(Boolean saveDiffs)voidsetSaveNewTests(boolean saveNewTests)Set whether or not new tests are saved by default.voidsetScaleRatio(Double scaleRatio)Manually set the scale ratio for the images being validated.voidsetScrollToRegion(boolean shouldScroll)Deprecated.voidsetServerUrl(String serverUrl)Sets server url.voidsetServerUrl(URI serverUri)Sets server url.voidsetStitchOverlap(int pixels)Sets the stitching overlap in pixels.booleanshouldStitchContent()
-
-
-
Method Detail
-
setNMGCapabilities
public static void setNMGCapabilities(org.openqa.selenium.remote.DesiredCapabilities caps)
-
setNMGCapabilities
public static void setNMGCapabilities(org.openqa.selenium.remote.DesiredCapabilities caps, String apiKey)
-
setNMGCapabilities
public static void setNMGCapabilities(org.openqa.selenium.remote.DesiredCapabilities caps, String apiKey, String eyesServerUrl)
-
setNMGCapabilities
public static void setNMGCapabilities(org.openqa.selenium.remote.DesiredCapabilities caps, String apiKey, String eyesServerUrl, com.applitools.eyes.ProxySettings proxySettings)
-
setMobileCapabilities
public static void setMobileCapabilities(org.openqa.selenium.remote.DesiredCapabilities caps)
-
setMobileCapabilities
public static void setMobileCapabilities(org.openqa.selenium.remote.DesiredCapabilities caps, String apiKey)
-
setMobileCapabilities
public static void setMobileCapabilities(org.openqa.selenium.remote.DesiredCapabilities caps, String apiKey, String eyesServerUrl)
-
setMobileCapabilities
public static void setMobileCapabilities(org.openqa.selenium.remote.DesiredCapabilities caps, String apiKey, String eyesServerUrl, com.applitools.eyes.ProxySettings proxySettings)
-
getConfiguration
public com.applitools.eyes.selenium.Configuration getConfiguration()
-
setConfiguration
public void setConfiguration(com.applitools.eyes.config.Configuration configuration)
-
configure
public com.applitools.eyes.config.Configuration configure()
-
getApiKey
public String getApiKey()
Gets api key.- Specified by:
getApiKeyin interfacecom.applitools.eyes.IEyesBase- Returns:
- the api key
-
setApiKey
public void setApiKey(String apiKey)
Sets api key.- Parameters:
apiKey- the api key
-
getServerUrl
public URI getServerUrl()
- Specified by:
getServerUrlin interfacecom.applitools.eyes.IEyesBase
-
setServerUrl
public void setServerUrl(String serverUrl)
Sets server url.- Parameters:
serverUrl- the server url
-
setServerUrl
public void setServerUrl(URI serverUri)
Sets server url.- Parameters:
serverUri- the server URI
-
setProxy
public void setProxy(com.applitools.eyes.AbstractProxySettings proxySettings)
Sets the proxy settings to be used by the server.- Parameters:
proxySettings- The proxy settings to be used by the server. Ifnullthen no proxy is set.
-
getProxy
public com.applitools.eyes.AbstractProxySettings getProxy()
Gets proxy.- Returns:
- The current proxy settings used by the server, or
nullif no proxy is set.
-
setIsDisabled
public void setIsDisabled(Boolean isDisabled)
Sets is disabled.- Specified by:
setIsDisabledin interfacecom.applitools.eyes.IEyesBase- Parameters:
isDisabled- If true, all interactions with this API will be silently ignored.
-
getIsDisabled
public Boolean getIsDisabled()
Gets is disabled.- Specified by:
getIsDisabledin interfacecom.applitools.eyes.IEyesBase- Returns:
- Whether eyes is disabled.
-
getRotation
public com.applitools.eyes.selenium.positioning.ImageRotation getRotation()
- Returns:
- The image rotation data.
-
setRotation
public void setRotation(com.applitools.eyes.selenium.positioning.ImageRotation rotation)
- Parameters:
rotation- The image rotation data.
-
setForceFullPageScreenshot
public void setForceFullPageScreenshot(boolean shouldForce)
-
getForceFullPageScreenshot
public Boolean getForceFullPageScreenshot()
-
setMatchTimeout
public void setMatchTimeout(int ms)
Sets the maximum time (in ms) a match operation tries to perform a match.- Parameters:
ms- Total number of ms to wait for a match.
-
getMatchTimeout
public Integer getMatchTimeout()
- Returns:
- The maximum time in ms (RegionProvider, String, boolean, int)} waits for a match.
-
setSaveNewTests
public void setSaveNewTests(boolean saveNewTests)
Set whether or not new tests are saved by default.- Parameters:
saveNewTests- True if new tests should be saved by default. False otherwise.
-
getSaveNewTests
public Boolean getSaveNewTests()
Gets save new tests.- Returns:
- True if new tests are saved by default.
-
setSaveDiffs
public void setSaveDiffs(Boolean saveDiffs)
-
getSaveDiffs
public Boolean getSaveDiffs()
-
setDefaultMatchSettings
public void setDefaultMatchSettings(com.applitools.eyes.ImageMatchSettings defaultMatchSettings)
-
getDefaultMatchSettings
public com.applitools.eyes.ImageMatchSettings getDefaultMatchSettings()
-
getStitchOverlap
public Integer getStitchOverlap()
Gets stitch overlap.- Returns:
- Returns the stitching overlap in pixels.
-
setStitchOverlap
public void setStitchOverlap(int pixels)
Sets the stitching overlap in pixels.- Parameters:
pixels- The width (in pixels) of the overlap.
-
setBranchName
public void setBranchName(String branchName)
-
getBranchName
public String getBranchName()
-
setParentBranchName
public void setParentBranchName(String branchName)
-
getParentBranchName
public String getParentBranchName()
-
setBatch
public com.applitools.eyes.config.Configuration setBatch(com.applitools.eyes.BatchInfo batch)
-
getBatch
public com.applitools.eyes.BatchInfo getBatch()
-
setAgentId
public void setAgentId(String agentId)
-
getAgentId
public String getAgentId()
-
getFullAgentId
public String getFullAgentId()
Gets full agent id.- Specified by:
getFullAgentIdin interfacecom.applitools.eyes.IEyesBase- Returns:
- The full agent id composed of both the base agent id and the user given agent id.
-
setHostOS
public void setHostOS(String hostOS)
-
getHostOS
public String getHostOS()
-
setHostApp
public void setHostApp(String hostApp)
-
getHostApp
public String getHostApp()
-
getIgnoreCaret
public Boolean getIgnoreCaret()
-
setIgnoreCaret
public void setIgnoreCaret(boolean value)
-
setMatchLevel
public void setMatchLevel(com.applitools.eyes.MatchLevel matchLevel)
-
getMatchLevel
public com.applitools.eyes.MatchLevel getMatchLevel()
-
setEnvName
public void setEnvName(String envName)
-
getEnvName
public String getEnvName()
-
setBaselineEnvName
public void setBaselineEnvName(String baselineEnvName)
-
getBaselineEnvName
public String getBaselineEnvName()
-
setBaselineBranchName
public void setBaselineBranchName(String branchName)
-
getBaselineBranchName
public String getBaselineBranchName()
-
setIgnoreDisplacements
public void setIgnoreDisplacements(boolean isIgnoreDisplacements)
-
getIgnoreDisplacements
public Boolean getIgnoreDisplacements()
-
open
public org.openqa.selenium.WebDriver open(org.openqa.selenium.WebDriver driver, com.applitools.eyes.config.Configuration configuration)
-
open
public org.openqa.selenium.WebDriver open(org.openqa.selenium.WebDriver driver, String appName, String testName, com.applitools.eyes.RectangleSize viewportSize)Seeopen(WebDriver, String, String, RectangleSize, SessionType).sessionTypedefaults tonull. * @param driver The web driver that controls the browser hosting the application under test.- Parameters:
appName- The name of the application under test.testName- The test name. (i.e., the visible part of the document's body) ornullto use the current window's viewport.- Returns:
- A wrapped WebDriver which enables SeleniumEyes trigger recording and frame handling.
-
open
public org.openqa.selenium.WebDriver open(org.openqa.selenium.WebDriver driver, String appName, String testName)
-
open
protected org.openqa.selenium.WebDriver open(org.openqa.selenium.WebDriver driver, String appName, String testName, com.applitools.eyes.RectangleSize viewportSize, com.applitools.eyes.SessionType sessionType)Starts a test.- Parameters:
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) ornullto use the current window's viewport.sessionType- Should always beSEQUENTIAL- Returns:
- A wrapped WebDriver which enables Eyes trigger recording and frame handling.
-
getIsOpen
public boolean getIsOpen()
Gets is open.- Specified by:
getIsOpenin interfacecom.applitools.eyes.IEyesBase- Returns:
- Whether a session is open.
-
checkWindow
public void checkWindow()
-
checkWindow
public void checkWindow(String tag)
-
checkWindow
public void checkWindow(int matchTimeout, String tag)
-
checkWindow
public void checkWindow(String tag, boolean fully)
-
check
public void check(String name, com.applitools.ICheckSettings checkSettings)
-
setScrollToRegion
@Deprecated public void setScrollToRegion(boolean shouldScroll)
Deprecated.
-
getScrollToRegion
@Deprecated public boolean getScrollToRegion()
Deprecated.Gets scroll to region.- Returns:
- Whether to automatically scroll to a region being validated.
-
shouldStitchContent
public boolean shouldStitchContent()
-
getPositionProvider
public com.applitools.eyes.positioning.PositionProvider getPositionProvider()
Gets position provider.- Returns:
- The currently set position provider.
-
setPositionProvider
public void setPositionProvider(com.applitools.eyes.positioning.PositionProvider positionProvider)
Sets position provider.- Parameters:
positionProvider- The position provider to be used.
-
setLogHandler
public void setLogHandler(com.applitools.eyes.LogHandler logHandler)
Sets a handler of log messages generated by this API.- Specified by:
setLogHandlerin interfacecom.applitools.eyes.IEyesBase- Parameters:
logHandler- Handles log messages generated by this API.
-
getLogHandler
public com.applitools.eyes.LogHandler getLogHandler()
Gets log handler.- Specified by:
getLogHandlerin interfacecom.applitools.eyes.IEyesBase- Returns:
- The currently set log handler.
-
getLogger
public com.applitools.eyes.Logger getLogger()
Gets logger.- Specified by:
getLoggerin interfacecom.applitools.eyes.IEyesBase- Returns:
- the logger
-
addProperty
public void addProperty(String name, String value)
Adds a property to be sent to the server.- Specified by:
addPropertyin interfacecom.applitools.eyes.IEyesBase- Parameters:
name- The property name.value- The property value.
-
clearProperties
public void clearProperties()
Clears the list of custom properties.- Specified by:
clearPropertiesin interfacecom.applitools.eyes.IEyesBase
-
setSaveDebugScreenshots
public void setSaveDebugScreenshots(Boolean saveDebugScreenshots)
Sets save debug screenshots.- Parameters:
saveDebugScreenshots- If true, will save all screenshots to local directory.
-
getSaveDebugScreenshots
public Boolean getSaveDebugScreenshots()
Gets save debug screenshots.- Returns:
- True if screenshots saving enabled.
-
getBaseAgentId
public String getBaseAgentId()
-
getDriver
public org.openqa.selenium.WebDriver getDriver()
-
getDevicePixelRatio
public double getDevicePixelRatio()
-
check
public void check(com.applitools.ICheckSettings... checkSettings)
-
check
public void check(com.applitools.ICheckSettings checkSettings)
-
checkElement
public void checkElement(org.openqa.selenium.WebElement element)
-
checkElement
public void checkElement(org.openqa.selenium.WebElement element, String tag)
-
checkElement
public void checkElement(org.openqa.selenium.WebElement element, int matchTimeout, String tag)
-
checkElement
public void checkElement(org.openqa.selenium.By selector)
-
checkElement
public void checkElement(org.openqa.selenium.By selector, String tag)
-
checkElement
public void checkElement(org.openqa.selenium.By selector, int matchTimeout, String tag)
-
checkRegion
public void checkRegion(com.applitools.eyes.Region region)
-
checkRegion
public void checkRegion(com.applitools.eyes.Region region, int matchTimeout, String tag) throws com.applitools.eyes.exceptions.TestFailedException- Throws:
com.applitools.eyes.exceptions.TestFailedException
-
checkRegion
public void checkRegion(org.openqa.selenium.WebElement element)
-
checkRegion
public void checkRegion(org.openqa.selenium.WebElement element, String tag, boolean stitchContent)
-
checkRegion
public void checkRegion(org.openqa.selenium.WebElement element, int matchTimeout, String tag)
-
checkRegion
public void checkRegion(org.openqa.selenium.WebElement element, int matchTimeout, String tag, boolean stitchContent)
-
checkRegion
public void checkRegion(org.openqa.selenium.By selector)
-
checkRegion
public void checkRegion(org.openqa.selenium.By selector, boolean stitchContent)
-
checkRegion
public void checkRegion(org.openqa.selenium.By selector, String tag)
-
checkRegion
public void checkRegion(org.openqa.selenium.By selector, String tag, boolean stitchContent)
-
checkRegion
public void checkRegion(org.openqa.selenium.By selector, int matchTimeout, String tag)
-
checkRegion
public void checkRegion(org.openqa.selenium.By selector, int matchTimeout, String tag, boolean stitchContent)
-
locate
public Map<String,List<com.applitools.eyes.Region>> locate(com.applitools.eyes.locators.VisualLocatorSettings visualLocatorSettings)
-
extractTextRegions
public Map<String,List<com.applitools.eyes.locators.TextRegion>> extractTextRegions(com.applitools.eyes.locators.TextRegionSettings textRegionSettings)
-
extractText
public List<String> extractText(com.applitools.eyes.locators.BaseOcrRegion... ocrRegions)
-
close
public com.applitools.eyes.TestResults close()
- Returns:
- The test results.
-
close
public com.applitools.eyes.TestResults close(boolean shouldThrowException)
Close test results.- Parameters:
shouldThrowException- the should throw exception- Returns:
- the test results
-
closeAsync
public void closeAsync()
- Specified by:
closeAsyncin interfacecom.applitools.eyes.IEyesBase
-
abortIfNotClosed
public com.applitools.eyes.TestResults abortIfNotClosed()
If a test is running, aborts it. Otherwise, does nothing.- Specified by:
abortIfNotClosedin interfacecom.applitools.eyes.IEyesBase
-
abort
public com.applitools.eyes.TestResults abort()
- Specified by:
abortin interfacecom.applitools.eyes.IEyesBase
-
getResults
public List<com.applitools.eyes.TestResults> getResults()
- Specified by:
getResultsin interfacecom.applitools.eyes.IEyesBase
-
getResults
public List<com.applitools.eyes.TestResults> getResults(boolean shouldThrowException)
- Specified by:
getResultsin interfacecom.applitools.eyes.IEyesBase
-
abortAsync
public void abortAsync()
- Specified by:
abortAsyncin interfacecom.applitools.eyes.IEyesBase
-
getConfigurationInstance
@Deprecated protected com.applitools.eyes.config.Configuration getConfigurationInstance()
Deprecated.
-
setScaleRatio
public void setScaleRatio(Double scaleRatio)
Manually set the scale ratio for the images being validated.- Parameters:
scaleRatio- The scale ratio to use, ornullto reset back to automatic scaling.
-
getScaleRatio
public Double getScaleRatio()
Gets scale ratio.- Returns:
- The ratio used to scale the images being validated.
-
-