public final 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 methods

final @NonNull File
addNewFile(@NonNull String filename, @NonNull String title)

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

final void

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
public ResultsReporter(@NonNull String testName)

Public methods

addNewFile

Added in 2.4.0-alpha02
public final @NonNull File addNewFile(@NonNull String filename, @NonNull String title)

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
@NonNull String filename

the name of the file to add for reporting.

@NonNull String title

a title to use when reporting to Android Studio.

Returns
@NonNull File

a File for the file to report to Android Studio.

reportToInstrumentation

Added in 2.4.0-alpha02
public final void reportToInstrumentation()

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