DiagnosticsOnFailureRule

class DiagnosticsOnFailureRule(val directory: File = defaultDirectory()) : TestWatcher(source)

Saves a screenshot and the window hierarchy when a test fails, so a CI failure shows what was on screen.

Files are written to <directory>/<TestClass>/<testMethod>.png and .xml. The default directory is in the instrumentation app's external files, which adb pull can read. Capturing never masks the test's own failure.

@get:Rule val diagnostics = DiagnosticsOnFailureRule()

Constructors

Link copied to clipboard
constructor(directory: File = defaultDirectory())

Properties

Link copied to clipboard

Where to write diagnostics.

Functions

Link copied to clipboard
open fun apply(base: Statement?, description: Description?): Statement?