TestReport class
Represents a report from a test run.
Constructors
- TestReport.new({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.
no setter
- errorSteps → int
-
The number of steps that encountered an error and failed.
no setter
-
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.no setter - hashCode → int
-
The hash code for this object.
no setterinherited
- 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.
no setter
-
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.no setter -
logs
→ List<
String> -
Returns the list of log entires from the report.
no setter
-
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.no setter - name → String?
-
The name of the test
final
-
onComplete
→ Future<
TestReport> -
Returns the Future that will return when the test report has completed.
no setter
- passedSteps → int
-
The number of steps that had no errors and successfully passed.
no setter
- 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.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- startTime → DateTime?
-
The date time the test started.
final
-
steps
→ List<
TestReportStep> -
Returns the list of test steps in an unmodifiable List.
no setter
-
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.no setter - 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 returnfalse
.no setter - 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 optionalerror
. If theerror
isnull
then the step is considered successful. If there is anerror
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 nonexistent 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.
-
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