我在用
androidTestCompile 'com.android.support.test:runner:0.3'
androidTestCompile 'com.android.support.test:rules:0.3'
androidTestCompile 'com.android.support:support-annotations:23.0.1'
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2'
androidTestCompile('com.android.support.test.espresso:espresso-contrib:2.2') {
// this library uses the newest app compat v22 but the espresso contrib still v21.
// you have to specifically exclude the older versions of the contrib library or
// there will be some conflicts
exclude group: 'com.android.support', module: 'appcompat'
exclude group: 'com.android.support', module: 'support-v4'
exclude module: 'recyclerview-v7'
}
androidTestCompile 'junit:junit:4.12'
用于测试,想知道是否有办法让 espresso 打印包含开始测试和完成测试的日志,以便在发生某些事情时很容易看到 logcat。
与 papertrail 结合使用以检查测试失败的原因以及使用私有(private)集成服务器的位置会很棒。
最佳答案
您可以通过 Spoon 在 CI 服务器上运行测试来捕获 Android 日志.在他们的网站上查看操作示例,并查看下面的链接以获取示例报告,然后查看其中一项测试的日志。每次测试运行都会捕获日志并保存在报告中。
关于Android 测试 - 如何添加 Espresso 日志,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32506290/