[英]How to split Android Espresso tests into different APKs
I have a Espresso Android test APK with a lot of tests (about 70), and I wanted to split the tests into different APKs and then run them, separately, on Firebase Test Lab.我有一个带有大量测试(大约 70 个)的 Espresso Android 测试 APK,我想将测试拆分为不同的 APK,然后在 Firebase 测试实验室上分别运行它们。 Within the Android Studio framework, I created several Test Suites.在 Android Studio 框架中,我创建了几个测试套件。 However, when I need to generate an APK with fewer tests, I create several copies of the project and I will take tests and generate the APKs with the tests I need.但是,当我需要生成包含较少测试的 APK 时,我会创建项目的多个副本,然后进行测试并生成包含所需测试的 APK。
My question is:我的问题是:
Many thanks, xptoGirl非常感谢, xptoGirl
The easiest way doing this is with gcloud --test-targets .最简单的方法是使用gcloud --test-targets 。 This way you do not have to split up your test APK.这样您就不必拆分测试 APK。 Rather you create multiple test runs in Test Lab but with different packages, annotations or classes that you want to test.而是在测试实验室中创建多个测试运行,但使用不同的包、注释或要测试的类。
Eg to only run tests in specific sub-packages:例如,仅在特定子包中运行测试:
gcloud firebase test android run \
--app path/to/app.apk \
--test path/to/tests.apk \
--device model=walleye,version=26 \
--test-targets "package com.my.package.tests1","package com.my.package.tests2"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.