Repository navigation
playwright-rs-trace 0.1.0
·
348 commits
to main
since this release
Added
-
TraceReader— open a Playwright trace zip, stream events, reassemble actions.TraceReader::open(reader)parses thecontext-optionsevent
eagerly so callers can readreader.context()before iterating.TraceReader::raw_events()— lossless iterator over every JSONL
line intrace.trace, yieldingRawEvent(the full JSON object).
Forward-compat escape hatch for callers dispatching on event kinds
the parser doesn't model yet.TraceReader::events()— typed iterator yieldingTraceEvent.
Known kinds become typed variants; anything else surfaces as
TraceEvent::Unknown(RawEvent)so nothing is silently dropped.TraceReader::actions()— reassemblesbefore+ optionalinput- zero-or-more
log+afterevents into a logicalAction.
Truncated actions are emitted at end-of-stream rather than
discarded.
- zero-or-more
- Free function
playwright_rs_trace::open(path)for the
file-on-disk case.
-
TraceReader::network()—trace.networkparsing →NetworkEntryiterator.- One entry per recorded HTTP request/response pair (HAR-like
resource snapshot). Emptytrace.network(typical for traces
driven againstdata:URLs) yields zero items. - HAR
-1"unknown" sentinels are mapped toNoneat parse time —
the public types useOption<u64>/Option<u16>/Option<f64>
ontime,headers_size,body_size,status,content.size,
so callers don't have to know the convention. EmptyredirectURL
likewise →None. - HAR fields not modelled individually (
cookies,timings,
cache,queryString,_transferSize, …) are preserved on
NetworkEntry::raw_snapshot: serde_json::Value. - Unknown event kinds in
trace.networkyield an error rather than
being silently skipped — the stream is single-purpose.
- One entry per recorded HTTP request/response pair (HAR-like
-
xtaskworkspace member withregenerate-trace-fixture
subcommand. Drives a real Chromium session through
playwright-rs::Tracing— including a localhostaxumserver so
the navigation produces a realresource-snapshot— to refresh
the deterministic test fixture undertests/fixtures/. New
.cargo/config.tomlaliasescargo xtask.