Espressoを用いたPerfectoの例

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

PerfectoのデバイスであなたのAndroidアプリのアクセシビリティ問題をテストします。

Not for use with personal data

PerfectoでUIテストを実行し、デバイス全体でアプリのアクセシビリティの状態を包括的に理解しましょう。

必要要件:

  • Perfecto エンタープライズ プライベート クラウド

前提条件

あなたのUIテストは、Android向けAxe DevTools Mobileと統合されています。必要に応じて入門ガイドをご覧ください。

プロジェクト例

例をお探しですか?私たちのサンプルAndroidプロジェクトにはテスト準備が整った統合があります。

  1. 前提条件を満たしていることを確認してください。
  2. サンプルプロジェクトをダウンロードをダウンロードしてください。
  3. Axe DevTools for Mobile APIキーapp/build.gradleに追加してください。
  4. configFile.jsoncloudURLsecurityTokenの値をあなたのPerfectoクラウドに合わせて調整してください。
{
  "cloudURL": "<<perfecto-cloud-name>>",
  "securityToken": "<<security-token>>",
  ...
}
  1. セキュリティトークンを環境変数(SECURITY_TOKEN)として追加するか、次のコマンドの最後に付けてください。
  2. 端末でPerfectoのテストを実行してください: ./gradlew perfecto-android-inst -PconfigFileLocation=configFile.json -PcloudURL=demo.perfectomobile.com -PsecurityToken=$SECURITY_TOKEN

Perfecto統合に使用されるサンプルプロジェクトには、app/build.gradleconfigFile.jsonbuild.gradleの3つのファイルがあります。

あなたのEspressoテストにPerfectoを追加

設定

  1. プロジェクトのbuild.gradleファイルに以下を追加してください:

repositories {
  ...
  maven { url "https://repo1.perfectomobile.com/public/repositories/maven" }
  ...
}

dependencies {
  ...
  classpath 'com.perfectomobile.instrumentedtest.gradleplugin:plugin:+'
  ...
}
  1. app/build.gradleに以下を追加してください:
plugins {
  ...
  id 'com.perfectomobile.instrumentedtest.gradleplugin'
  ...
}
  1. Perfectoの構成JSONを追加し、Perfectoの認証情報とアプリケーションに一致するように次の値を確認します:
    • cloudURL
    • securityToken
    • apkPath
    • testApkPath
{
  "cloudURL": "<<cloud name>>",
  "securityToken": "<<security-token>>",
  "numOfDevices": 2,
  "jobName": "Espresso_Axe_Sample",
  "jobNumber": 1,
  "branch": "some_branch",
  "projectName": "My_Espresso_project",
  "projectVersion": "v1.0",
  "tags": [
    "espresso",
    "plugin"
  ],
  "apkPath": "app/build/outputs/apk/debug/app-debug.apk",
  "testApkPath": "app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk",
  "installationDetails": {
    "preCleanUp": "true"
  },
  "postExecution": {
    "uninstall": "false"
  },
  "debug": false,
  "failBuildOnFailure": true,
  "takeScreenshotOnTestFailure": true,
  "shard": true,
  "testTimeout": 60000
}

実行

プロジェクトのセットアップが完了したら、ターミナルからPerfectoでテストを実行します:

./gradlew perfecto-android-inst -PconfigFileLocation=configFile.json -PcloudURL=demo.perfectomobile.com -PsecurityToken=$SECURITY_TOKEN
note

cloudURLの値はあなたのPerfectoクラウドURLを反映する必要があり、securityTokenはあなたのPerfecto セキュリティ トークンを反映する必要があります。

役立つリンク: