Eyes class

Platform: ImagesLanguage: JavaScript SDK:
This class provides the main methods used to execute tests and checkpoints.

Require statement

const {Eyes} = require('@applitools/eyes-images');
	

Constructor

Eyes()
This is the constructor for the Eyes class.

Methods

abort()
When a test is aborted, and it may be that not all of its checkpoints have excuted, call this method instead of close methods so that it will have an Aborted status in the Eyes Test Manager.
abortIfNotClosed()
When a test is aborted, and it may be that not all of its checkpoints have excuted, call this method instead of close methods so that it will have an Aborted status in the Eyes Test Manager.
addProperty()
Adds a custom key name/value property that will be associated with tests. You can view these properties and filter and group by these properties in the Test Manager.
check()
Run a checkpoint. Uses Fluent arguments to specify the various parameters.
checkImage()
Run a checkpoint on an image that you provide as a parameter.
checkRegion()
Checks a particular region of the checkpoint image.
clearProperties()
Clears any custom key name/value properties.
close()
Call this method at the end of the test. This terminates the sequence of checkpoints, and then waits synchronously for the test results and returns them.
getAgentId()
Use this method to retrieve the name and version of the SDK.
getApiKey()
Use this method to retrieve your Eyes license key that you set with setApiKey, or was extracted from the APPLITOOLS_API_KEY environment variable.
getAppName()
Use this method to retrieve the name of the application property.
getBaselineBranchName()
Use this method to retrieve the name of the branch the baseline reference will be taken from and where new and accepted steps will be saved to.
getBaselineEnvName()
Returns the name of the baseline environment defined for this test run.
getBatch()
Use this method to retrieve the batch information for tests.
getBranchName()
Use this method to retrieve the branch used for the baseline of this run.
getConfiguration()
Use this method to retrieve the current configuration object. This will be the most recent configuration object set using setConfiguration, or the initial default configuration object.
getDebugScreenshotsPath()
Use this method to retrieve the folder path where saved checkpoint images are stored (if enabled).
getDebugScreenshotsPrefix()
Use this method to retrieve the prefix added to the file names of locally stored checkpoint images (if enabled).
getDeviceInfo()
Retrieve the name of the device being rendered on the Ultrafast Grid, if it was configured explicitly by the user.
getHostApp()
Use this method to retrieve the name that is being used for the host application (browser) property.
getHostOS()
Use this method to retrieve the name of the hosting operating system property.
getIgnoreCaret()
Use this method to retrieve whether or not Eyes eliminates mismatches due to blinking cursor artifacts.
getIsDisabled()
Use this method to retrieve whether or not interactions with Eyes are ignored.
getIsOpen()
Use this to know if the Eyes instance is currently open.
getMatchLevel()
Use this method to retrieve the default match level to be used for subsequent checkpoints in the test.
getParentBranchName()
Use this method to retrieve the parent branch, from which newly created branches get their initial baseline.
getProxy()
Use this method to retrieve the settings used to access the Eyes proxy server.
getSaveDebugScreenshots()
Use this method to retrieve whether or not checkpoint images are copied to a local file (for debugging).
getSaveDiffs()
Use this method to retrieve if steps that have mismatches are automatically saved to the baseline or not.
getSaveNewTests()
Use this method to retrieve whether or not 'new' tests are saved to the baseline by default.
getScaleRatio()
Use this method to retrieve the scale ratio that is applied to images before matching.
getServerUrl()
Use this method to retrieve the URL of the Eyes server used to process the captured images.
getViewportSize()
Use this method to retrieve The value that was set for the viewport.
open()
Call this method to start a test, before calling any of the check methods.
replaceImage()
Use this method to replace an image in a step, along with its metadata.
replaceWindow()
Replace the captured image and associated metadata for a checkpoint with an image provided as a parameter.
setAgentId()
Use this method to set the name and version of the SDK.
setApiKey()
Use this method to set your Eyes license key.
setAppName()
Use this method to set the value of the application name property. The application name is one of the 5 properties that define the baseline.
setBaselineBranchName()
Use this method to set the name of the branch the baseline reference will be taken from and where new and accepted steps will be saved to.
setBaselineEnvName()
Use this method to set the name of the environment that will be used to determine the baseline.
setBatch()
Use this method to set the batch information for this test.
setBranchName()
Use this method to set the branch used for the baseline of this run.
setConfiguration()
Use this method to configure Eyes based on a configuration object.
setDebugScreenshotsPath()
Use this method to set the folder path where locally saved checkpoint images should be stored (if enabled).
setDebugScreenshotsPrefix()
Use this method to set the prefix that should be added to the file names for locally stored checkpoint images (if enabled).
setDeviceInfo()
Set the name of the device being rendered on the Ultrafast Grid.
setExplicitViewportSize()
Use this method to set the viewport size to be used to select the appropriate baseline.
setHostApp()
Use this method to set the name of the hosting application property.
setHostOS()
Use this method to set the name of the hosting operating system property.
setIgnoreCaret()
Use this method to set whether or not Eyes eliminates mismatches due to blinking cursor artifacts.
setIsDisabled()
Use this method to set whether or not interactions with Eyes will be silently ignored.
setMatchLevel()
Use this method to set the default match level to be used for subsequent checkpoints in the test.
setParentBranchName()
Use this method to set the parent branch from which newly created branches get their initial baseline.
setProxy()
Use this method to configure Eyes so that it will interact with the Eyes server via a proxy.
setSaveDebugScreenshots()
Use this method to set whether or not checkpoint images should be copied to a local file (typically for troubleshooting).
setSaveDiffs()
Use this method to set if steps that have mismatches should be automatically saved to the baseline or not.
setSaveNewTests()
Use this method to set whether or not 'new' tests are saved to the baseline by default.
setScaleRatio()
Use this method to set the scale ratio to be applied to images before matching, to compensate for different vertical and horizontal pixels density on some devices.
setServerUrl()
Use this method to set the URL of the Eyes server used to process the captured images.
setViewportSize()
Set the default viewport size property. Eyes will use this if a subsequent call to open is done without a viewport size.