我使用fastlanes screengrab来捕获应用的截图。 screengrab正在利用orroids ui测试框架浓缩咖啡来浏览应用程序。如果我的一个ui测试失败,我希望其他测试继续捕获屏幕截图,但同时我希望收到有关测试失败的通知。
为防止测试失败并停止整个程序,我用try / catch
包围了所有测试。当测试失败时,我希望将异常记录到screengrab输出:
[10:24:37]: Running tests for locale: bs-BA
[10:24:37]: $ adb -s emulator-5554 shell am instrument --no-window-animation -w \
-e testLocale bs_BA \
-e endingLocale en_US \
-e class my.app.tests.MainLocationScreenshots \
-e isScreengrab true \
my.app.test/my.app.runners.RxTestRunner
[10:24:40]: ▸ my.app.tests.MainLocationScreenshots:
[10:24:41]: ▸ my.app.tests.MainLocationScreenshots:....
[10:25:37]: ▸ Time: 42.311
[10:25:37]: ▸ OK (7 tests)
我尝试了以下但没有成功:
Log.d("", "Can you read this?????????")
Log.d("Screengrab", "Can you read this?")
Log.println(Log.ERROR,"Screengrab","What about this?")
System.out.print("But I bet this works")
所有Log
次调用都显示在Logcat中,但不出现在screengrab输出中,System.out.print
也没有出现在其中。
有没有办法记录screengrab输出?它是否记录在某个我没看过的地方?
谢谢!