feat: add WebRTC connection monitoring tools

Add real-time WebRTC connection monitoring for testing video calling apps.
Monitors real RTCPeerConnection instances and collects connection statistics.

New tools:
- browser_start_webrtc_monitoring: Enable monitoring and stats collection
- browser_get_webrtc_connections: List connections with state filtering
- browser_get_webrtc_stats: Detailed stats (bitrate, packet loss, jitter, RTT)
- browser_stop_webrtc_monitoring: Stop stats polling, preserve data
- browser_clear_webrtc_data: Clear captured connection data

Implementation:
- Intercepts RTCPeerConnection constructor via page.addInitScript()
- Captures state changes via page.exposeFunction() callbacks
- Collects stats via page.evaluate() calling getStats()
- Tab-level storage with Context aggregation (same pattern as notifications)
- Configurable stats polling interval (default 1s)

Use cases:
- Test WebRTC call quality in real-time
- Monitor connection states and failures
- Analyze bandwidth, packet loss, frame rates
This commit is contained in:
Ryan Malloy 2026-01-16 20:39:44 -07:00
parent a7d10f71bd
commit 96641283c3
6 changed files with 722 additions and 2 deletions

View file

@ -22,6 +22,7 @@ test('test snapshot tool list', async ({ client }) => {
'browser_clear_device_motion',
'browser_clear_device_orientation',
'browser_clear_injections',
'browser_clear_webrtc_data',
'browser_clear_notifications',
'browser_clear_permissions',
'browser_clear_requests',
@ -43,6 +44,8 @@ test('test snapshot tool list', async ({ client }) => {
'browser_file_upload',
'browser_get_artifact_paths',
'browser_get_requests',
'browser_get_webrtc_connections',
'browser_get_webrtc_stats',
'browser_grant_permissions',
'browser_handle_dialog',
'browser_handle_notification',
@ -80,8 +83,10 @@ test('test snapshot tool list', async ({ client }) => {
'browser_snapshot',
'browser_start_recording',
'browser_start_request_monitoring',
'browser_start_webrtc_monitoring',
'browser_status',
'browser_stop_recording',
'browser_stop_webrtc_monitoring',
'browser_tab_close',
'browser_tab_list',
'browser_tab_new',