Class VisualApi


  • public class VisualApi
    extends Object
    • Constructor Detail

      • VisualApi

        public VisualApi​(org.openqa.selenium.remote.RemoteWebDriver driver,
                         DataCenter region,
                         String username,
                         String accessKey)
        Creates a VisualApi instance for a given Visual Backend DataCenter
        Parameters:
        driver - The WebDriver instance where the tests should run at
        region - Visual Backend Region. For available values, see: DataCenter
        username - SauceLabs username
        accessKey - SauceLabs access key
      • VisualApi

        public VisualApi​(org.openqa.selenium.remote.RemoteWebDriver driver,
                         String url,
                         String username,
                         String accessKey)
        Creates a VisualApi instance with a custom backend URL
        Parameters:
        driver - The WebDriver instance where the tests should run at
        url - Visual Backend URL
        username - SauceLabs username
        accessKey - SauceLabs access key
      • VisualApi

        public VisualApi​(org.openqa.selenium.remote.RemoteWebDriver driver,
                         String url,
                         String username,
                         String accessKey,
                         VisualApi.BuildAttributes buildAttributes)
        Creates a VisualApi instance with a custom backend URL
        Parameters:
        driver - The WebDriver instance where the tests should run with
        url - Visual Backend URL
        username - SauceLabs username
        accessKey - SauceLabs access key
        buildAttributes - like buildName, project, branch
    • Method Detail

      • check

        public void check​(String name)
        Deprecated.
        Use sauceVisualCheck(). check() will be removed in a future version.
        Uploads and creates a snapshot with a given name and default options
        Parameters:
        name - A name for the snapshot
      • check

        public void check​(String name,
                          CheckOptions options)
        Deprecated.
        Use sauceVisualCheck(). check() will be removed in a future version.
        Uploads and creates a snapshot with a given name and default options
        Parameters:
        name - A name for the snapshot
        options - Options for the API
      • sauceVisualCheck

        public void sauceVisualCheck​(String snapshotName)
        Uploads and creates a snapshot with a given name and default options
        Parameters:
        snapshotName - A name for the snapshot
      • sauceVisualCheck

        public void sauceVisualCheck​(String snapshotName,
                                     CheckOptions options)
        Uploads and creates a snapshot with a given snapshotName and options
        Parameters:
        snapshotName - A name for the snapshot
        options - Options for the API
      • checkResults

        public Map<com.saucelabs.visual.graphql.type.DiffStatus,​Integer> checkResults()
        Deprecated.
        Use sauceVisualResults(). checkResults() will be removed in a future version.
        Return the current processing status of uploaded snapshots.
        Returns:
        A map of DiffStatus and its count of snapshot in that status.
      • sauceVisualResults

        public Map<com.saucelabs.visual.graphql.type.DiffStatus,​Integer> sauceVisualResults()
        Return the current processing status of uploaded snapshots.
        Returns:
        A map of DiffStatus and its count of snapshot in that status.
      • refreshWebDriverSessionInfo

        public void refreshWebDriverSessionInfo()