如何在构建 Android 应用程序时执行 UI Automator 集成测试
我已经在我的应用程序中集成了 UI Automator,并且在 Android Studio 中我可以执行 ExampleInstrumentedTest.kt 并执行其中的测试。
当我使用 gradlew 构建应用程序时,我会知道如何执行这些测试,而不仅仅是在运行测试类时。
我已经尝试过这些解决方案:
- gradlew
- gradlew test
- gradlew assembleDebug
但我注意到这些测试没有执行。
另外我想问是否有可能,如果某些测试未通过,构建会失败,或者我无法将测试执行的分支合并到主存储库中。
多谢
I have integrated UI Automator on my app, and in Android Studio I can execute the ExampleInstrumentedTest.kt and the test inside of it are executed.
I would know how can I execute these tests when I build the app with gradlew and not only when I run the test class.
I've tried these solutions:
- gradlew
- gradlew test
- gradlew assembleDebug
But I'm noticing these tests are not executed.
Also I would ask if it's possible that, if some tests are not passed, the build fails or I can't merge the branch the tests are executed into the master repository.
Thanks a lot
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你需要使用浓缩咖啡
测试单个应用的 UI
Espresso 代码示例
Espresso 代码示例
You need to use Espresso
Test the UI of a single app
Espresso code example
Espresso code example