Package com.levelaccess.continuum
Class Continuum
java.lang.Object
com.levelaccess.continuum.Continuum
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.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
static enum
Defines the type of mobile testing environment, i.e.static enum
Defines the type of testing environment, i.e. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGets the list of accessibility concerns found by Access Engine during the last test execution.Gets a pretty-printed String of accessibility concerns found by Access Engine during the last test execution.Gets the instance of the AMP reporting service associated with this instance of Continuum.getAssertionsPrettyPrinted
(List<Assertion> assertions) boolean
Gets whether or not accessibility concerns that require manual review are included in any of Continuum's test results.Gets the instance of the Level Access Platform reporting service associated with this instance of Continuum.Retrieves the set of metadata for the current page.boolean
Gets whether or not Continuum should scan for accessibility concerns in the content of any visible web views.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 invokesetUp(WebDriver)
orsetUp(WebDriver, TestContext)
.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 invokesetUp(WebDriver)
orsetUp(WebDriver, TestContext)
.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 invokesetUp(WebDriver)
orsetUp(WebDriver, TestContext)
.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.Harvests and returns the links from the current page that are found in <a> tags.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).Runs all automatic Access Engine tests against the current page, as defined by the web driver used previously to invokesetUp(WebDriver)
orsetUp(WebDriver, TestContext)
.runAllTests
(boolean includeIframeContent) runAllTests
(boolean includeIframeContent, List<String> xpathExclusions, Filter filter) runAllTests
(List<String> xpathExclusions) runAllTestsForAssertions
(boolean includeIframeContent) runAllTestsForAssertions
(boolean includeIframeContent, Filter filter) 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 invokesetUp(WebDriver)
orsetUp(WebDriver, TestContext)
and the specified CSS (if testing a website) or Appium XPath selector (if testing a mobile app).runAllTestsOnNode
(String selectorForNodeToTest, boolean includeIframeContent) runAllTestsOnNode
(String selectorForNodeToTest, boolean includeIframeContent, List<String> xpathExclusions, Filter filter) runAllTestsOnNode
(String selectorForNodeToTest, List<String> xpathExclusions) Runs only the specified automatic Access Engine tests against the current page, as defined by the web driver used previously to invokesetUp(WebDriver)
orsetUp(WebDriver, TestContext)
and, for specific test IDs, AMP.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 invokesetUp(WebDriver)
orsetUp(WebDriver, TestContext)
and, for specific test IDs, AMP.void
setIncludePotentialAccessibilityConcerns
(boolean includePotentialAccessibilityConcerns) Globally sets whether or not accessibility concerns that require manual review are included in any of Continuum's test results.void
setScanWebViews
(boolean scanWebViews) Globally sets whether or not Continuum scans for accessibility concerns in the content of any visible web views.void
setUp
(org.openqa.selenium.WebDriver webDriver) Sets up Continuum for web testing.void
setUp
(org.openqa.selenium.WebDriver webDriver, Continuum.TestContext context) Sets up Continuum for web or mobile testing.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 invokesetUp(WebDriver)
orsetUp(WebDriver, TestContext)
and, for specific best practice IDs, AMP.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 invokesetUp(WebDriver)
orsetUp(WebDriver, TestContext)
.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 invokesetUp(WebDriver)
orsetUp(WebDriver, TestContext)
.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 invokesetUp(WebDriver)
orsetUp(WebDriver, TestContext)
and, for specific accessibility standard IDs, AMP.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 invokesetUp(WebDriver)
orsetUp(WebDriver, TestContext)
.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 invokesetUp(WebDriver)
orsetUp(WebDriver, TestContext)
and, for specific best practice IDs, AMP.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 invokesetUp(WebDriver)
orsetUp(WebDriver, TestContext)
.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 invokesetUp(WebDriver)
orsetUp(WebDriver, TestContext)
.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 invokesetUp(WebDriver)
orsetUp(WebDriver, TestContext)
and, for specific accessibility standard IDs, AMP.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 invokesetUp(WebDriver)
orsetUp(WebDriver, TestContext)
.
-
Constructor Details
-
Continuum
- 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, usesetUp(WebDriver, TestContext)
instead.- Parameters:
webDriver
- a Selenium web driver to test with
-
setUp
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 withcontext
- the test context, i.e. either web or mobile
-
runAllTests
Runs all automatic Access Engine tests against the current page, as defined by the web driver used previously to invokesetUp(WebDriver)
orsetUp(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
-
runAllTests
-
runAllTests
public List<AccessibilityConcern> runAllTests(boolean includeIframeContent, List<String> xpathExclusions, Filter filter) -
runAllTestsForAssertions
-
runAllTestsForAssertions
-
runAllTestsForAssertions
-
testForStandards
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 invokesetUp(WebDriver)
orsetUp(WebDriver, TestContext)
and, for specific accessibility standard IDs, AMP. Note that the IDs of the specified accessibility standards must also be specified byConfiguration.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 (invokegetSupportedStandards()
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
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 invokesetUp(WebDriver)
orsetUp(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 (invokegetSupportedBestPractices()
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
Runs only the specified automatic Access Engine tests against the current page, as defined by the web driver used previously to invokesetUp(WebDriver)
orsetUp(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 (invokegetSupportedTests()
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
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 invokesetUp(WebDriver)
orsetUp(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
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 invokesetUp(WebDriver)
orsetUp(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
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 invokesetUp(WebDriver)
orsetUp(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
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 invokesetUp(WebDriver)
orsetUp(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
-
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 invokesetUp(WebDriver)
orsetUp(WebDriver, TestContext)
and, for specific accessibility standard IDs, AMP. Note that the IDs of the specified accessibility standards must also be specified byConfiguration.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 (invokegetSupportedStandards()
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 invokesetUp(WebDriver)
orsetUp(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 (invokegetSupportedBestPractices()
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 invokesetUp(WebDriver)
orsetUp(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 (invokegetSupportedTests()
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 invokesetUp(WebDriver)
orsetUp(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 noticeableselectorForNodeToTest
- 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 invokesetUp(WebDriver)
orsetUp(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 noticeableselectorForNodeToTest
- 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 invokesetUp(WebDriver)
orsetUp(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 noticeableselectorForNodeToTest
- 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
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
-
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
-
getAssertionsPrettyPrinted
-
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 invokesetUp(WebDriver)
orsetUp(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
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 invokesetUp(WebDriver)
orsetUp(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
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 invokesetUp(WebDriver)
orsetUp(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 haveAccessibilityConcern.getNeedsReview()
return true. By default, this is specified byConfiguration.getIncludePotentialAccessibilityConcerns()
, i.e. the value for the 'includePotentialAccessibilityConcerns' attribute defined in continuum.json. This setting can be toggled programmatically usingsetIncludePotentialAccessibilityConcerns(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
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 haveAccessibilityConcern.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 haveAccessibilityConcern.getTestContext()
returnContinuum.TestContext.WEB
. This setting is only applicable to mobile app testing, i.e. whensetUp(WebDriver, TestContext)
is invoked withContinuum.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 byConfiguration.Mobile.getScanWebViews()
()}, i.e. the value for the 'scanWebViews' attribute of the 'mobile' object defined in continuum.json. This setting can be toggled programmatically usingsetScanWebViews(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 haveAccessibilityConcern.getTestContext()
returnContinuum.TestContext.WEB
. This setting is only applicable to mobile app testing, i.e. whensetUp(WebDriver, TestContext)
is invoked withContinuum.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
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
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
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'
-