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. GitHubから サンプルプロジェクトをダウンロードします。
  3. モバイルのためのaxe DevTools用APIキーを 追加 します。 app/build.gradle
  4. これらの値を cloudURL および securityToken 内の configFile.json お使いの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統合で使用される3つのファイルがあります: app/build.gradleconfigFile.json、および build.gradleです。

あなたの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 セキュリティ トークンを反映するべきです。

役立つリンク: