TestReport class Null safety

Represents a report from a test run.

Inheritance

Constructors

TestReport({TestDeviceInfo? deviceInfo, String? id, String? name, String? suiteName, required int version})

Properties

deviceInfo TestDeviceInfo?
Information about the app and device the test is executing on.
final
endTime DateTime?
The date time the test was completed.
read-only
errorSteps int
The number of steps that encountered an error and failed.
read-only
exceptionStream Stream<String>?
Returns the exception stream for the report. This will return null if the report has already been completed. Listeners will be notified whenever an exception happens within the testing framework itself.
read-only
hashCode int
The hash code for this object. [...]
read-only, inherited
id String
The unique identifier for the report. If not specifically set then this will be an auto-generated UUID.
final
images List<TestImage>
Returns the list of images that were screen captured via the test.
read-only
imageStream Stream<TestImage>?
Returns the image stream for the report. This will return null if the report has already been completed. Listeners will be notified whenever an image is added to the report.
read-only
logs List<String>
Returns the list of log entires from the report.
read-only
logStream Stream<String>?
Returns the logging stream for the report. This will return null if the report has already been completed. Listeners will be notified whenever a log entry is added to the report.
read-only
name String?
The name of the test
final
onComplete Future<TestReport>
Returns the Future that will return when the test report has completed.
read-only
passedSteps int
The number of steps that had no errors and successfully passed.
read-only
runtimeException String?
Returns the runtime exception that aborted the test. This will only be populated if the framework itself encountered a fatal issue (such as a malformed JSON body for a test step). If this is populated, a developer should investigate because this is not a typical error that would be expected due to failed test runs.
read-only
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
startTime DateTime?
The date time the test started.
final
steps List<TestReportStep>
Returns the list of test steps in an unmodifiable List.
read-only
stepStream Stream<TestReportStep>?
Returns the test step stream for the report. This will return null if the report has already been completed. Listeners will be notified with every completed test step.
read-only
success bool
Returns an overall status for the report. This will return true if, and only if, there were no errors encountered within the test. If any errors exist, be it step specific or test-wide, this will return false.
read-only
suiteName String?
The test suite for the report.
final
version int
The version of the test
final

Methods

appendLog(String log) → void
Appends the log entry to the test report.
attachScreenshot(Uint8List screenshot, {required bool goldenCompatible, required String id}) → void
Attaches the given screenshot to the test report.
complete() → void
Completes the test and locks in the end time to now.
endStep(TestStep step, [String? error]) → void
Ends the given step with the optional error. If the error is null then the step is considered successful. If there is an error value then the step is considered a failure.
exception(String message, dynamic e, StackTrace stack) → void
Informs the report that an excetion happened w/in the framework itself. This is likely a non-recoverable error and should be investigated. [...]
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
startStep(TestStep step, {bool subStep = true}) → void
Starts a step within the report.
toJson([dynamic includeImageData = false]) Map<String, dynamic>
Abstract function that concrete classes must implement. This must encode the internal data model to a JSON compatible representation. [...]
override
toString() String
Returns the string encoded JSON representation for this class. This will remove all null values and empty collections from the returned string.
inherited

Operators

operator ==(Object other) bool
The equality operator. [...]
inherited

Static Methods

fromDynamic(dynamic map, {String? id}) TestReport