開発者ハブでエスプレッソテストのモバイル結果を表示

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

必要なもの:

  • AxeDevTools ライブラリ
  • axe DevTools Mobile API キー
  • 開発者ハブプロジェクトID

開発者ハブプロジェクト

Axe Developer Hubでプロジェクトを作成すると、Developer Hubにテスト結果をプッシュするために使用する一意のプロジェクトIDが取得できます。このプロジェクトIDに加えて、結果を送信するために必要なaxe DevTools Mobile APIキーも必要です。詳しくは、 Axe DevTools Mobile APIキーを取得する方法」を学びましょう。

セットアップ

  1. をインストール axeDevTools ライブラリ
  2. 以下の例を参考にして、テストに axe を実装してください。
    • を使用してください。 startScanSession 関数
    • あなたの axe DevTools Mobile キーを <DEQUE_APIKEY> にコピー/ペーストしてください。
    • プロジェクトIDを <DEVHUB_PROJECT_ID> にコピー/ペーストしてください。
axe.startScanSession(apiKey = "<DEQUE_APIKEY>", projectId = "<DEVHUB_PROJECT_ID>")

注: 結果はAxe Devtools Mobile DashboardとAxe Developer Hubの両方に投稿されます。Mobile Dashboardは最終的にDeveloper Hubに移行されますが、移行期間中は両方の場所で結果にアクセスできます。

完全な例

class ExampleTest {

    private val axe = AxeDevTools()

    init {
        // Connect using an API key 
        axe.startScanSession(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()
    }
}