[英]Is it possible to run android espresso ui tests from the terminal on multiple devices one after another?
I'm trying to run my ui tests on at least 2 phones but it can't be simultaneously, they have to run after each other.我正在尝试在至少 2 部手机上运行我的 ui 测试,但不能同时运行,它们必须相互运行。 So when Phone 1 has completed the test run, Phone 2 begin its test run.
因此,当电话 1 完成测试运行时,电话 2 开始其测试运行。
I'm looking for a command similar to ./gradlew cAT
but not simultaneously.我正在寻找类似于
./gradlew cAT
但不是同时的命令。 An alternative would be to specify which phone the tests should run on.另一种方法是指定测试应该在哪部手机上运行。 The reason is I need to be able to run the tests through GitLab CI.
原因是我需要能够通过 GitLab CI 运行测试。
Is it possible to do this from the terminal?是否可以从终端执行此操作?
The easiest way to do this would likely be to create a script that calls your gradle task with each specific device serial set beforehand.执行此操作的最简单方法可能是创建一个脚本,该脚本预先使用每个特定设备序列集调用您的 gradle 任务。 This is theoretical, but should work.
这是理论上的,但应该有效。
ANDROID_SERIAL=<firstDeviceSerial> ./gradlew <yourCommand>
ANDROID_SERIAL=<secondDeviceSerial> ./gradlew <yourCommand>
They introduced the notion of pools of devices.他们引入了设备池的概念。 These are now responsible for running a test suite instead of each device running the suite separately.
这些现在负责运行测试套件,而不是每个设备单独运行套件。 That has two side effects:
这有两个副作用:
A few similar tools:几个类似的工具:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.