feat: add device orientation and motion sensor mocking tools
Add CDP-based sensor mocking tools for testing motion-sensitive web apps: - browser_set_device_orientation: Override DeviceOrientationEvent values (compass heading, front-back tilt, left-right tilt) - browser_clear_device_orientation: Clear orientation override - browser_set_device_motion: Override accelerometer and gyroscope values (acceleration, acceleration with gravity, rotation rate) - browser_clear_device_motion: Clear motion override These tools use Chrome DevTools Protocol (Chromium only) to mock sensor readings, enabling testing of AR/VR apps, compass apps, games, and other motion-sensitive web applications. Also updates test snapshots to include all new core tools added recently.
This commit is contained in:
parent
b0ded548cf
commit
a7d10f71bd
4 changed files with 410 additions and 9 deletions
|
|
@ -19,30 +19,78 @@ import { test, expect } from './fixtures.js';
|
|||
test('test snapshot tool list', async ({ client }) => {
|
||||
const { tools } = await client.listTools();
|
||||
expect(new Set(tools.map(t => t.name))).toEqual(new Set([
|
||||
'browser_clear_device_motion',
|
||||
'browser_clear_device_orientation',
|
||||
'browser_clear_injections',
|
||||
'browser_clear_notifications',
|
||||
'browser_clear_permissions',
|
||||
'browser_clear_requests',
|
||||
'browser_click',
|
||||
'browser_console_messages',
|
||||
'browser_drag',
|
||||
'browser_evaluate',
|
||||
'browser_file_upload',
|
||||
'browser_handle_dialog',
|
||||
'browser_hover',
|
||||
'browser_select_option',
|
||||
'browser_type',
|
||||
'browser_close',
|
||||
'browser_configure',
|
||||
'browser_configure_artifacts',
|
||||
'browser_configure_notifications',
|
||||
'browser_configure_snapshots',
|
||||
'browser_console_messages',
|
||||
'browser_disable_debug_toolbar',
|
||||
'browser_dismiss_all_file_choosers',
|
||||
'browser_dismiss_file_chooser',
|
||||
'browser_drag',
|
||||
'browser_enable_debug_toolbar',
|
||||
'browser_enable_voice_collaboration',
|
||||
'browser_evaluate',
|
||||
'browser_export_requests',
|
||||
'browser_file_upload',
|
||||
'browser_get_artifact_paths',
|
||||
'browser_get_requests',
|
||||
'browser_grant_permissions',
|
||||
'browser_handle_dialog',
|
||||
'browser_handle_notification',
|
||||
'browser_hover',
|
||||
'browser_inject_custom_code',
|
||||
'browser_install',
|
||||
'browser_install_extension',
|
||||
'browser_install_popular_extension',
|
||||
'browser_list_devices',
|
||||
'browser_list_extensions',
|
||||
'browser_list_injections',
|
||||
'browser_list_notifications',
|
||||
'browser_mcp_theme_create',
|
||||
'browser_mcp_theme_get',
|
||||
'browser_mcp_theme_list',
|
||||
'browser_mcp_theme_reset',
|
||||
'browser_mcp_theme_set',
|
||||
'browser_navigate',
|
||||
'browser_navigate_back',
|
||||
'browser_navigate_forward',
|
||||
'browser_navigate',
|
||||
'browser_network_requests',
|
||||
'browser_pause_recording',
|
||||
'browser_press_key',
|
||||
'browser_recording_status',
|
||||
'browser_request_monitoring_status',
|
||||
'browser_resize',
|
||||
'browser_resume_recording',
|
||||
'browser_reveal_artifact_paths',
|
||||
'browser_select_option',
|
||||
'browser_set_device_motion',
|
||||
'browser_set_device_orientation',
|
||||
'browser_set_geolocation',
|
||||
'browser_set_offline',
|
||||
'browser_set_recording_mode',
|
||||
'browser_snapshot',
|
||||
'browser_start_recording',
|
||||
'browser_start_request_monitoring',
|
||||
'browser_status',
|
||||
'browser_stop_recording',
|
||||
'browser_tab_close',
|
||||
'browser_tab_list',
|
||||
'browser_tab_new',
|
||||
'browser_tab_select',
|
||||
'browser_take_screenshot',
|
||||
'browser_type',
|
||||
'browser_uninstall_extension',
|
||||
'browser_wait_for',
|
||||
'browser_wait_notification',
|
||||
]));
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue