# Start tracing before actions:
context.tracing.start(screenshots=True, snapshots=True, sources=True)# Run test actions...
# Stop and save trace archive:
context.tracing.stop(path="traces/failure_trace.zip")
# View trace with CLI:
# playwright show-trace traces/failure_trace.zip