android - 我可以使用 Espresso 测试状态栏色调/颜色吗?

标签 android ui-testing android-espresso

我想知道是否有一种方法可以测试在使用应用程序目标时显示的状态栏色调。我还没有找到与 Espresso 的状态栏相关的 UI 测试的任何信息。

enter image description here

最佳答案

现在这是不可能的。 Espresso 只能看到您的应用程序 View ,我的意思是它不适用于通知、共享 Intent 、状态栏等。

这是我对类似问题的回答:Espresso test for Notification to showing up

Espresso UI test framework doesn't see more than actual View. I doubt seriously that you can check any notification with Espresso.

For this purpose use another Googles testing framework uiautomator, which is described as:

UI Automator is a UI testing framework suitable for cross-app functional UI testing across system and installed apps.

在这里您可以找到如何将它与 Espresso 一起使用: http://qathread.blogspot.com/2015/05/espresso-uiautomator-perfect-tandem.html

更多信息:

另请访问: Android Testing: UIAutomator vs Espresso

检查 uiatomator 提供的方法。如果找不到它,请不要犹豫,在与它相关的 code.google.com 存储库上添加问题。

希望对您有所帮助。

关于android - 我可以使用 Espresso 测试状态栏色调/颜色吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38183251/

相关文章:

ios - iOS 应用程序启动参数字符的限制

android - Espresso Activity 堆栈

android - 如何实现对可运行线程的简单 RxJava 调用?

android - 为 android wear 检测 isRound 或 isSquare

android - 将设备作为不在 USB 供应商 ID 中的模拟器运行

android - espresso 相对于仪器测试用例的优势

android - 获取用于测试的 android View 的背景色调

android - 如何在 Flutter 中集成 Instagram 登录

ios - 在 Xcode 7 UI 测试中访问嵌套的 UIElement

node.js - 在 TestCafe 中设置环境变量给出未定义的值