#[non_exhaustive]pub struct TracingStartOptions {
pub name: Option<String>,
pub screenshots: Option<bool>,
pub snapshots: Option<TraceSnapshots>,
pub live: Option<bool>,
}Expand description
Options for starting a trace recording.
Serializes straight to the driver’s tracingStart parameters. The
driver ignores keys it does not know rather than rejecting them, so a
stale spelling costs every trace its snapshots and its timeline with no
error anywhere; the unit tests below pin the current spellings.
See: https://playwright.dev/docs/api/class-tracing#tracing-start
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.name: Option<String>Custom name for the trace. Shown in trace viewer as the trace title.
screenshots: Option<bool>Whether to record a screencast during tracing. Its frames are the timeline preview in the trace viewer.
snapshots: Option<TraceSnapshots>Which snapshots to capture on each action. snapshots(true) is the
DOM snapshot alone; a TraceSnapshots value selects DOM,
accessibility, and screen captures individually.
live: Option<bool>Whether to enable live trace updates while recording. When true,
the trace viewer can attach and observe the trace as it is being
captured, rather than waiting for the recording to finish. Useful
for debugging long-running flows.
See: https://playwright.dev/docs/api/class-tracing#tracing-start-option-live
Implementations§
Source§impl TracingStartOptions
impl TracingStartOptions
Sourcepub fn name(self, name: impl Into<String>) -> Self
pub fn name(self, name: impl Into<String>) -> Self
Trace name (affects file naming in the traces directory).
Sourcepub fn screenshots(self, screenshots: bool) -> Self
pub fn screenshots(self, screenshots: bool) -> Self
Capture screenshots during tracing.
Sourcepub fn snapshots(self, snapshots: impl Into<TraceSnapshots>) -> Self
pub fn snapshots(self, snapshots: impl Into<TraceSnapshots>) -> Self
Capture snapshots on each action: true for the DOM snapshot, or a
TraceSnapshots selecting DOM, accessibility, and screen captures.