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

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()
    }
}