API reference

Link to API reference copied to clipboard

Below you can find more information on the library's public classes and functions.

AxeDevTools

connect(params)

Generates an auth token to connect to the dashboard. Available in manual and automated testing.

Required params:

Name Type Description
username String Deque username
password String Deque password
serverConfig ConnectionConfig Defines the server to connect to. ConnectionConfig.DEFAULT_CONNECTION_CONFIG will connect you to axe-mobile.deque.com.

connect(param)

Generates an auth token to connect to the dashboard. Available in manual and automated testing.

Required param:

Name Type Description
apiKey String Deque API key
serverConfig ConnectionConfig Defines the server to connect to. ConnectionConfig.DEFAULT_CONNECTION_CONFIG will connect you to axe-mobile.deque.com.

connectLocally(param)

Generates an auth token to connect to the desktop axe DevTools Mobile client. Available in manual and automated testing.

Required param:

Name Type Description
port String Port number the dashboard is running on locally for your emulator to connect. Use 48485 unless otherwise changed.

disconnect()

Clears the current axe DevTools network session to allow a new connection to be made. Available in manual and automated testing.

setTestingConfig(param)

Registers an idling resource for the library. Available in automated testing.

Required param:

Name Type Description
config AxeDevToolsEspressoConfig Testing configuration to load.

setScanName(param)

Set a name to the scan before uploading it to the dashboard. Available in manual and automated testing.

Required param:

Name Type Description
name String Name for the scan.

tagScanAs(param)

Tags a scan before uploading it to the dashboard. Available in manual and automated testing.

Required param:

Name Type Description
tags Set<String> List of tags to add to the scan.

addCustomRule(param)

Add a rule to run against your application during scans. Available in manual and automated testing.

Required param:

Name Type Description
customRule Class<AxeDevToolsRule> Rule to add

showA11yFAB(param)

Shows the manual testing floating action button (FAB) to initiate a scan on the current view. Available in manual testing.

Required param:

Name Type Description
activity Activity Activity to add the floating action button on.

ignoreRules(param)

Ignores rules completely. Available in manual and automated testing.

Required param:

Name Type Description
rulesToIgnore List<String> List of rules to ignore.

ignoreByViewId(param)

Ignores all rules provided for a given viewId. Available in manual and automated testing.

Required param:

Name Type Description
viewIdRulesMap MutableMap<Int, MutableSet<Class<out AxeRule>>> Map of viewId's with a set of rules to ignore.

ignoreAllByViewId(param)

Ignores all rules for the provided viewIds. Available in manual and automated testing.

Required param:

Name Type Description
viewIds Set<Int> Map of viewId's to ignore all rules on.

ignoreByView(param)

Ignores all rules provided for a given View. Available in manual and automated testing.

Required param:

Name Type Description
viewList Map<View, Set<Class<out AxeRule>>> Map of View 's to ignore the provided rules on.

ignoreAllByView(param)

Ignores all rules for the provided View's. Available in manual and automated testing.

Required param:

Name Type Description
viewSet Set<View> Map of View 's to ignore all rules for.

ignoreByClassName(param)

Ignores all rules for a given type that extends View. Available in manual and automated testing.

Required param:

Name Type Description
viewClassNameRulesMap Map<Class<out View>, Set<Class<out AxeRule>>> Map of Classes to ignore the provided rules on.

ignoreAllByClassName(param)

Ignores all rules for the provided types, which extend View. Available in manual and automated testing.

Required param:

Name Type Description
classNames Set<Class<out View>> Map of Classes to ignore all rules on.

tearDown()

Resets tags, hides the floating action button, and clears test state from prior testing. Available in manual and automated testing.

scan(param)

Scans an activity's view for accessibility issues. Available in automated testing.

Required param:

Name Type Description
activity Activity Instance of the Activity to scan.

Returns:

Type Description
ScanResultHandler Nullable ScanResultHandler provides a way to get more detailed information on the result or further update the scan by providing a name or tags.

getResult(param)

Requests a scan's result from the dashboard matching the provided result key. Available in automated testing.

Required param:

Name Type Description
axeDevToolsResultKey AxeDevToolsResultKey The identifier of the result you'd like to grab.

Returns:

Type Description
AxeDevToolsResult Nullable AxeDevToolsResult provides access to details of the result.

deleteResult(param)

Delete a scan's result from the dashboard matching the provided result key. Available in automated testing.

Required param:

Name Type Description
axeDevToolsResultKey AxeDevToolsResultKey The identifier of the result you'd like to grab.

AxeDevToolsCompose

connect(params)

Generates an auth token to connect to the dashboard.

Required params:

Name Type Description
username String Deque username
password String Deque password
serverConfig ConnectionConfig Defines the server to connect to. ConnectionConfig.DEFAULT_CONNECTION_CONFIG will connect you to axe-mobile.deque.com.

connect(param)

Generates an auth token to connect to the dashboard.

Required param:

Name Type Description
apiKey String Deque API key
serverConfig ConnectionConfig Defines the server to connect to. ConnectionConfig.DEFAULT_CONNECTION_CONFIG will connect you to axe-mobile.deque.com.

connectLocally(param)

Generates an auth token to connect to the desktop axe DevTools Mobile client.

Required param:

Name Type Description
port String Port number the dashboard is running on locally for your emulator to connect. Use 48485 unless otherwise changed.

setComposeTestRule(param)

Provides test data to the library.

Required param:

Name Type
composeTestRule ComposeContentTestRule

setScanName(param)

Set a name to the scan before uploading it to the dashboard. Available in manual and automated testing.

Required param:

Name Type Description
name String Name for the scan.

tagScanAs(param)

Tags a scan prior to uploading it to the dashboard.

Required param:

Name Type Description
tags Set<String> List of tags to add to the scan.

tearDown()

Resets tags and clears test state from prior testing.

scan()

Scans the view for accessibility issues.

Returns:

Type Description
ScanResultHandler Nullable ScanResultHandler provides a way to get more detailed information on the result or further update the scan by providing a name or tags.

ScanResultHandler

uploadToDashboard()

Upload the accessibility scan's result to the dashboard.

Returns:

Type Description
AxeDevToolsResult Nullable AxeDevToolsResult provides access to details of the result.

saveResultToLocalStorage(param)

Save the accessibility scan's result to a local file on your test device.

Required param:

Name Type Description
prefixFilename String Begining of the filename to save the result as.

getSerializedResult()

Grabs the result of your scan to use within the test.