Bekijk Mobiele Resultaten voor Espresso Testing in Developer Hub
Not for use with personal data
Vereist:
AxeDevToolsBibliotheek- axe DevTools Mobile API-sleutel
- Developer Hub Project-ID
Developer Hub Projecten
Wanneer je een project aanmaakt in axe Developer Hub, krijg je een unieke Project-ID die je gebruikt om testresultaten naar Developer Hub te sturen. Naast deze project-ID heb je ook een axe DevTools Mobile API-sleutel nodig om resultaten te verzenden. Leer hoe je een axe DevTools Mobile API-sleutel verkrijgt.
Instellen
- Installeer de
axeDevToolsbibliotheek - Gebruik het onderstaande voorbeeld als referentie om axe in jouw tests te implementeren.
- Gebruik de
startSessionfunctie - Kopieer/plak je axe DevTools Mobile-sleutel in <DEQUE_APIKEY>.
- Kopieer/plak de Project-ID in <DEVHUB_PROJECT_ID>.
- Gebruik de
axe.startSession(apiKey = "<DEQUE_APIKEY>", projectId = "<DEVHUB_PROJECT_ID>")
Opmerking: Jouw resultaten worden gepost naar zowel het axe DevTools Mobile Dashboard als Developer Hub. Het Mobile Dashboard zal uiteindelijk worden uitgefaseerd ten gunste van Developer Hub, maar tijdens de overgangsfase kun je je resultaten op beide plekken benaderen.
Volledig Voorbeeld
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()
}
}