class ResultsReporter


Allows to report test results to Android Studio. This is helpful especially when debugging a test.

For example:

val file = resultsReporter.addNewFile("filename.jpg", "MyButton")
bitmap.saveToFile(file)

Summary

Public constructors

Public functions

File
addNewFile(filename: String, title: String)

Returns a new file to add to the test results for Android Studio.

Unit

At the end of the test execution reports to Android Studio what files need to be pulled that were previously added with addNewFile.

Public constructors

ResultsReporter

Added in 2.4.0-alpha02
ResultsReporter(testName: String)

Public functions

addNewFile

Added in 2.4.0-alpha02
fun addNewFile(filename: String, title: String): File

Returns a new file to add to the test results for Android Studio. The file will be created with the given filename and reported with the given title. In order to be recognized from android studio, the file needs to be created in instrumentationPackageMediaDir.

Usage example:

val file = resultsReporter.addNewFile("filename.jpg", "MyButton")
bitmap.saveToFile(file)
Parameters
filename: String

the name of the file to add for reporting.

title: String

a title to use when reporting to Android Studio.

Returns
File

a File for the file to report to Android Studio.

reportToInstrumentation

Added in 2.4.0-alpha02
fun reportToInstrumentation(): Unit

At the end of the test execution reports to Android Studio what files need to be pulled that were previously added with addNewFile.