Firebase - 如何 运行 一个特定的 Android UI 测试 class 与将 运行 在 firebase 测试实验室上的命令行?

Firebase - How to run a specifc Android UI test class with command line that will run on firebase test labs?

我正在尝试通过命令行在 firebase 测试实验室中 运行 进行一项特定的浓缩咖啡测试 class。当我尝试 运行 下面的命令时,androidTest 目录中的所有测试 class 都会被执行。

gcloud firebase test android run \
  --type instrumentation \
  --app app-fred-stage-debug.apk \
  --test app-fred-stage-debug-androidTest.apk \
  --device model=Nexus6,version=21,locale=en,orientation=portrait

如何指定 class 我想在 Firebase 测试实验室 运行 进行的一项测试?

TIA

documentation 建议您可以使用 --test-targets 标志来 运行 单个测试:

For example, you can use the --test-targets flag to test just one class used by your test APK, or to test just one method from a class used by your test APK. To learn more, see gcloud firebase test android run.

将您链接到 gcloud firebase test 的文档,其中向您展示了如何指定特定测试的选项。

将以下内容添加到您的命令行:

--test-targets "class com.foo.ClassName" \ 

在此处查看更多内容:https://cloud.google.com/sdk/gcloud/reference/firebase/test/android/run#--test-targets

如果您有多个测试 类 想要 运行,您可以一次全部通过,用逗号分隔。

--test-targets "class com.org.TestFoo,class com.org.TestBar" \

您可以阅读解释此内容的 SO 答案