View Mobile Results for Espresso Testing in Developer Hub

This page is not available in the language you requested. You have been redirected to the English version of the page.
Link to this page copied to clipboard
Not for use with personal data

Requires:

  • AxeDevTools Library
  • axe DevTools Mobile API Key
  • Developer Hub Project ID

Developer Hub Projects

When you create a project in axe Developer Hub, you will get a unique Project ID that you'll use to push test results to Developer Hub. In addition to this project ID, you will also need an axe DevTools Mobile API Key to send results. Learn how to Get an axe DevTools Mobile API Key.

Setup

  1. Install the axeDevTools library
  2. Use the example below as a reference to implement axe in your tests.
    • Use the startSession function
    • Copy/paste your axe DevTools Mobile key into <DEQUE_APIKEY>.
    • Copy/paste the Project ID into <DEVHUB_PROJECT_ID>.
axe.startSession(apiKey = "<DEQUE_APIKEY>", projectId = "<DEVHUB_PROJECT_ID>")

Note: Your results will be posted to both the axe Devtools Mobile Dashboard and axe Developer Hub. The Mobile Dashboard will eventually be retired in favor of Developer Hub, but during the transition, you can access your results in both places.

Full Example

class ExampleTest {

    private val axe = AxeDevTools()

    init {
        // Connect using an API key 
        axe.startSession(apiKey = "DEQUE_API_KEY", projectId = "<DEVHUB_PROJECT_ID>")
    }

    @Before
    fun setup() {
        // Pass the information registry to axe DevTools
        axe.setInstrumentation(InstrumentationRegistry.getInstrumentation())

        // Optional: Add tags or utilize other customization features here
        axe.tagScanAs(setOf("Team A"))
    }

    @Test
    fun foobar() {
        // Scan the app for accessibility issues and upload to the dashboard
        axe.scan()?.uploadToDashboard()
        axe.tearDown()
    }
}