Class Continuum

java.lang.Object
com.levelaccess.continuum.Continuum

public class Continuum extends Object
This class encapsulates all of the helper functionality Access Continuum offers for running Access Engine to test both web and mobile projects. Native mobile testing is restricted to licensed Continuum Mobile users only; this functionality is not available in the Community edition of Continuum.
  • Constructor Details

    • Continuum

      public Continuum(String configPath)
      Parameters:
      configPath - a relative or absolute path to a valid continuum.json file
  • Method Details

    • setUp

      public void setUp(org.openqa.selenium.WebDriver webDriver)
      Sets up Continuum for web testing. For mobile testing, use setUp(WebDriver, TestContext) instead.
      Parameters:
      webDriver - a Selenium web driver to test with
    • setUp

      public void setUp(org.openqa.selenium.WebDriver webDriver, Continuum.TestContext context)
      Sets up Continuum for web or mobile testing. Native mobile testing is restricted to licensed Continuum Mobile users only; this functionality is not available in the Community edition of Continuum.
      Parameters:
      webDriver - a Selenium (if testing web) or Appium (if testing mobile) web driver to test with
      context - the test context, i.e. either web or mobile
    • runAllTests

      public List<AccessibilityConcern> runAllTests()
      Runs all automatic Access Engine tests against the current page, as defined by the web driver used previously to invoke setUp(WebDriver) or setUp(WebDriver, TestContext). Make sure to invoke one of the setUp methods before invoking this method.
      Returns:
      the list of accessibility concerns found by Access Engine for the current page of the web driver
    • runAllTests

      public List<AccessibilityConcern> runAllTests(List<String> xpathExclusions)
    • runAllTests

      public List<AccessibilityConcern> runAllTests(boolean includeIframeContent)
    • runAllTests

      public List<AccessibilityConcern> runAllTests(boolean includeIframeContent, List<String> xpathExclusions, Filter filter)
    • runAllTestsForAssertions

      public List<Assertion> runAllTestsForAssertions()
    • runAllTestsForAssertions

      public List<Assertion> runAllTestsForAssertions(boolean includeIframeContent)
    • runAllTestsForAssertions

      public List<Assertion> runAllTestsForAssertions(boolean includeIframeContent, Filter filter)
    • testForStandards

      public List<AccessibilityConcern> testForStandards(Integer[] standardIds)
      Runs only the automatic Access Engine tests corresponding to the specified accessibility standards against the current page, as defined by the web driver used previously to invoke setUp(WebDriver) or setUp(WebDriver, TestContext) and, for specific accessibility standard IDs, AMP. Note that the IDs of the specified accessibility standards must also be specified by Configuration.getDefaultStandardIds(), i.e. in the set of IDs implied from the value of the 'getDefaultStandardIds' attribute defined in continuum.json, otherwise no accessibility concerns will be returned. Make sure to invoke one of the setUp methods before invoking this method.
      Parameters:
      standardIds - the IDs of the accessibility standards to test for (invoke getSupportedStandards() for a list of these, or consult AMP)
      Returns:
      the list of accessibility concerns found by Access Engine for the current page of the web driver that match the specified accessibility standards
    • testForBestPractices

      public List<AccessibilityConcern> testForBestPractices(Integer[] bestPracticeIds)
      Runs only the automatic Access Engine tests corresponding to the specified best practices against the current page, as defined by the web driver used previously to invoke setUp(WebDriver) or setUp(WebDriver, TestContext) and, for specific best practice IDs, AMP. Make sure to invoke one of the setUp methods before invoking this method.
      Parameters:
      bestPracticeIds - the IDs of the best practices to test for (invoke getSupportedBestPractices() for a list of these, or consult AMP)
      Returns:
      the list of accessibility concerns found by Access Engine for the current page of the web driver that match the specified best practices
    • runTests

      public List<AccessibilityConcern> runTests(Integer[] engineTestIds)
      Runs only the specified automatic Access Engine tests against the current page, as defined by the web driver used previously to invoke setUp(WebDriver) or setUp(WebDriver, TestContext) and, for specific test IDs, AMP. Make sure to invoke one of the setUp methods before invoking this method.
      Parameters:
      engineTestIds - the IDs of the automatic Access Engine tests to test for (invoke getSupportedTests() for a list of these, or consult AMP)
      Returns:
      the list of accessibility concerns found by Access Engine for the current page of the web driver that match the specified tests
    • testForSeverity

      public List<AccessibilityConcern> testForSeverity(Integer minSeverity)
      Runs only the automatic Access Engine tests of or greater than the specified severity against the current page, as defined by the web driver used previously to invoke setUp(WebDriver) or setUp(WebDriver, TestContext). Make sure to invoke one of the setUp methods before invoking this method.
      Parameters:
      minSeverity - the inclusive minimum severity of accessibility concerns to test for on a scale of 1 to 10, where 1 is the least severe and 10 is the most severe
      Returns:
      the list of accessibility concerns found by Access Engine for the current page of the web driver whose severity is equal to or greater than minSeverity
    • testForTractability

      public List<AccessibilityConcern> testForTractability(Integer minTractability)
      Runs only the automatic Access Engine tests of or greater than the specified tractability against the current page, as defined by the web driver used previously to invoke setUp(WebDriver) or setUp(WebDriver, TestContext). Make sure to invoke one of the setUp methods before invoking this method.
      Parameters:
      minTractability - the inclusive minimum tractability of accessibility concerns to test for on a scale of 1 to 10, where 1 is the least tractable and 10 is the most tractable
      Returns:
      the list of accessibility concerns found by Access Engine for the current page of the web driver whose tractability is equal to or greater than minTractability
    • testForNoticeability

      public List<AccessibilityConcern> testForNoticeability(Integer minNoticeability)
      Runs only the automatic Access Engine tests of or greater than the specified noticeability against the current page, as defined by the web driver used previously to invoke setUp(WebDriver) or setUp(WebDriver, TestContext). Make sure to invoke one of the setUp methods before invoking this method.
      Parameters:
      minNoticeability - the inclusive minimum noticeability of accessibility concerns to test for on a scale of 1 to 10, where 1 is the least noticeable and 10 is the most noticeable
      Returns:
      the list of accessibility concerns found by Access Engine for the current page of the web driver whose noticeability is equal to or greater than minNoticeability
    • runAllTestsOnNode

      public List<AccessibilityConcern> runAllTestsOnNode(String selectorForNodeToTest)
      Runs all automatic Access Engine tests against the current page for only the specified node and all its children, as defined by the web driver used previously to invoke setUp(WebDriver) or setUp(WebDriver, TestContext) and the specified CSS (if testing a website) or Appium XPath selector (if testing a mobile app). Make sure to invoke one of the setUp methods before invoking this method.
      Parameters:
      selectorForNodeToTest - a CSS (if testing web) or Appium XPath (if testing mobile) selector to restrict accessibility testing to
      Returns:
      the list of accessibility concerns found by Access Engine for the selected element and its children on current page of the web driver
    • runAllTestsOnNode

      public List<AccessibilityConcern> runAllTestsOnNode(String selectorForNodeToTest, List<String> xpathExclusions)
    • runAllTestsOnNode

      public List<AccessibilityConcern> runAllTestsOnNode(String selectorForNodeToTest, boolean includeIframeContent)
    • runAllTestsOnNode

      public List<AccessibilityConcern> runAllTestsOnNode(String selectorForNodeToTest, boolean includeIframeContent, List<String> xpathExclusions, Filter filter)
    • testNodeForStandards

      public List<AccessibilityConcern> testNodeForStandards(Integer[] standardIds, String selectorForNodeToTest)
      Runs only the automatic Access Engine tests corresponding to the specified accessibility standards against the current page for only the specified node and all its children, as defined by the web driver used previously to invoke setUp(WebDriver) or setUp(WebDriver, TestContext) and, for specific accessibility standard IDs, AMP. Note that the IDs of the specified accessibility standards must also be specified by Configuration.getDefaultStandardIds(), i.e. in the set of IDs implied from the value of the 'getDefaultStandardIds' attribute defined in continuum.json, otherwise no accessibility concerns will be returned. Make sure to invoke one of the setUp methods before invoking this method.
      Parameters:
      standardIds - the IDs of the accessibility standards to test for (invoke getSupportedStandards() for a list of these, or consult AMP)
      selectorForNodeToTest - a CSS (if testing web) or Appium XPath (if testing mobile) selector to restrict accessibility testing to
      Returns:
      the list of accessibility concerns found by Access Engine for the current page of the web driver that match the specified accessibility standards
    • testNodeForBestPractices

      public List<AccessibilityConcern> testNodeForBestPractices(Integer[] bestPracticeIds, String selectorForNodeToTest)
      Runs only the automatic Access Engine tests corresponding to the specified best practices against the current page for only the specified node and all its children, as defined by the web driver used previously to invoke setUp(WebDriver) or setUp(WebDriver, TestContext) and, for specific best practice IDs, AMP. Make sure to invoke one of the setUp methods before invoking this method.
      Parameters:
      bestPracticeIds - the IDs of the best practices to test for (invoke getSupportedBestPractices() for a list of these, or consult AMP)
      selectorForNodeToTest - a CSS (if testing web) or Appium XPath (if testing mobile) selector to restrict accessibility testing to
      Returns:
      the list of accessibility concerns found by Access Engine for the current page of the web driver that match the specified best practices
    • runTestsOnNode

      public List<AccessibilityConcern> runTestsOnNode(Integer[] accessEngineTestIds, String selectorForNodeToTest)
      Runs only the specified automatic Access Engine tests against the current page for only the specified node and all its children, as defined by the web driver used previously to invoke setUp(WebDriver) or setUp(WebDriver, TestContext) and, for specific test IDs, AMP. Make sure to invoke one of the setUp methods before invoking this method.
      Parameters:
      accessEngineTestIds - the IDs of the automatic Access Engine tests to test for (invoke getSupportedTests() for a list of these, or consult AMP)
      selectorForNodeToTest - a CSS (if testing web) or Appium XPath (if testing mobile) selector to restrict accessibility testing to
      Returns:
      the list of accessibility concerns found by Access Engine for the current page of the web driver that match the specified tests
    • testNodeForSeverity

      public List<AccessibilityConcern> testNodeForSeverity(Integer minSeverity, String selectorForNodeToTest)
      Runs only the automatic Access Engine tests of or greater than the specified severity against the current page for only the specified node and all its children, as defined by the web driver used previously to invoke setUp(WebDriver) or setUp(WebDriver, TestContext). Make sure to invoke one of the setUp methods before invoking this method.
      Parameters:
      minSeverity - the inclusive minimum severity of accessibility concerns to test for on a scale of 1 to 10, where 1 is the least noticeable and 10 is the most noticeable
      selectorForNodeToTest - a CSS (if testing web) or Appium XPath (if testing mobile) selector to restrict accessibility testing to
      Returns:
      the list of accessibility concerns found by Access Engine for the current page of the web driver whose severity is equal to or greater than minSeverity
    • testNodeForTractability

      public List<AccessibilityConcern> testNodeForTractability(Integer minTractability, String selectorForNodeToTest)
      Runs only the automatic Access Engine tests of or greater than the specified tractability against the current page for only the specified node and all its children, as defined by the web driver used previously to invoke setUp(WebDriver) or setUp(WebDriver, TestContext). Make sure to invoke one of the setUp methods before invoking this method.
      Parameters:
      minTractability - the inclusive minimum tractability of accessibility concerns to test for on a scale of 1 to 10, where 1 is the least noticeable and 10 is the most noticeable
      selectorForNodeToTest - a CSS (if testing web) or Appium XPath (if testing mobile) selector to restrict accessibility testing to
      Returns:
      the list of accessibility concerns found by Access Engine for the current page of the web driver whose tractability is equal to or greater than minSeverity
    • testNodeForNoticeability

      public List<AccessibilityConcern> testNodeForNoticeability(Integer minNoticeability, String selectorForNodeToTest)
      Runs only the automatic Access Engine tests of or greater than the specified noticeability against the current page for only the specified node and all its children, as defined by the web driver used previously to invoke setUp(WebDriver) or setUp(WebDriver, TestContext). Make sure to invoke one of the setUp methods before invoking this method.
      Parameters:
      minNoticeability - the inclusive minimum noticeability of accessibility concerns to test for on a scale of 1 to 10, where 1 is the least noticeable and 10 is the most noticeable
      selectorForNodeToTest - a CSS (if testing web) or Appium XPath (if testing mobile) selector to restrict accessibility testing to
      Returns:
      the list of accessibility concerns found by Access Engine for the current page of the web driver whose noticeability is equal to or greater than minSeverity
    • getAccessibilityConcerns

      public List<AccessibilityConcern> getAccessibilityConcerns()
      Gets the list of accessibility concerns found by Access Engine during the last test execution.
      Returns:
      the list of accessibility concerns found by Access Engine during the last test execution
    • getAssertions

      public List<Assertion> getAssertions()
    • getAccessibilityConcernsPrettyPrinted

      public String getAccessibilityConcernsPrettyPrinted()
      Gets a pretty-printed String of accessibility concerns found by Access Engine during the last test execution.
      Returns:
      the list of accessibility concerns found by Access Engine during the last test execution.
    • getAssertionsPrettyPrinted

      public String getAssertionsPrettyPrinted()
    • getAssertionsPrettyPrinted

      public String getAssertionsPrettyPrinted(List<Assertion> assertions)
    • getSupportedTests

      public Map<Integer,String> getSupportedTests()
      Gets a map of IDs of automatic Access Engine tests (supported by Continuum) to their descriptions for the current test context and mobile type used previously to invoke setUp(WebDriver) or setUp(WebDriver, TestContext). Make sure to invoke one of the setUp methods before invoking this method.
      Returns:
      a map of IDs of Access Engine tests to their descriptions
    • getSupportedBestPractices

      public Map<Integer,String> getSupportedBestPractices()
      Gets a map of IDs of best practices (defined in AMP and supported by Continuum) to their descriptions for the current test context and mobile type used previously to invoke setUp(WebDriver) or setUp(WebDriver, TestContext). Make sure to invoke one of the setUp methods before invoking this method. If a connection to AMP could not be established when best practice data was fetched from AMP, i.e. when Continuum was instantiated, this will return an empty map.
      Returns:
      a map of IDs of best practices to their descriptions
    • getSupportedStandards

      public Map<Integer,String> getSupportedStandards()
      Gets a map of IDs of accessibility standards (defined in AMP and supported by Continuum) to their names for the current test context and mobile type used previously to invoke setUp(WebDriver) or setUp(WebDriver, TestContext). Make sure to invoke one of the setUp methods before invoking this method. If a connection to AMP could not be established when best practice data was fetched from AMP, i.e. when Continuum was instantiated, this will return an empty map.
      Returns:
      a map of IDs of accessibility standards to their names
    • getIncludePotentialAccessibilityConcerns

      public boolean getIncludePotentialAccessibilityConcerns()
      Gets whether or not accessibility concerns that require manual review are included in any of Continuum's test results. If enabled, any accessibility concerns that require manual review will have AccessibilityConcern.getNeedsReview() return true. By default, this is specified by Configuration.getIncludePotentialAccessibilityConcerns(), i.e. the value for the 'includePotentialAccessibilityConcerns' attribute defined in continuum.json. This setting can be toggled programmatically using setIncludePotentialAccessibilityConcerns(boolean), overriding the value specified in continuum.json.
      Returns:
      true if accessibility concerns that require manual review are included in any of Continuum's test results, false if they are not
    • harvestLinks

      public Set<String> harvestLinks()
      Harvests and returns the links from the current page that are found in <a> tags.
      Returns:
    • harvestLinks

      public Set<String> harvestLinks(Continuum.LinkSource[] linkSources, boolean noFollow, boolean stripFragment, boolean stripQueryString)
      Harvests and returns the links from the current page that are found in the specified source(s).
      Parameters:
      linkSources -
      noFollow -
      stripFragment -
      stripQueryString -
      Returns:
    • setIncludePotentialAccessibilityConcerns

      public void setIncludePotentialAccessibilityConcerns(boolean includePotentialAccessibilityConcerns)
      Globally sets whether or not accessibility concerns that require manual review are included in any of Continuum's test results. If enabled, any accessibility concerns that require manual review will have AccessibilityConcern.getNeedsReview() return true. Using this method will override the value for the 'includePotentialAccessibilityConcerns' attribute defined in continuum.json, which is otherwise used by default. This method is only available in the Pro edition of Continuum.
      Parameters:
      includePotentialAccessibilityConcerns - true if accessibility concerns that require manual review should be included in any of Continuum's test results, false if they should not
    • getScanWebViews

      public boolean getScanWebViews()
      Gets whether or not Continuum should scan for accessibility concerns in the content of any visible web views. If enabled, any accessibility concerns that come from web views will have AccessibilityConcern.getTestContext() return Continuum.TestContext.WEB. This setting is only applicable to mobile app testing, i.e. when setUp(WebDriver, TestContext) is invoked with Continuum.TestContext.NATIVEAPP. (Native mobile testing is restricted to licensed Continuum Mobile users only; this functionality is not available in the Community edition of Continuum.) By default, this is specified by Configuration.Mobile.getScanWebViews() ()}, i.e. the value for the 'scanWebViews' attribute of the 'mobile' object defined in continuum.json. This setting can be toggled programmatically using setScanWebViews(boolean), overriding the value specified in continuum.json.
      Returns:
      true if the scanning of web views for accessibility concerns is enabled, false if it is not
    • setScanWebViews

      public void setScanWebViews(boolean scanWebViews)
      Globally sets whether or not Continuum scans for accessibility concerns in the content of any visible web views. If enabled, any accessibility concerns that come from web views will have AccessibilityConcern.getTestContext() return Continuum.TestContext.WEB. This setting is only applicable to mobile app testing, i.e. when setUp(WebDriver, TestContext) is invoked with Continuum.TestContext.NATIVEAPP. (Native mobile testing is restricted to licensed Continuum Mobile users only; this functionality is not available in the Community edition of Continuum.) Using this method will override the value for the 'scanWebViews' attribute of the 'mobile' object defined in continuum.json, which is otherwise used by default.
      Parameters:
      scanWebViews - true if the scanning of web views for accessibility concerns is desired, false if it is not
    • getAMPReportingService

      public AMPReportingService getAMPReportingService()
      Gets the instance of the AMP reporting service associated with this instance of Continuum. Please consult our support documentation for more information on how to report to AMP.
      Returns:
      the AMP reporting service associated with this instance of Continuum
    • getLevelAccessPlatformReportingService

      public LevelAccessPlatformReportingService getLevelAccessPlatformReportingService()
      Gets the instance of the Level Access Platform reporting service associated with this instance of Continuum. Please consult our support documentation for more information on how to report to Level Access Platform.
      Returns:
      the Level Access Platform reporting service associated with this instance of Continuum
    • getVault

      public com.bettercloud.vault.Vault getVault()
      Gets the instance of the Vault object that can be used to interface with the HashiCorp Vault instance specified by the VAULT_ADDR environment variable. See vault-java-driver's documentation for information on how to use this Vault object. The following environment variables defined by HashiCorp's Vault CLI are supported: VAULT_ADDR (required); VAULT_TOKEN (required); VAULT_CLIENT_TIMEOUT; VAULT_CACERT; VAULT_CLIENT_CERT; VAULT_CLIENT_KEY. Any of the required or desired environment variables above must be defined before a Continuum object is initialized if they are to be used by that Continuum object, i.e. they need to be defined before Continuum's constructor is invoked.
      Returns:
      the instance of the Vault object that can be used to interface with the HashiCorp Vault instance specified by the VAULT_ADDR environment variable; null if this interface was not initialized because the required environment variables were not defined or were invalid when Continuum's constructor was invoked
    • getPageMetadata

      public Metadata getPageMetadata() throws Exception
      Retrieves the set of metadata for the current page. This method will only work on web content.
      Returns:
      Throws:
      Exception
      IllegalStateException - If the current test context is not 'WEB'