Appiumテスト結果を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

必要なもの:

  • Axe DevTools Mobile Appiumドライバー
  • Axe DevTools Mobile APIキー
  • Developer HubプロジェクトID

Developer Hubプロジェクト

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

セットアップ

  1. Axe DevTools Mobile Appiumドライバーをインストールする
  2. 以下の例を参考にして、テストにAxeを実装してください。
    • Axe DevTools Mobileキーを<DEQUE_APIKEY>にコピー/貼り付けします。
    • プロジェクトIDを<DEVHUB_PROJECT_ID>にコピー/ペーストしてください。

注意: 結果はAxe DevTools Mobile ダッシュボードとAxe Developer Hubの両方に投稿されます。Mobile Dashboardは最終的にはAxe Developer Hubに移行される予定ですが、移行期間中は両方の場所で結果にアクセスできます。

Appium: JavaScriptの例

const {remote} = require('webdriverio');

const wdOpts = {
      hostname: process.env.APPIUM_HOST || 'localhost',
  port: parseInt(process.env.APPIUM_PORT, 10) || 4723,
  logLevel: 'info',
  capabilities: {
        // refer to JavaScript examples for WebdriverIO desired capabilities options with UIAutomator2 and XCUITest 
        // https://docs.deque.com/devtools-mobile/2025.7.2/en/appium-example-javascript
  }
}

async function runAccessibilityScan() {
  const driver = await remote(wdOpts);
  try {
    const settings = { apiKey: '<DEQUE_APIKEY>' }
    settings['projectId'] = '<DEVHUB_PROJECT_ID>'
    const result = await driver.execute('mobile: axeScan', settings)
  } finally {
    await driver.pause(1000);
    await driver.deleteSession();
  }
}

runAccessibilityScan().catch(console.error);