Package com.applitools.eyes.playwright
Class Eyes
java.lang.Object
com.applitools.eyes.playwright.Eyes
- All Implemented Interfaces:
com.applitools.eyes.IEyesBase
-
Field Summary
Fields inherited from interface com.applitools.eyes.IEyesBase
APPLITOOLS_PUBLIC_CLOUD_URL -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.applitools.eyes.TestResultsabort()voidcom.applitools.eyes.TestResultsvoidaddProperty(String name, String value) voidcheck(com.applitools.ICheckSettings checkSettings) Check.voidcheck(com.applitools.ICheckSettings... checkSettings) Takes multiple screenshots at once (given allICheckSettingsobjects are on the same level).voidCheck.voidcom.applitools.eyes.TestResultsclose()Seeclose(boolean).com.applitools.eyes.TestResultsclose(boolean shouldThrowException) Close test results.voidcom.applitools.eyes.config.ConfigurationextractText(com.applitools.eyes.locators.BaseOcrRegion... ocrRegions) Extract text.extractTextRegions(com.applitools.eyes.locators.TextRegionSettings textRegionSettings) Locate text.com.applitools.eyes.AccessibilitySettingsIf notnull, determines the name of the environment of the baseline.Deprecated.Only available for backward compatibility.com.applitools.eyes.BatchInfogetBatch()com.applitools.eyes.config.ConfigurationGets debug screenshots path.Gets debug screenshots prefix.com.applitools.eyes.ImageMatchSettingsbooleanIf notnullspecifies a name for the environment in which the application under test is running.booleanbooleanbooleanGets is open.com.applitools.eyes.Loggercom.applitools.eyes.LogHandlercom.applitools.eyes.MatchLevelDeprecated.Please usegetDefaultMatchSettings()instead.intcom.applitools.eyes.AbstractProxySettingsgetProxy()List<com.applitools.eyes.TestResults> List<com.applitools.eyes.TestResults> getResults(boolean shouldThrowException) Returns whether to automatically save differences as a baseline.booleanbooleanintReturns the stitching overlap in pixels.booleanlocate(com.applitools.eyes.locators.VisualLocatorSettings visualLocatorSettings) Locate.com.microsoft.playwright.Pageopen(com.microsoft.playwright.Page page) Starts a test.com.microsoft.playwright.PageStarts a test.com.microsoft.playwright.Pageopen(com.microsoft.playwright.Page page, String appName, String testName, com.applitools.eyes.RectangleSize viewportSize) Starts a test.com.applitools.eyes.config.ConfigurationsetAccessibilityValidation(com.applitools.eyes.AccessibilitySettings accessibilityValidation) com.applitools.eyes.config.ConfigurationsetAgentId(String agentId) voidvoidsetAppEnvironment(String hostOS, String hostApp) Deprecated.com.applitools.eyes.config.ConfigurationsetAppName(String appName) com.applitools.eyes.config.ConfigurationsetBaselineBranchName(String branchName) Sets the branch under which new branches are created.com.applitools.eyes.config.ConfigurationsetBaselineEnvName(String baselineEnvName) If notnull, determines the name of the environment of the baseline.voidsetBaselineName(String baselineName) Deprecated.Only available for backward compatibility.com.applitools.eyes.config.ConfigurationsetBatch(com.applitools.eyes.BatchInfo batch) Sets the batch in which context future tests will run ornullif tests are to run standalone.com.applitools.eyes.config.ConfigurationsetBranchName(String branchName) Sets the branch in which the baseline for subsequent test runs resides.voidsetConfiguration(com.applitools.eyes.config.Configuration configuration) voidsetDebugScreenshotsPath(String pathToSave) Sets debug screenshots path.voidsetDebugScreenshotsPrefix(String prefix) Sets debug screenshots prefix.com.applitools.eyes.config.ConfigurationsetDefaultMatchSettings(com.applitools.eyes.ImageMatchSettings defaultMatchSettings) Updates the match settings to be used for the session.com.applitools.eyes.config.ConfigurationsetEnablePatterns(boolean enablePatterns) com.applitools.eyes.config.ConfigurationsetEnvironmentName(String environmentName) voidsetEnvName(String envName) If notnullspecifies a name for the environment in which the application under test is running.voidsetHideCaret(Boolean hideCaret) voidsetHideScrollbars(Boolean hideScrollbars) com.applitools.eyes.config.ConfigurationsetHostApp(String hostApp) com.applitools.eyes.config.Configurationcom.applitools.eyes.config.ConfigurationsetIgnoreCaret(boolean value) Sets the ignore blinking caret value.com.applitools.eyes.config.ConfigurationsetIgnoreDisplacements(boolean isIgnoreDisplacements) voidsetImageCut(com.applitools.eyes.UnscaledFixedCutProvider unscaledFixedCutProvider) voidsetIsDisabled(Boolean isDisabled) voidsetLogHandler(com.applitools.eyes.LogHandler logHandler) com.applitools.eyes.config.ConfigurationsetMatchLevel(com.applitools.eyes.MatchLevel matchLevel) This function is deprecated.com.applitools.eyes.config.ConfigurationsetMatchTimeout(int ms) Sets the maximum time (in ms) a match operation tries to perform a match.com.applitools.eyes.config.ConfigurationsetParentBranchName(String branchName) Sets the branch under which new branches are created.voidsetProxy(com.applitools.eyes.AbstractProxySettings proxySettings) com.applitools.eyes.config.ConfigurationsetSaveDiffs(Boolean saveDiffs) Automatically save differences as a baseline.com.applitools.eyes.config.ConfigurationsetSaveFailedTests(boolean saveFailedTests) Set whether or not failed tests are saved by default.com.applitools.eyes.config.ConfigurationsetSaveNewTests(boolean saveNewTests) Set whether or not new tests are saved by default.voidsetServerUrl(String serverUrl) voidsetStitchMode(com.applitools.eyes.selenium.StitchMode stitchMode) com.applitools.eyes.config.ConfigurationsetStitchOverlap(int pixels) Sets the stitching overlap in pixels.com.applitools.eyes.config.ConfigurationsetTestName(String testName) com.applitools.eyes.config.ConfigurationsetUseDom(boolean useDom)
-
Constructor Details
-
Eyes
public Eyes()Instantiates a new Eyes. -
Eyes
public Eyes(com.applitools.eyes.EyesRunner runner0) Instantiates a new Eyes.- Parameters:
runner0- the runner
-
-
Method Details
-
open
public com.microsoft.playwright.Page open(com.microsoft.playwright.Page page) Starts a test.- Parameters:
page- The web driver that controls the browser hosting the application under test.- Returns:
- the page
-
open
public com.microsoft.playwright.Page open(com.microsoft.playwright.Page page, String appName, String testName) Starts a test.- Parameters:
page- The web driver that controls the browser hosting the application under test.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:
- the page
-
open
public com.microsoft.playwright.Page open(com.microsoft.playwright.Page page, String appName, String testName, com.applitools.eyes.RectangleSize viewportSize) Starts a test.- Parameters:
page- 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.- Returns:
- the page
-
check
public void check(com.applitools.ICheckSettings... checkSettings) Takes multiple screenshots at once (given allICheckSettingsobjects are on the same level).- Parameters:
checkSettings- MultipleICheckSettingsobject representing different regions in the viewport.
-
check
Check.- Parameters:
tag- the tagcheckSettings- the check settings
-
check
public void check(com.applitools.ICheckSettings checkSettings) Check.- Parameters:
checkSettings- the check settings
-
extractText
-
extractTextRegions
public Map<String,List<com.applitools.eyes.locators.TextRegion>> extractTextRegions(com.applitools.eyes.locators.TextRegionSettings textRegionSettings) Locate text. Formerly known as extractTextRegions.- Parameters:
textRegionSettings- the image from which the location of the text will be extracted.- Returns:
- mapping of the located text regions
-
locate
-
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
-
configure
public com.applitools.eyes.config.Configuration configure() -
setAppName
- Parameters:
appName- The name of the application under test.
-
setTestName
-
getAppName
- Returns:
- The name of the application under test.
-
getTestName
-
setBranchName
Sets the branch in which the baseline for subsequent test runs resides. If the branch does not already exist it will be created under the specified parent branch (seesetParentBranchName(java.lang.String)). Changes to the baseline or model of a branch do not propagate to other branches.- Parameters:
branchName- Branch name ornullto specify the default branch.
-
setAgentId
-
getBranchName
- Returns:
- The current branch (see
setBranchName(String)).
-
getAgentId
-
setParentBranchName
Sets the branch under which new branches are created. (seesetBranchName(String).- Parameters:
branchName- Branch name ornullto specify the default branch.
-
getParentBranchName
- Returns:
- The name of the current parent branch under which new branches
will be created. (see
setParentBranchName(String)).
-
setBaselineBranchName
Sets the branch under which new branches are created. (seesetBranchName(String).- Parameters:
branchName- Branch name ornullto specify the default branch.
-
getBaselineBranchName
- Returns:
- The name of the current parent branch under which new branches
will be created. (see
setBaselineBranchName(String)).
-
setSaveDiffs
Automatically save differences as a baseline.- Parameters:
saveDiffs- Sets whether to automatically save differences as baseline.
-
getSaveDiffs
Returns whether to automatically save differences as a baseline.- Returns:
- Whether to automatically save differences as baseline.
-
setMatchTimeout
public com.applitools.eyes.config.Configuration 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 int getMatchTimeout()- Returns:
- The maximum time in ms.
-
setSaveNewTests
public com.applitools.eyes.config.Configuration 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()- Returns:
- True if new tests are saved by default.
-
setSaveFailedTests
public com.applitools.eyes.config.Configuration setSaveFailedTests(boolean saveFailedTests) Set whether or not failed tests are saved by default.- Parameters:
saveFailedTests- True if failed tests should be saved by default, false otherwise.
-
getSaveFailedTests
public boolean getSaveFailedTests()- Returns:
- True if failed tests are saved by default.
-
setBatch
public com.applitools.eyes.config.Configuration setBatch(com.applitools.eyes.BatchInfo batch) Sets the batch in which context future tests will run ornullif tests are to run standalone.- Parameters:
batch- The batch info to set.
-
getBatch
public com.applitools.eyes.BatchInfo getBatch()- Returns:
- The currently set batch info.
-
setDefaultMatchSettings
public com.applitools.eyes.config.Configuration setDefaultMatchSettings(com.applitools.eyes.ImageMatchSettings defaultMatchSettings) Updates the match settings to be used for the session.- Parameters:
defaultMatchSettings- The match settings to be used for the session.
-
getDefaultMatchSettings
public com.applitools.eyes.ImageMatchSettings getDefaultMatchSettings()- Returns:
- The match settings used for the session.
-
setMatchLevel
public com.applitools.eyes.config.Configuration setMatchLevel(com.applitools.eyes.MatchLevel matchLevel) This function is deprecated. Please usesetDefaultMatchSettings(com.applitools.eyes.ImageMatchSettings)instead.The test-wide match level to use when checking application screenshot with the expected output.
- Parameters:
matchLevel- The match level setting.- Returns:
- The match settings used for the session.
- See Also:
-
setIgnoreDisplacements
public com.applitools.eyes.config.Configuration setIgnoreDisplacements(boolean isIgnoreDisplacements) -
setAccessibilityValidation
public com.applitools.eyes.config.Configuration setAccessibilityValidation(com.applitools.eyes.AccessibilitySettings accessibilityValidation) -
setUseDom
public com.applitools.eyes.config.Configuration setUseDom(boolean useDom) -
setEnablePatterns
public com.applitools.eyes.config.Configuration setEnablePatterns(boolean enablePatterns) -
getMatchLevel
public com.applitools.eyes.MatchLevel getMatchLevel()Deprecated.Please usegetDefaultMatchSettings()instead.- Returns:
- The test-wide match level.
-
getIgnoreDisplacements
public boolean getIgnoreDisplacements() -
getAccessibilityValidation
public com.applitools.eyes.AccessibilitySettings getAccessibilityValidation() -
getUseDom
public boolean getUseDom() -
getEnablePatterns
public boolean getEnablePatterns() -
getIgnoreCaret
public boolean getIgnoreCaret()- Returns:
- Whether to ignore or the blinking caret or not when comparing images.
-
setIgnoreCaret
public com.applitools.eyes.config.Configuration setIgnoreCaret(boolean value) Sets the ignore blinking caret value.- Parameters:
value- The ignore value.
-
getStitchOverlap
public int getStitchOverlap()Returns the stitching overlap in pixels. -
setStitchOverlap
public com.applitools.eyes.config.Configuration setStitchOverlap(int pixels) Sets the stitching overlap in pixels.- Parameters:
pixels- The width (in pixels) of the overlap.
-
setHostOS
- Parameters:
hostOS- The host OS running the AUT.
-
getHostOS
- Returns:
- get the host OS running the AUT.
-
setHostApp
- Parameters:
hostApp- The application running the AUT (e.g., Chrome).
-
getHostApp
- Returns:
- The application name running the AUT.
-
setBaselineName
Deprecated.Only available for backward compatibility. SeesetBaselineEnvName(String).- Parameters:
baselineName- If specified, determines the baseline to compare with and disables automatic baseline inference.
-
getBaselineName
Deprecated.Only available for backward compatibility. SeegetBaselineEnvName().- Returns:
- The baseline name, if specified.
-
setBaselineEnvName
If notnull, determines the name of the environment of the baseline.- Parameters:
baselineEnvName- The name of the baseline's environment.
-
setEnvironmentName
-
getBaselineEnvName
If notnull, determines the name of the environment of the baseline.- Returns:
- The name of the baseline's environment, or
nullif no such name was set.
-
getEnvironmentName
-
setEnvName
If notnullspecifies a name for the environment in which the application under test is running.- Parameters:
envName- The name of the environment of the baseline.
-
getEnvName
If notnullspecifies a name for the environment in which the application under test is running.- Returns:
- The name of the environment of the baseline, or
nullif no such name was set.
-
setAppEnvironment
Deprecated.Superseded bysetHostOS(String)andsetHostApp(String). Sets the OS (e.g., Windows) and application (e.g., Chrome) that host the application under test.- Parameters:
hostOS- The name of the OS hosting the application under test ornullto auto-detect.hostApp- The name of the application hosting the application under test ornullto auto-detect.
-
setConfiguration
public void setConfiguration(com.applitools.eyes.config.Configuration configuration) -
getConfiguration
public com.applitools.eyes.config.Configuration getConfiguration() -
setProxy
public void setProxy(com.applitools.eyes.AbstractProxySettings proxySettings) -
getProxy
public com.applitools.eyes.AbstractProxySettings getProxy() -
getApiKey
- Specified by:
getApiKeyin interfacecom.applitools.eyes.IEyesBase
-
setApiKey
-
getServerUrl
- Specified by:
getServerUrlin interfacecom.applitools.eyes.IEyesBase
-
setServerUrl
-
setIsDisabled
- Specified by:
setIsDisabledin interfacecom.applitools.eyes.IEyesBase
-
getIsDisabled
- Specified by:
getIsDisabledin interfacecom.applitools.eyes.IEyesBase
-
getFullAgentId
- Specified by:
getFullAgentIdin interfacecom.applitools.eyes.IEyesBase
-
getIsOpen
public boolean getIsOpen()Gets is open.- Specified by:
getIsOpenin interfacecom.applitools.eyes.IEyesBase- Returns:
- Whether a session is open.
-
setLogHandler
public void setLogHandler(com.applitools.eyes.LogHandler logHandler) - Specified by:
setLogHandlerin interfacecom.applitools.eyes.IEyesBase
-
getLogHandler
public com.applitools.eyes.LogHandler getLogHandler()- Specified by:
getLogHandlerin interfacecom.applitools.eyes.IEyesBase
-
getLogger
public com.applitools.eyes.Logger getLogger()- Specified by:
getLoggerin interfacecom.applitools.eyes.IEyesBase
-
addProperty
-
clearProperties
public void clearProperties()- Specified by:
clearPropertiesin interfacecom.applitools.eyes.IEyesBase
-
abortIfNotClosed
public com.applitools.eyes.TestResults abortIfNotClosed()- Specified by:
abortIfNotClosedin interfacecom.applitools.eyes.IEyesBase
-
closeAsync
public void closeAsync()- Specified by:
closeAsyncin interfacecom.applitools.eyes.IEyesBase
-
abortAsync
public void abortAsync()- Specified by:
abortAsyncin interfacecom.applitools.eyes.IEyesBase
-
abort
public com.applitools.eyes.TestResults abort()- Specified by:
abortin interfacecom.applitools.eyes.IEyesBase
-
getResults
- Specified by:
getResultsin interfacecom.applitools.eyes.IEyesBase
-
getResults
- Specified by:
getResultsin interfacecom.applitools.eyes.IEyesBase
-
setImageCut
public void setImageCut(com.applitools.eyes.UnscaledFixedCutProvider unscaledFixedCutProvider) -
setDebugScreenshotsPath
Sets debug screenshots path.- Parameters:
pathToSave- Path where you want to save the debug screenshots.
-
getDebugScreenshotsPath
Gets debug screenshots path.- Returns:
- The path where you want to save the debug screenshots.
-
setDebugScreenshotsPrefix
Sets debug screenshots prefix.- Parameters:
prefix- The prefix for the screenshots' names.
-
getDebugScreenshotsPrefix
Gets debug screenshots prefix.- Returns:
- The prefix for the screenshots' names.
-
setHideScrollbars
-
setHideCaret
-
setStitchMode
public void setStitchMode(com.applitools.eyes.selenium.StitchMode stitchMode)
-