Class Eyes

  • All Implemented Interfaces:
    com.applitools.eyes.IEyesBase

    public class Eyes
    extends Object
    implements com.applitools.eyes.IEyesBase
    The type Eyes.
    • Constructor Detail

      • Eyes

        public Eyes()
        Instantiates a new Eyes.
      • Eyes

        public Eyes​(com.applitools.eyes.EyesRunner runner)
        Instantiates a new Eyes.
        Parameters:
        runner - the runner
    • Method Detail

      • getExecutionCloudURL

        public static String getExecutionCloudURL()
        Get the Execution Cloud URL.
        Returns:
        the Execution Cloud URL using default params
      • open

        public org.openqa.selenium.WebDriver open​(org.openqa.selenium.WebDriver webDriver)
        Open web driver.
        Parameters:
        webDriver - the web driver
        Returns:
        the web driver
      • open

        public org.openqa.selenium.WebDriver open​(org.openqa.selenium.WebDriver driver,
                                                  String appName,
                                                  String testName)
        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. (i.e., the visible part of the document's body) or null to use the current window's viewport.
        Returns:
        A wrapped WebDriver which enables SeleniumEyes trigger recording and frame handling.
      • open

        public void open​(String appName,
                         String testName)
        Starts a test without a driver
        Parameters:
        appName - The name of the application under test.
        testName - The test name. (i.e., the visible part of the document's body) or null to use the current window's viewport.
      • open

        public void open​(String appName,
                         String testName,
                         com.applitools.eyes.RectangleSize viewportSize)
        Starts a test without a driver
        Parameters:
        appName - The name of the application under test.
        testName - The test name. (i.e., the visible part of the document's body) or null to use the current window's viewport.
        viewportSize - The required browser's viewport size (i.e., the visible part of the document's body) or null to use the current window's viewport.
      • open

        public org.openqa.selenium.WebDriver open​(org.openqa.selenium.WebDriver driver,
                                                  String appName,
                                                  String testName,
                                                  com.applitools.eyes.RectangleSize viewportSize)
        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) or null to use the current window's viewport.
        Returns:
        A wrapped WebDriver which enables SeleniumEyes trigger recording and frame handling. sessionType defaults to null.
      • 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 rest client.
        Parameters:
        proxySettings - The proxy settings to be used by the rest client. If null then no proxy is set.
      • setIsDisabled

        public void setIsDisabled​(Boolean isDisabled)
        Sets is disabled.
        Specified by:
        setIsDisabled in interface com.applitools.eyes.IEyesBase
        Parameters:
        isDisabled - If true, all interactions with this API will be silently ignored.
      • check

        public void check​(com.applitools.ICheckSettings[] checkSettings)
        Check an array of targets.
        Parameters:
        checkSettings - the check settings array (@see Target, @see ICheckSettings)
      • check

        public void check​(com.applitools.ICheckSettings checkSettings,
                          com.applitools.ICheckSettings... additionalSettings)
        Check one or more targets.
        Parameters:
        checkSettings - the check settings (@see Target, @see ICheckSettings)
        additionalSettings - optional additional targets to check.
      • close

        public com.applitools.eyes.TestResults close()
        See close(boolean). throwEx defaults to true.
        Returns:
        The test results.
      • abortIfNotClosed

        public com.applitools.eyes.TestResults abortIfNotClosed()
        If a test is running, aborts it. Otherwise, does nothing.
        Specified by:
        abortIfNotClosed in interface com.applitools.eyes.IEyesBase
      • abort

        public com.applitools.eyes.TestResults abort()
        Specified by:
        abort in interface com.applitools.eyes.IEyesBase
      • getResults

        public List<com.applitools.eyes.TestResults> getResults​(boolean shouldThrowException)
        Specified by:
        getResults in interface com.applitools.eyes.IEyesBase
      • getResults

        public List<com.applitools.eyes.TestResults> getResults()
        Specified by:
        getResults in interface com.applitools.eyes.IEyesBase
      • abortAsync

        public void abortAsync()
        Specified by:
        abortAsync in interface com.applitools.eyes.IEyesBase
      • getIsDisabled

        public Boolean getIsDisabled()
        Gets is disabled.
        Specified by:
        getIsDisabled in interface com.applitools.eyes.IEyesBase
        Returns:
        Whether eyes is disabled.
      • getApiKey

        public String getApiKey()
        Gets api key.
        Specified by:
        getApiKey in interface com.applitools.eyes.IEyesBase
        Returns:
        the api key
      • setApiKey

        public void setApiKey​(String apiKey)
        Sets api key.
        Parameters:
        apiKey - the api key
      • setBranchName

        public void setBranchName​(String branchName)
        Sets branch name.
        Parameters:
        branchName - the branch name
      • setParentBranchName

        public void setParentBranchName​(String branchName)
        Sets parent branch name.
        Parameters:
        branchName - the branch name
      • setHideCaret

        public void setHideCaret​(boolean hideCaret)
        Sets hide caret.
        Parameters:
        hideCaret - the hide caret
      • 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 int getMatchTimeout()
        Gets match timeout.
        Returns:
        The maximum time in ms 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.
      • setSaveFailedTests

        public void 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()
        Gets save failed tests.
        Returns:
        True if failed tests are saved by default.
      • setBatch

        public void setBatch​(com.applitools.eyes.BatchInfo batch)
        Sets the batch in which context future tests will run or null if tests are to run standalone.
        Parameters:
        batch - The batch info to set.
      • getBatch

        public com.applitools.eyes.BatchInfo getBatch()
        Gets batch.
        Returns:
        The currently set batch info.
      • setFailureReports

        public void setFailureReports​(com.applitools.eyes.FailureReports failureReports)
        Sets failure reports.
        Parameters:
        failureReports - The failure reports setting.
        See Also:
        FailureReports
      • getFailureReports

        public com.applitools.eyes.FailureReports getFailureReports()
        Gets failure reports.
        Returns:
        the failure reports setting.
      • setDefaultMatchSettings

        public void 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()
        Gets default match settings.
        Returns:
        The match settings used for the session.
      • setMatchLevel

        public void setMatchLevel​(com.applitools.eyes.MatchLevel matchLevel)
        This function is deprecated. Please use setDefaultMatchSettings(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.
        See Also:
        MatchLevel
      • getMatchLevel

        public com.applitools.eyes.MatchLevel getMatchLevel()
        Deprecated.
        Please usegetDefaultMatchSettings() instead.
        Gets match level.
        Returns:
        The test-wide match level.
      • getFullAgentId

        public String getFullAgentId()
        Gets full agent id.
        Specified by:
        getFullAgentId in interface com.applitools.eyes.IEyesBase
        Returns:
        The full agent id composed of both the base agent id and the user given agent id.
      • getIsOpen

        public boolean getIsOpen()
        Gets is open.
        Specified by:
        getIsOpen in interface com.applitools.eyes.IEyesBase
        Returns:
        Whether a session is open.
      • getDefaultServerUrl

        public static URI getDefaultServerUrl()
        Gets default server url.
        Returns:
        the default server url
      • setLogHandler

        public void setLogHandler​(com.applitools.eyes.LogHandler logHandler)
        Sets a handler of log messages generated by this API.
        Specified by:
        setLogHandler in interface com.applitools.eyes.IEyesBase
        Parameters:
        logHandler - Handles log messages generated by this API.
      • getLogHandler

        public com.applitools.eyes.LogHandler getLogHandler()
        Gets log handler.
        Specified by:
        getLogHandler in interface com.applitools.eyes.IEyesBase
        Returns:
        The currently set log handler.
      • getLogger

        public com.applitools.eyes.Logger getLogger()
        Gets logger.
        Specified by:
        getLogger in interface com.applitools.eyes.IEyesBase
        Returns:
        the logger
      • setImageCut

        public void setImageCut​(com.applitools.eyes.CutProvider cutProvider)
        Manually set the the sizes to cut from an image before it's validated.
        Parameters:
        cutProvider - the provider doing the cut.
      • getIsCutProviderExplicitlySet

        public boolean getIsCutProviderExplicitlySet()
        Gets is cut provider explicitly set.
        Returns:
        the is cut provider explicitly set
      • check

        public void check​(String tag,
                          com.applitools.ICheckSettings checkSettings)
        Check.
        Parameters:
        tag - the tag
        checkSettings - the check settings
      • close

        public com.applitools.eyes.TestResults close​(boolean shouldThrowException)
        Close test results.
        Parameters:
        shouldThrowException - the should throw exception
        Returns:
        the test results
      • setScaleRatio

        public void setScaleRatio​(Double scaleRatio)
        Manually set the scale ratio for the images being validated.
        Parameters:
        scaleRatio - The scale ratio to use, or null to reset back to automatic scaling.
      • getScaleRatio

        public Double getScaleRatio()
        Gets scale ratio.
        Returns:
        The ratio used to scale the images being validated.
      • addProperty

        public void addProperty​(String name,
                                String value)
        Adds a property to be sent to the server.
        Specified by:
        addProperty in interface com.applitools.eyes.IEyesBase
        Parameters:
        name - The property name.
        value - The property value.
      • clearProperties

        public void clearProperties()
        Clears the list of custom properties.
        Specified by:
        clearProperties in interface com.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.
      • setDebugScreenshotsPath

        public void setDebugScreenshotsPath​(String pathToSave)
        Sets debug screenshots path.
        Parameters:
        pathToSave - Path where you want to save the debug screenshots.
      • getDebugScreenshotsPath

        public String getDebugScreenshotsPath()
        Gets debug screenshots path.
        Returns:
        The path where you want to save the debug screenshots.
      • setDebugScreenshotsPrefix

        public void setDebugScreenshotsPrefix​(String prefix)
        Sets debug screenshots prefix.
        Parameters:
        prefix - The prefix for the screenshots' names.
      • getDebugScreenshotsPrefix

        public String getDebugScreenshotsPrefix()
        Gets debug screenshots prefix.
        Returns:
        The prefix for the screenshots' names.
      • getDebugScreenshotsProvider

        public com.applitools.eyes.debug.DebugScreenshotsProvider getDebugScreenshotsProvider()
        Gets debug screenshots provider.
        Returns:
        the debug screenshots provider
      • getIgnoreCaret

        public boolean getIgnoreCaret()
        Gets ignore caret.
        Returns:
        Whether to ignore or the blinking caret or not when comparing images.
      • setIgnoreCaret

        public void setIgnoreCaret​(boolean value)
        Sets the ignore blinking caret value.
        Parameters:
        value - The ignore value.
      • getStitchOverlap

        public int 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.
      • checkRegion

        public void checkRegion​(com.applitools.eyes.Region region)
        Check region.
        Parameters:
        region - the region the check. See checkRegion(Region, int, String). tag defaults to null. Default match timeout is used.
      • checkRegion

        public void checkRegion​(com.applitools.eyes.Region region,
                                int matchTimeout,
                                String tag)
                         throws com.applitools.eyes.exceptions.TestFailedException
        Takes a snapshot of the application under test and matches a specific region within it with the expected output.
        Parameters:
        region - A non empty region representing the screen region to check.
        matchTimeout - The amount of time to retry matching. (Milliseconds)
        tag - An optional tag to be associated with the snapshot.
        Throws:
        com.applitools.eyes.exceptions.TestFailedException - Thrown if a mismatch is detected and immediate failure reports are enabled.
      • checkRegion

        public void checkRegion​(org.openqa.selenium.WebElement element)
        See checkRegion(WebElement, String). tag defaults to null.
        Parameters:
        element - The element which represents the region to check.
      • checkRegion

        public void checkRegion​(org.openqa.selenium.WebElement element,
                                boolean stitchContent)
        If stitchContent is false then behaves the same as checkRegion(WebElement), otherwise behaves the same as checkElement(WebElement).
        Parameters:
        element - The element which represents the region to check.
        stitchContent - Whether to take a screenshot of the whole region and stitch if needed.
      • checkRegion

        public void checkRegion​(org.openqa.selenium.WebElement element,
                                String tag)
        See checkRegion(WebElement, int, String). Default match timeout is used.
        Parameters:
        element - The element which represents the region to check.
        tag - An optional tag to be associated with the snapshot.
      • checkRegion

        public void checkRegion​(org.openqa.selenium.WebElement element,
                                String tag,
                                boolean stitchContent)
        if stitchContent is false then behaves the same checkRegion(WebElement, String)***. Otherwise behaves the same as checkElement(WebElement, String).
        Parameters:
        element - The element which represents the region to check.
        tag - An optional tag to be associated with the snapshot.
        stitchContent - Whether to take a screenshot of the whole region and stitch if needed.
      • checkRegion

        public void checkRegion​(org.openqa.selenium.WebElement element,
                                int matchTimeout,
                                String tag)
        Takes a snapshot of the application under test and matches a region of a specific element with the expected region output.
        Parameters:
        element - The element which represents the region to check.
        matchTimeout - The amount of time to retry matching. (Milliseconds)
        tag - An optional tag to be associated with the snapshot.
        Throws:
        com.applitools.eyes.exceptions.TestFailedException - if a mismatch is detected and immediate failure reports are enabled
      • checkRegion

        public void checkRegion​(org.openqa.selenium.WebElement element,
                                int matchTimeout,
                                String tag,
                                boolean stitchContent)
        if stitchContent is false then behaves the same checkRegion(WebElement, int, String)***. Otherwise behaves the same as checkElement(WebElement, String).
        Parameters:
        element - The element which represents the region to check.
        matchTimeout - The amount of time to retry matching. (Milliseconds)
        tag - An optional tag to be associated with the snapshot.
        stitchContent - Whether to take a screenshot of the whole region and stitch if needed.
      • checkRegion

        public void checkRegion​(org.openqa.selenium.By selector)
        See checkRegion(By, String). tag defaults to null.
        Parameters:
        selector - The selector by which to specify which region to check.
      • checkRegion

        public void checkRegion​(org.openqa.selenium.By selector,
                                boolean stitchContent)
        If stitchContent is false then behaves the same as checkRegion(By). Otherwise, behaves the same as #checkElement(org.openqa.selenium.By)
        Parameters:
        selector - The selector by which to specify which region to check.
        stitchContent - Whether to take a screenshot of the whole region and stitch if needed.
      • checkRegion

        public void checkRegion​(org.openqa.selenium.By selector,
                                String tag)
        See checkRegion(By, int, String). Default match timeout is used.
        Parameters:
        selector - The selector by which to specify which region to check.
        tag - An optional tag to be associated with the screenshot.
      • checkRegion

        public void checkRegion​(org.openqa.selenium.By selector,
                                String tag,
                                boolean stitchContent)
        If stitchContent is false then behaves the same as checkRegion(By, String). Otherwise, behaves the same as checkElement(By, String).
        Parameters:
        selector - The selector by which to specify which region to check.
        tag - An optional tag to be associated with the screenshot.
        stitchContent - Whether to take a screenshot of the whole region and stitch if needed.
      • checkRegion

        public void checkRegion​(org.openqa.selenium.By selector,
                                int matchTimeout,
                                String tag)
        Takes a snapshot of the application under test and matches a region specified by the given selector with the expected region output.
        Parameters:
        selector - The selector by which to specify which region to check.
        matchTimeout - The amount of time to retry matching. (Milliseconds)
        tag - An optional tag to be associated with the screenshot.
        Throws:
        com.applitools.eyes.exceptions.TestFailedException - if a mismatch is detected and immediate failure reports are enabled
      • checkRegion

        public void checkRegion​(org.openqa.selenium.By selector,
                                int matchTimeout,
                                String tag,
                                boolean stitchContent)
        If stitchContent is true then behaves the same as checkRegion(By, int, String). Otherwise, behaves the same as checkElement(By, int, String).
        Parameters:
        selector - The selector by which to specify which region to check.
        matchTimeout - The amount of time to retry matching. (Milliseconds)
        tag - An optional tag to be associated with the screenshot.
        stitchContent - Whether to take a screenshot of the whole region and stitch if needed.
      • checkRegionInFrame

        public void checkRegionInFrame​(int frameIndex,
                                       org.openqa.selenium.By selector)
        See checkRegionInFrame(int, By, String). tag defaults to null.
        Parameters:
        frameIndex - The index of the frame to switch to. (The same index as would be used in a call to driver.switchTo().frame()).
        selector - The selector by which to specify which region to check inside the frame.
      • checkRegionInFrame

        public void checkRegionInFrame​(String[] framePath,
                                       org.openqa.selenium.By selector,
                                       int matchTimeout,
                                       String tag,
                                       boolean stitchContent)
        Switches into the given frame, takes a snapshot of the application under test and matches a region specified by the given selector.
        Parameters:
        framePath - The path to the frame to check. This is a list of frame names/IDs (where each frame is nested in the previous frame).
        selector - A Selector specifying the region to check.
        matchTimeout - The amount of time to retry matching (milliseconds).
        tag - An optional tag to be associated with the snapshot.
        stitchContent - Whether or not to stitch the internal content of the region (i.e., perform checkElement(By, int, String) on the region.
      • checkRegionInFrame

        public void checkRegionInFrame​(int frameIndex,
                                       org.openqa.selenium.By selector,
                                       int matchTimeout,
                                       String tag,
                                       boolean stitchContent)
        Switches into the given frame, takes a snapshot of the application under test and matches a region specified by the given selector.
        Parameters:
        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.
        matchTimeout - The amount of time to retry matching. (Milliseconds)
        tag - An optional tag to be associated with the snapshot.
        stitchContent - If true, stitch the internal content of the region (i.e., perform checkElement(By, int, String) on the region.
      • checkRegionInFrame

        public void checkRegionInFrame​(int frameIndex,
                                       org.openqa.selenium.By selector,
                                       boolean stitchContent)
        See checkRegionInFrame(int, By, String). tag defaults to null.
        Parameters:
        frameIndex - The index of the frame to switch to. (The same index as would be used in a call to driver.switchTo().frame()).
        selector - The selector by which to specify which region to check inside the frame.
        stitchContent - If true, stitch the internal content of the region (i.e., perform checkElement(By, int, String) on the region.
      • checkRegionInFrame

        public void checkRegionInFrame​(int frameIndex,
                                       org.openqa.selenium.By selector,
                                       String tag)
        See checkRegionInFrame(int, By, String, boolean). stitchContent defaults to true.
        Parameters:
        frameIndex - The index of the frame to switch to. (The same index as would be used in a call to driver.switchTo().frame()).
        selector - The selector by which to specify which region to check inside the frame.
        tag - An optional tag to be associated with the screenshot.
      • checkRegionInFrame

        public void checkRegionInFrame​(int frameIndex,
                                       org.openqa.selenium.By selector,
                                       String tag,
                                       boolean stitchContent)
        See checkRegionInFrame(int, By, int, String, boolean). Default match timeout is used.
        Parameters:
        frameIndex - The index of the frame to switch to. (The same index as would be used in a call to driver.switchTo().frame()).
        selector - The selector by which to specify which region to check inside the frame.
        tag - An optional tag to be associated with the screenshot.
        stitchContent - If true, stitch the internal content of the region (i.e., perform checkElement(By, int, String) on the region.
      • checkRegionInFrame

        public void checkRegionInFrame​(int frameIndex,
                                       org.openqa.selenium.By selector,
                                       int matchTimeout,
                                       String tag)
        See checkRegionInFrame(int, By, int, String, boolean). stitchContent defaults to true.
        Parameters:
        frameIndex - The index of the frame to switch to. (The same index as would be used in a call to driver.switchTo().frame()).
        selector - The selector by which to specify which region to check inside the frame.
        matchTimeout - The amount of time to retry matching. (Milliseconds)
        tag - An optional tag to be associated with the screenshot.
      • checkRegionInFrame

        public void checkRegionInFrame​(String frameNameOrId,
                                       org.openqa.selenium.By selector)
        See checkRegionInFrame(String, By, int, String, boolean). stitchContent defaults to null.
        Parameters:
        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.
      • checkRegionInFrame

        public void checkRegionInFrame​(String frameNameOrId,
                                       org.openqa.selenium.By selector,
                                       boolean stitchContent)
        Parameters:
        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.
        stitchContent - If true, stitch the internal content of the region (i.e., perform checkElement(By, int, String) on the region.
      • checkRegionInFrame

        public void checkRegionInFrame​(String frameNameOrId,
                                       org.openqa.selenium.By selector,
                                       int matchTimeout,
                                       boolean stitchContent)
        Parameters:
        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.
        matchTimeout - The amount of time to retry matching. (Milliseconds)
        stitchContent - If true, stitch the internal content of the region (i.e., perform checkElement(By, int, String) on the region.
      • checkRegionInFrame

        public void checkRegionInFrame​(String frameNameOrId,
                                       org.openqa.selenium.By selector,
                                       String tag)
        See checkRegionInFrame(String, By, int, String, boolean). stitchContent defaults to null.
        Parameters:
        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.
      • checkRegionInFrame

        public void checkRegionInFrame​(String frameNameOrId,
                                       org.openqa.selenium.By selector,
                                       String tag,
                                       boolean stitchContent)
        See checkRegionInFrame(String, By, int, String, boolean). Default match timeout is used
        Parameters:
        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.
        stitchContent - If true, stitch the internal content of the region (i.e., perform checkElement(By, int, String) on the region.
      • checkRegionInFrame

        public void checkRegionInFrame​(String frameNameOrId,
                                       org.openqa.selenium.By selector,
                                       int matchTimeout,
                                       String tag)
        See checkRegionInFrame(String, By, int, String, boolean). stitchContent defaults to true.
        Parameters:
        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 inside the frame.
        matchTimeout - The amount of time to retry matching. (Milliseconds)
        tag - An optional tag to be associated with the snapshot.
      • checkRegionInFrame

        public void checkRegionInFrame​(String frameNameOrId,
                                       org.openqa.selenium.By selector,
                                       int matchTimeout,
                                       String tag,
                                       boolean stitchContent)
        Switches into the given frame, takes a snapshot of the application under test and matches a region specified by the given selector.
        Parameters:
        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 inside the frame.
        matchTimeout - The amount of time to retry matching. (Milliseconds)
        tag - An optional tag to be associated with the snapshot.
        stitchContent - If true, stitch the internal content of the region (i.e., perform checkElement(By, int, String) on the region.
      • checkRegionInFrame

        public void checkRegionInFrame​(org.openqa.selenium.WebElement frameReference,
                                       org.openqa.selenium.By selector)
        See checkRegionInFrame(WebElement, By, boolean). stitchContent defaults to null.
        Parameters:
        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 inside the frame.
      • checkRegionInFrame

        public void checkRegionInFrame​(org.openqa.selenium.WebElement frameReference,
                                       org.openqa.selenium.By selector,
                                       boolean stitchContent)
        Parameters:
        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 inside the frame.
        stitchContent - If true, stitch the internal content of the region (i.e., perform checkElement(By, int, String) on the region.
      • checkRegionInFrame

        public void checkRegionInFrame​(org.openqa.selenium.WebElement frameReference,
                                       org.openqa.selenium.By selector,
                                       String tag)
        See checkRegionInFrame(WebElement, By, String, boolean). stitchContent defaults to true.
        Parameters:
        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 inside the frame.
        tag - An optional tag to be associated with the snapshot.
      • checkRegionInFrame

        public void checkRegionInFrame​(org.openqa.selenium.WebElement frameReference,
                                       org.openqa.selenium.By selector,
                                       String tag,
                                       boolean stitchContent)
        Parameters:
        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 inside the frame.
        tag - An optional tag to be associated with the snapshot.
        stitchContent - If true, stitch the internal content of the region (i.e., perform checkElement(By, int, String) on the region.
      • checkRegionInFrame

        public void checkRegionInFrame​(org.openqa.selenium.WebElement frameReference,
                                       org.openqa.selenium.By selector,
                                       int matchTimeout,
                                       String tag)
        Parameters:
        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 inside the frame.
        matchTimeout - The amount of time to retry matching. (Milliseconds)
        tag - An optional tag to be associated with the snapshot.
      • checkRegionInFrame

        public void checkRegionInFrame​(org.openqa.selenium.WebElement frameReference,
                                       org.openqa.selenium.By selector,
                                       int matchTimeout,
                                       String tag,
                                       boolean stitchContent)
        Switches into the given frame, takes a snapshot of the application under test and matches a region specified by the given selector.
        Parameters:
        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.
        matchTimeout - The amount of time to retry matching. (Milliseconds)
        tag - An optional tag to be associated with the snapshot.
        stitchContent - If true, stitch the internal content of the region (i.e., perform checkElement(By, int, String) on the region.
      • checkElement

        public void checkElement​(org.openqa.selenium.WebElement element)
        See checkElement(WebElement, String). tag defaults to null.
        Parameters:
        element - the element
      • checkElement

        public void checkElement​(org.openqa.selenium.WebElement element,
                                 String tag)
        Check element.
        Parameters:
        element - the element to check
        tag - See checkElement(WebElement, int, String). Default match timeout is used.
      • checkElement

        public void checkElement​(org.openqa.selenium.WebElement element,
                                 int matchTimeout,
                                 String tag)
        Takes a snapshot of the application under test and matches a specific element with the expected region output.
        Parameters:
        element - The element to check.
        matchTimeout - The amount of time to retry matching. (Milliseconds)
        tag - An optional tag to be associated with the snapshot.
        Throws:
        com.applitools.eyes.exceptions.TestFailedException - if a mismatch is detected and immediate failure reports are enabled
      • checkElement

        public void checkElement​(org.openqa.selenium.By selector)
        Check element.
        Parameters:
        selector - the selector See checkElement(By, String). tag defaults to null.
      • checkElement

        public void checkElement​(org.openqa.selenium.By selector,
                                 String tag)
        Check element.
        Parameters:
        selector - selector
        tag - tg See checkElement(By, int, String). Default match timeout is used.
      • checkElement

        public void checkElement​(org.openqa.selenium.By selector,
                                 int matchTimeout,
                                 String tag)
        Takes a snapshot of the application under test and matches an element specified by the given selector with the expected region output.
        Parameters:
        selector - Selects the element to check.
        matchTimeout - The amount of time to retry matching. (Milliseconds)
        tag - An optional tag to be associated with the screenshot.
        Throws:
        com.applitools.eyes.exceptions.TestFailedException - if a mismatch is detected and immediate failure reports are enabled
      • getViewportSize

        public com.applitools.eyes.RectangleSize getViewportSize()
        Use this method only if you made a previous call to (WebDriver, String, String)*** or one of its variants.

        Returns:
        the viewport size
      • getViewportSize

        public static com.applitools.eyes.RectangleSize getViewportSize​(org.openqa.selenium.WebDriver driver)
        Call this method if for some reason you don't want to call open(WebDriver, String, String) (or one of its variants) yet.
        Parameters:
        driver - The driver to use for getting the viewport.
        Returns:
        The viewport size of the current context.
      • setViewportSize

        public static void setViewportSize​(org.openqa.selenium.WebDriver driver,
                                           com.applitools.eyes.RectangleSize size)
        Set the viewport size using the driver. Call this method if for some reason you don't want to call open(WebDriver, String, String) (or one of its variants) yet.
        Parameters:
        driver - The driver to use for setting the viewport.
        size - The required viewport size.
      • getHideCaret

        public boolean getHideCaret()
        Gets hide caret.
        Returns:
        gets the hide caret flag
      • shouldStitchContent

        public boolean shouldStitchContent()
        Should stitch content boolean.
        Returns:
        the should stitch flag
      • setForceFullPageScreenshot

        public void setForceFullPageScreenshot​(boolean shouldForce)
        Forces a full page screenshot (by scrolling and stitching) if the browser only supports viewport screenshots).
        Parameters:
        shouldForce - Whether to force a full page screenshot or not.
      • getForceFullPageScreenshot

        public boolean getForceFullPageScreenshot()
        Gets force full page screenshot.
        Returns:
        Whether SeleniumEyes should force a full page screenshot.
      • setWaitBeforeScreenshots

        public void setWaitBeforeScreenshots​(int waitBeforeScreenshots)
        Sets the time to wait just before taking a screenshot (e.g., to allow positioning to stabilize when performing a full page stitching).
        Parameters:
        waitBeforeScreenshots - The time to wait (Milliseconds). Values smaller or equal to 0, will cause the default value to be used.
      • getWaitBeforeScreenshots

        public int getWaitBeforeScreenshots()
        Gets wait before screenshots.
        Returns:
        The time to wait just before taking a screenshot.
      • setScrollToRegion

        public void setScrollToRegion​(boolean shouldScroll)
        Turns on/off the automatic scrolling to a region being checked by checkRegion.
        Parameters:
        shouldScroll - Whether to automatically scroll to a region being validated.
      • getScrollToRegion

        public boolean getScrollToRegion()
        Gets scroll to region.
        Returns:
        Whether to automatically scroll to a region being validated.
      • setStitchMode

        public void setStitchMode​(com.applitools.eyes.selenium.StitchMode mode)
        Set the type of stitching used for full page screenshots. When the page includes fixed position header/sidebar, use StitchMode.CSS. Default is StitchMode.SCROLL.
        Parameters:
        mode - The stitch mode to set.
      • getStitchMode

        public com.applitools.eyes.selenium.StitchMode getStitchMode()
        Gets stitch mode.
        Returns:
        The current stitch mode settings.
      • setHideScrollbars

        public void setHideScrollbars​(boolean shouldHide)
        Hide the scrollbars when taking screenshots.
        Parameters:
        shouldHide - Whether to hide the scrollbars or not.
      • getHideScrollbars

        public boolean getHideScrollbars()
        Gets hide scrollbars.
        Returns:
        Whether or not scrollbars are hidden when taking screenshots.
      • getRotation

        public com.applitools.eyes.selenium.positioning.ImageRotation getRotation()
        Gets rotation.
        Returns:
        The image rotation model.
      • setRotation

        public void setRotation​(com.applitools.eyes.selenium.positioning.ImageRotation rotation)
        Sets rotation.
        Parameters:
        rotation - The image rotation model.
      • getDevicePixelRatio

        public double getDevicePixelRatio()
        Gets device pixel ratio.
        Returns:
        The device pixel ratio, or if the DPR is not known yet or if it wasn't possible to extract it.
      • checkWindow

        public void checkWindow()
        See checkWindow(String). tag defaults to null. Default match timeout is used.
      • checkWindow

        public void checkWindow​(String tag)
        See checkWindow(int, String). Default match timeout is used.
        Parameters:
        tag - An optional tag to be associated with the snapshot.
      • checkWindow

        public void checkWindow​(int matchTimeout,
                                String tag)
        Takes a snapshot of the application under test and matches it with the expected output.
        Parameters:
        matchTimeout - The amount of time to retry matching (Milliseconds).
        tag - An optional tag to be associated with the snapshot.
        Throws:
        com.applitools.eyes.exceptions.TestFailedException - Thrown if a mismatch is detected and immediate failure reports are enabled.
      • checkWindow

        public void checkWindow​(String tag,
                                boolean fully)
      • checkFrame

        public void checkFrame​(String frameNameOrId)
        Check frame.
        Parameters:
        frameNameOrId - frame to check(name or id) See checkFrame(String, int, String). tag defaults to null. Default match timeout is used.
      • checkFrame

        public void checkFrame​(String frameNameOrId,
                               String tag)
        Check frame.
        Parameters:
        frameNameOrId - frame to check(name or id)
        tag - See checkFrame(String, int, String). Default match timeout is used.
      • checkFrame

        public void checkFrame​(String frameNameOrId,
                               int matchTimeout,
                               String tag)
        Matches the frame given as parameter, by switching into the frame and using stitching to get an image of the frame.
        Parameters:
        frameNameOrId - The name or id of the frame to check. (The same name/id as would be used in a call to driver.switchTo().frame()).
        matchTimeout - The amount of time to retry matching. (Milliseconds)
        tag - An optional tag to be associated with the match.
      • checkFrame

        public void checkFrame​(int frameIndex)
        Check frame.
        Parameters:
        frameIndex - index of frame See checkFrame(int, int, String). tag defaults to null. Default match timeout is used.
      • checkFrame

        public void checkFrame​(int frameIndex,
                               String tag)
        Check frame.
        Parameters:
        frameIndex - index of frame
        tag - See checkFrame(int, int, String). Default match timeout is used.
      • checkFrame

        public void checkFrame​(int frameIndex,
                               int matchTimeout,
                               String tag)
        Matches the frame given as parameter, by switching into the frame and using stitching to get an image of the frame.
        Parameters:
        frameIndex - The index of the frame to switch to. (The same index as would be used in a call to driver.switchTo().frame()).
        matchTimeout - The amount of time to retry matching. (Milliseconds)
        tag - An optional tag to be associated with the match.
      • checkFrame

        public void checkFrame​(org.openqa.selenium.WebElement frameReference)
        Check frame.
        Parameters:
        frameReference - web element to check See checkFrame(WebElement, int, String). tag defaults to null. Default match timeout is used.
      • checkFrame

        public void checkFrame​(org.openqa.selenium.WebElement frameReference,
                               String tag)
        Check frame.
        Parameters:
        frameReference - web element to check
        tag - tag See checkFrame(WebElement, int, String). Default match timeout is used.
      • checkFrame

        public void checkFrame​(org.openqa.selenium.WebElement frameReference,
                               int matchTimeout,
                               String tag)
        Matches the frame given as parameter, by switching into the frame and using stitching to get an image of the frame.
        Parameters:
        frameReference - The element which is the frame to switch to. (as would be used in a call to driver.switchTo().frame() ).
        matchTimeout - The amount of time to retry matching (milliseconds).
        tag - An optional tag to be associated with the match.
      • checkFrame

        public void checkFrame​(String[] framePath,
                               int matchTimeout,
                               String tag)
        Matches the frame given by the frames path, by switching into the frame and using stitching to get an image of the frame.
        Parameters:
        framePath - The path to the frame to check. This is a list of frame names/IDs (where each frame is nested in the previous frame).
        matchTimeout - The amount of time to retry matching (milliseconds).
        tag - An optional tag to be associated with the match.
      • checkFrame

        public void checkFrame​(String[] framesPath)
        See checkFrame(String[], int, String). Default match timeout is used. tag defaults to null.
        Parameters:
        framesPath - the frames path
      • getServerUrl

        public URI getServerUrl()
        Gets server url.
        Specified by:
        getServerUrl in interface com.applitools.eyes.IEyesBase
        Returns:
        The URI of the eyes server.
      • setAgentId

        public void setAgentId​(String agentId)
        Sets the user given agent id of the SDK. null is referred to as no id.
        Parameters:
        agentId - The agent ID to set.
      • getAgentId

        public String getAgentId()
        Gets agent id.
        Returns:
        The user given agent id of the SDK.
      • getProxy

        public com.applitools.eyes.AbstractProxySettings getProxy()
        Gets proxy.
        Returns:
        The current proxy settings used by the server connector, or null if no proxy is set.
      • setAppName

        public void setAppName​(String appName)
        Sets app name.
        Parameters:
        appName - The name of the application under test.
      • getAppName

        public String getAppName()
        Gets app name.
        Returns:
        The name of the application under test.
      • getHostOS

        public String getHostOS()
        Gets host os.
        Returns:
        the host os
      • getHostApp

        public String getHostApp()
        Gets host app.
        Returns:
        The application name running the AUT.
      • setBaselineName

        public void setBaselineName​(String baselineName)
        Deprecated.
        Only available for backward compatibility. See setBaselineEnvName(String).
        Sets baseline name.
        Parameters:
        baselineName - If specified, determines the baseline to compare with and disables automatic baseline inference.
      • getBaselineName

        public String getBaselineName()
        Deprecated.
        Only available for backward compatibility. See getBaselineEnvName().
        Gets baseline name.
        Returns:
        The baseline name, if specified.
      • setBaselineEnvName

        public void setBaselineEnvName​(String baselineEnvName)
        If not null, determines the name of the environment of the baseline.
        Parameters:
        baselineEnvName - The name of the baseline's environment.
      • getBaselineEnvName

        public String getBaselineEnvName()
        If not null, determines the name of the environment of the baseline.
        Returns:
        The name of the baseline's environment, or null if no such name was set.
      • setEnvName

        public void setEnvName​(String envName)
        If not null specifies a name for the environment in which the application under test is running.
        Parameters:
        envName - The name of the environment of the baseline.
      • getEnvName

        public String getEnvName()
        If not null specifies a name for the environment in which the application under test is running.
        Returns:
        The name of the environment of the baseline, or null if no such name was set.
      • getPositionProvider

        @Deprecated
        public com.applitools.eyes.positioning.PositionProvider getPositionProvider()
        Deprecated.
        Gets position provider.
        Returns:
        The currently set position provider.
      • setPositionProvider

        @Deprecated
        public void setPositionProvider​(com.applitools.eyes.positioning.PositionProvider positionProvider)
        Deprecated.
        Sets position provider.
        Parameters:
        positionProvider - The position provider to be used.
      • setExplicitViewportSize

        @Deprecated
        public void setExplicitViewportSize​(com.applitools.eyes.RectangleSize explicitViewportSize)
        Deprecated.
        Sets explicit viewport size.
        Parameters:
        explicitViewportSize - sets the viewport
      • log

        public void log​(String message)
        Log.
        Parameters:
        message - the massage to log
      • isSendDom

        public boolean isSendDom()
        Is send dom boolean.
        Returns:
        sendDom flag
      • setSendDom

        public void setSendDom​(boolean isSendDom)
        Sets send dom.
        Parameters:
        isSendDom - should send dom flag
      • setHostOS

        public void setHostOS​(String hostOS)
        Sets host os.
        Parameters:
        hostOS - the hosting host
      • setHostApp

        public void setHostApp​(String hostApp)
        Sets host app.
        Parameters:
        hostApp - The application running the AUT (e.g., Chrome).
      • getParentBranchName

        public String getParentBranchName()
        Gets parent branch name.
        Returns:
        The name of the current parent branch under which new branches will be created. (see setParentBranchName(String)).
      • setBaselineBranchName

        public void setBaselineBranchName​(String branchName)
        Sets the branch under which new branches are created. (see setBranchName(String)***.
        Parameters:
        branchName - Branch name or null to specify the default branch.
      • getBaselineBranchName

        public String getBaselineBranchName()
        Gets baseline branch name.
        Returns:
        The name of the current parent branch under which new branches will be created. (see setBaselineBranchName(String)).
      • setSaveDiffs

        public void setSaveDiffs​(Boolean saveDiffs)
        Automatically save differences as a baseline.
        Parameters:
        saveDiffs - Sets whether to automatically save differences as baseline.
      • getSaveDiffs

        public Boolean getSaveDiffs()
        Returns whether to automatically save differences as a baseline.
        Returns:
        Whether to automatically save differences as baseline.
      • setIgnoreDisplacements

        public void setIgnoreDisplacements​(boolean isIgnoreDisplacements)
      • getIgnoreDisplacements

        public boolean getIgnoreDisplacements()
      • setDebugResourceWriter

        @Deprecated
        public void setDebugResourceWriter​(com.applitools.eyes.visualgrid.model.IDebugResourceWriter debugResourceWriter)
        Deprecated.
      • setAppEnvironment

        @Deprecated
        public void setAppEnvironment​(String hostOS,
                                      String hostApp)
        Deprecated.
        Superseded by setHostOS(String) and setHostApp(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 or null to auto-detect.
        hostApp - The name of the application hosting the application under test or null to auto-detect.
      • getDriver

        public org.openqa.selenium.WebDriver getDriver()
        Gets driver.
        Returns:
        the driver
      • getCurrentFramePositionProvider

        @Deprecated
        public com.applitools.eyes.positioning.PositionProvider getCurrentFramePositionProvider()
        Deprecated.
        Gets current frame position provider.
        Returns:
        get Current Frame Position Provider
      • getRegionToCheck

        @Deprecated
        public com.applitools.eyes.Region getRegionToCheck()
        Deprecated.
        Gets region to check.
        Returns:
        the region to check
      • setRegionToCheck

        @Deprecated
        public void setRegionToCheck​(com.applitools.eyes.Region regionToCheck)
        Deprecated.
        Sets region to check.
        Parameters:
        regionToCheck - the region to check
      • getCurrentFrameScrollRootElement

        @Deprecated
        public org.openqa.selenium.WebElement getCurrentFrameScrollRootElement()
        Deprecated.
        Gets current frame scroll root element.
        Returns:
        the current scroll root web element
      • getConfiguration

        public com.applitools.eyes.selenium.Configuration getConfiguration()
      • setConfiguration

        public void setConfiguration​(com.applitools.eyes.config.Configuration configuration)
      • closeAsync

        public void closeAsync()
        Specified by:
        closeAsync in interface com.applitools.eyes.IEyesBase
      • 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)
      • getEyesRef

        public com.applitools.eyes.universal.Reference getEyesRef()
      • configure

        public com.applitools.eyes.config.Configuration configure()