Skip to content

feat: Introduce Vibium-tracing into the WebdriverIO ecosystem #110

Draft
Winify wants to merge 8 commits into
mainfrom
feature/tracing
Draft

feat: Introduce Vibium-tracing into the WebdriverIO ecosystem #110
Winify wants to merge 8 commits into
mainfrom
feature/tracing

Conversation

@Winify
Copy link
Copy Markdown
Collaborator

@Winify Winify commented May 14, 2026

Proposed changes

Adds Vibium-compatible trace recording for both browser and mobile (iOS/Android) sessions.

When a session is started with trace: true, every tool call is captured as a structured trace event: before/after timestamps, action class and method, parameters, and screenshots.

Its exported to a .zip file on session close. The zip is playable directly in the Vibium player (player.vibium.dev) with a full action timeline and screenshot filmstrip.

Key design decisions:

  • Pre-action screenshots serve as both the settle window for animations and the "result" frame for the preceding action. Frames are timestamped at the previous action's endTime so the player associates each screenshot with the action that produced it, not the one about to fire.
  • Mobile sessions use chromium as the browserName (Vibium is Playwright-derived) and platform-appropriate viewport defaults (390×844 iOS, 412×915 Android), with device name and OS version in the trace title.
  • Before events emit bare method names (click, fill, navigate) rather than namespaced ones, which is what the player expects for correct tooltip rendering.
  • A show-trace CLI entry point is bundled separately for serving and previewing trace zips locally without leaving the terminal.

Types of changes

  • Polish (an improvement for an existing feature)
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update (improvements to the project's docs)
  • Specification changes (updates to WebDriver command specifications)
  • Internal updates (everything related to internal scripts, governance documentation and CI files)

Checklist

  • I have squashed commits that belong together
  • I have tested with Claude Desktop (or another MCP-compatible client)
  • I have read the CONTRIBUTING doc
  • I have added the necessary documentation for new/changed tools (if appropriate)
  • I have added proper type definitions for new commands (if appropriate)

Further comments

Reviewers: @webdriverio/project-committers

@Winify Winify changed the title Feature/tracing feat: Introduce Vibium-tracing into the WebdriverIO ecosystem May 14, 2026
Winify added 8 commits May 15, 2026 11:14
Adds opt-in trace recording that produces a zip playable at player.vibium.dev.

- New `src/trace/` module: types, tool mapping, session state, recorder HOF, zip writer
- `withTrace` HOF wraps action tools alongside `withRecording`; captures a JPEG screenshot after each action
- `start_session` gains `trace: true` flag to enable recording per session
- New `export_trace` MCP tool writes the trace zip to a specified path or temp dir
- `src/trace.ts` barrel export mirrors the `snapshot.ts` pattern for future extraction to `@wdio/trace`
- 26 new unit tests covering tool mapping, state lifecycle, HOF event emission, and zip structure
- The zip is automatically saved to .trace/<timestamp>-<sessionId>.zip relative to the server's cwd
Expands the roadmap with details on mobile trace recording for Appium sessions, including specific goals, advantages, and dependencies. Also outlines plans for WebDriver BiDi-based asynchronous trace recording. Streamlines future development priorities and feature dependencies.
Introduces `src/show-trace.ts`, a Node.js CLI to serve trace zip files via HTTP and open them in the Vibium trace player. Automatically detects the latest trace zip or accepts a path as an argument. Updates `package.json` and `tsup.config.ts` to integrate the tool.
Introduces a detailed documentation file outlining the vision, workflow, and components for trace recording and deterministic replay. Covers `.vibium` spec, `.trace` format, self-healing mechanism, and future considerations.
- Remove hardcoded viewport from trace to match the browserSession
- Remove references to non-existent export_trace tool
@Winify Winify force-pushed the feature/tracing branch from 4bba807 to 03be60f Compare May 15, 2026 09:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant