最佳答案
现在这是不可能的。 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
更多信息:
检查 uiatomator
提供的方法。如果找不到它,请不要犹豫,在与它相关的 code.google.com 存储库上添加问题。
希望对您有所帮助。
关于android - 我可以使用 Espresso 测试状态栏色调/颜色吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38183251/