Henning
Henning

Reputation: 2560

How to log to the fastlane screengrab output

I am using fastlanes screengrab to capture screenshots of an app. screengrab is utilizing androids ui testing framework espresso to navigate through the app. if one of my ui tests fails I want the other tests to continue capturing screenshots but at the same time I want to be notified about the failed test.

To prevent the test to fail and stopping the whole program I surrounded all my tests with try / catch. When a test fails I want the the exception to be logged to the screengrab output:

[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)  

I tried the following without success:

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")

All the Log calls appear in Logcat but not in the screengrab output, the System.out.print does not appear in either.

Is there a way to log the the screengrab output? Is it documented somewhere I haven't looked?

Thanks!

Upvotes: 3

Views: 495

Answers (0)

Related Questions