InteractionHarness class

Runs interaction adapters outside an app: capture into a list of events, then replay those events offline, the way the runtime does. Used by BugCapsule's own adapter tests and by AdapterConformance, so app teams can qualify adapters they write for unsupported SDKs.

Implemented types

Constructors

InteractionHarness.capture({Redactor? redactor, InteractionLimits limits = const InteractionLimits()})
A session that records.
factory
InteractionHarness.replay(List<BugCapsuleEvent> events, {required List<CapsuleDependency> dependencies, Redactor? redactor})
A replay of events serving dependencies.
factory

Properties

capsule → Capsule
no setteroverride
captureNetworkBodies → bool
no setteroverride
config → BugCapsuleConfig
no setteroverride
divergences → List<Divergence>
final
events → List<BugCapsuleEvent>
Recorded events (capture) or the events being replayed.
no setter
fixtures → FixtureStore
latefinal
hashCode → int
The hash code for this object.
no setterinherited
interactions → InteractionHost
final
isRecording → bool
True while events are being recorded (capture mode, enabled, sampled).
final
isReplaying → bool
no setteroverride
maxBodyBytes → int
no setteroverride
mode → CaptureMode
no setteroverride
redactor → Redactor
final
replay → ReplayContext?
Non-null in replay mode.
no setteroverride
replayedDependencies → List<CapsuleDependency>
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
settings → ReplaySettings
no setteroverride

Methods

activity() → void
Notes that the app did something (e.g. a BLoC event), so idle compression waits for it to settle.
override
beginWork() → void Function()
Marks work in progress that idle compression must not skip over, such as a response waiting out its recorded latency. Call the returned function once the work ends.
override
dependencies() → List<CapsuleDependency>
The manifest.dependencies of everything captured so far.
diverge(String type, String detail) → void
Records a difference between the recording and this replay.
override
eligibility() → Eligibility
Eligibility gaps the adapters report for what was captured.
encodedEvents() → List<BugCapsuleEvent>
Round-trips the captured events through the capsule JSON encoding, as an upload and download would.
finish({int? failureT}) → List<Divergence>
Ends a replay: reports unmatched interactions and returns every divergence.
fixtureServed() → void
Counts a network response served from the capsule.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
now() → int
Milliseconds on the session clock (same clock as event t).
override
record(String type, [Map<String, Object?> data = const {}]) → void
Records an event. No-op when not recording.
override
reportError(Object error, StackTrace? stack) → void
Reports an error as a failure (deduplicated by signature).
override
setUp(List<BugCapsuleIntegration> integrations) → Future<void>
Sets up integrations against this session (and, when replaying, starts the replay clock).
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited