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ダッシュボードは最終的に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);