ResultsReporter
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 |
|---|
ResultsReporter(@NonNull String testName) |
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 |
Public constructors
Public methods
addNewFile
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)reportToInstrumentation
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.