API reference
Information on the library's public classes and functions.
AxeDevTools
connect(params)
Generates an auth token to connect to the dashboard.
Required params
:
Name | Type | Description |
---|---|---|
username | String |
Deque username |
password | String |
Deque password |
Optional param
:
Name | Type | Description |
---|---|---|
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 |
Optional param
:
Name | Type | Description |
---|---|---|
serverConfig | ConnectionConfig |
Defines the server to connect to. ConnectionConfig.DEFAULT_CONNECTION_CONFIG will connect you to axe-mobile.deque.com . |
setInstrumentation(param)
Allows the library to grab the view hierarchy of the application under test.
Required param
:
Name | Type | Description |
---|---|---|
instrumentation | String |
Instrumentation Registry Object providing application context and instrumentation. |
disconnect()
Clears the current axe DevTools network session to allow a new connection to be made.
isUserAuthenticated()
Returns a boolean to indicate whether the user is authenticated and ready to send scans.
Returns:
Type | Description |
---|---|
Boolean | Indicates whether a user is authenticated for axe DevTools Mobile. |
setTestingConfig(param)
Registers an idling resource for the library.
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.
Required param
:
Name | Type | Description |
---|---|---|
name | String |
Name for the scan. |
tagScanAs(param)
Tags a scan before uploading it to the dashboard.
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.
Required param
:
Name | Type | Description |
---|---|---|
customRule | Class<AxeDevToolsRule> |
Rule to add |
resetIgnoredRules()
Clear the ignored Rules list set by the ignored rules APIs. Helpful for changing rule configuration between automated tests.
ignoreRules(param)
Ignores rules completely from being run against any view.
Required param
:
Name | Type | Description |
---|---|---|
rulesToIgnore | List<String> |
List of rules to ignore. |
ignoreByViewId(param)
Ignores all rules provided for a given viewId.
Required param
:
Name | Type | Description |
---|---|---|
viewId | Int |
ViewId to ignore. |
ruleList | List<Class<out AxeRule>> |
List of rules to ignore. |
ignoreAllByViewId(param)
Ignores all rules for the provided viewIds.
Required param
:
Name | Type | Description |
---|---|---|
viewIds | List<Int> |
List of viewIds to ignore all rules on. |
ignoreByView(param)
Ignores all rules provided for a given View
.
Required param
:
Name | Type | Description |
---|---|---|
view | View |
An instance of a view to ignore. |
ruleList | List<Class<out AxeRule>> |
List of rules to ignore. |
ignoreAllByView(param)
Ignores all rules for the provided View
's.
Required param
:
Name | Type | Description |
---|---|---|
viewIds | List<View> |
List of View to ignore all rules for. |
ignoreByClassName(param)
Ignores all rules for a given type that extends View.
Required param
:
Name | Type | Description |
---|---|---|
view | Class<out View> |
Class to ignore. |
ruleList | List<Class<out AxeRule>> |
List of rules to ignore. |
ignoreAllByClassName(param)
Ignores all rules for the provided types, which extend View.
Required param
:
Name | Type | Description |
---|---|---|
classNames | List<Class<out View>> |
List of Class es to ignore all rules on. |
tearDown()
Resets tags, hides the floating action button and clears test state from prior testing.
scan(param)
Scans an activity's view for accessibility issues.
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. |
scan(param)
Scans the provided dialog for accessibility issues and returns a callback.
Required param
:
Name | Type | Description |
---|---|---|
dialog | Dialog |
Instance of the Dialog to scan. |
scanCallback | DialogScanCallback |
Provides aScanResultHandler after the dialog has inflated and the scan has completed. |
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.
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.
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 . |
disconnect()
Clears the current axe DevTools network session to allow a new connection to be made.
isUserAuthenticated()
Returns a boolean to indicate whether the user is authenticated and ready to send scans.
Returns:
Type | Description |
---|---|
Boolean | Indicates whether a user is authenticated for axe DevTools Mobile. |
setComposeTestRule(param)
Provides test data to the library.
Required param
:
Name | Type |
---|---|
composeTestRule | ComposeContentTestRule |
setEmptyComposeTestRule(params)
This API helps when your test set up is using Compose Empty Test Rule with an Activity to run UI tests in Compose. The activity will be passed in to provide more information to the library such as: title of the screen, package name, etc. View a full example using this API.
Required param
:
Name | Type |
---|---|
composeEmptyTestRule | ComposeTestRule |
activity | Activity |
ComposeTestRule is apart of androidx.compose.ui.test.junit4
. Read more on ComposeTestRule.
setScanName(param)
Set a name to the scan before uploading it to the dashboard.
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. |
addCustomRule(param)
Add a rule to run against your application during scans.
Required param
:
Name | Type | Description |
---|---|---|
customRule | Class<AxeDevToolsComposeRule> |
Rule to add |
resetIgnoredRules()
Clear the ignored Rules list set by the ignored rules APIs. Helpful for changing rule configuration between automated tests.
ignoreRules(param)
Ignores rules completely from being run against any view.
Required param
:
Name | Type | Description |
---|---|---|
rulesToIgnore | List<String> |
List of rules to ignore. |
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. |
getResult(param)
Requests a scan's result from the dashboard matching the provided result key.
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.
Required param
:
Name | Type | Description |
---|---|---|
axeDevToolsResultKey | AxeDevToolsResultKey |
The identifier of the result you'd like to grab. |
ScanResultHandler
uploadToDashboard(param)
Upload the accessibility scan's result to the dashboard. By default, the full result object is returned.
Optional param
:
Name | Type | Description |
---|---|---|
uploadOnly | Boolean |
Optional, default is false. When set to true, the result is uploaded to the dashboard and the result key is only available within the AxeDevToolsResult object. |
Returns:
Type | Description |
---|---|
AxeDevToolsResult | Nullable AxeDevToolsResult provides access to details of the result. |
saveResultToLocalStorage(param)
Save the accessibility scan result to a local file on your test device.
Required param
:
Name | Type | Description |
---|---|---|
prefixFilename | String |
Beginning of the filename to save the result as. |
getSerializedResult()
Grabs the result of your scan to use within the test.