【问题标题】:Does AWS Device Farm support Android Orchestrator?AWS Device Farm 是否支持 Android Orchestrator?
【发布时间】:2019-05-23 12:27:56
【问题描述】:

我能否将 Android Orchestrator .apk 作为第三个 apk(连同主应用 apk 和测试套件 apk)上传到 AWS Device Farm?或者应用程序状态在 Device Farm 中不是持久的,因此它根本不需要外部 Orchestrator?

目前我们使用本地运行器进行 Android Espresso 测试。一些测试需要在测试之间清除应用程序状态/数据,以便我们使用 Orchestrator。根据控制台,它作为单独的 apk 上传到设备。 AWS Device Farm 只允许上传 2 个 apk:应用程序本身和一个测试套件。

那么,我如何在 AWS Device Farm 中使用 Orchestrator 进行测试以在每次测试后清除应用程序状态/数据?

【问题讨论】:

    标签: android-espresso aws-device-farm


    【解决方案1】:

    您可以在使用 AWS Device Farm 时将 Orchestrator 作为辅助应用程序发送。

    如果您使用的是控制台,这将在Install other apps 下的Specify device state 步骤中完成

    如果您使用 CLI,请使用辅助应用程序标志 https://docs.aws.amazon.com/cli/latest/reference/devicefarm/schedule-run.html

    【讨论】:

    • 有人可以确认它是否有效吗?我认为这不像上传文件那么简单,因为在使用 Test Orchstrator 开始测试时使用了不同的运行器。在 AS 中启动时,您可以在控制台日志中看到:$ adb shell CLASSPATH=$(pm path androidx.test.services) app_process / androidx.test.services.shellexecutor.ShellMain am instrument -r -w -e targetInstrumentation com.myapp.test/myapp.test.MyAndroidJUnitRunner -e clearPackageData true --no-window-animation -e debug false androidx.test.orchestrator/androidx.test.orchestrator.AndroidTestOrchestrator
    【解决方案2】:

    简短回答:上传编排器似乎可行,但您不需要它来让测试在单独的进程中运行。

    长答案:正如斯科特的回答所说,您可以将协调器上传并安装到设备上。您还应该上传 android 测试服务 apk(例如 test-services-1.4.0-alpha05.apk)

    Piotr 的评论也是正确的。如果你想使用编排器,你应该为这样的测试指定你自己的启动命令: "adb shell "CLASSPATH=$(pm path androidx.test.services) exec app_process / androidx.test.services.shellexecutor.ShellMain am instrument ...”。这可以通过使用设备场的启动测试向导中的自定义环境选项来完成。更多信息可以在这里找到:https://developer.android.com/training/testing/junit-runner#using-android-test-orchestrator

    如果您想单独运行测试,只需使用默认环境选项,因为它似乎默认隔离了 aws 场中的测试。无需使用编排器。只有当您想使用自己的自定义测试运行程序或使用需要传递给测试的自定义参数时,才需要 Orchestrator。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-05-25
      • 2017-08-20
      • 1970-01-01
      • 2017-06-26
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多