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

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 でプロジェクトを作成すると、開発者ハブへテスト結果を送るために使用するユニークなプロジェクトIDを取得します。このプロジェクトIDに加え、結果を送信するための axe DevTools Mobile API キーも必要です。「 axe DevTools Mobile API キーの取得方法」を学びましょう。

セットアップ

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

注: あなたの結果は両方の axe Devtools Mobile ダッシュボード と開発者ハブに投稿されます。モバイルダッシュボードは最終的に開発者ハブに移行しますが、その過渡期には両方の場所で結果にアクセス可能です。

完全な例

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