devharness 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +185 -0
- package/build/atomic-write.d.ts +28 -0
- package/build/atomic-write.d.ts.map +1 -0
- package/build/atomic-write.js +126 -0
- package/build/atomic-write.js.map +1 -0
- package/build/cdp-manager.d.ts +524 -0
- package/build/cdp-manager.d.ts.map +1 -0
- package/build/cdp-manager.js +1828 -0
- package/build/cdp-manager.js.map +1 -0
- package/build/cdp-manager.test.d.ts +6 -0
- package/build/cdp-manager.test.d.ts.map +1 -0
- package/build/cdp-manager.test.js +546 -0
- package/build/cdp-manager.test.js.map +1 -0
- package/build/chrome-launcher.d.ts +400 -0
- package/build/chrome-launcher.d.ts.map +1 -0
- package/build/chrome-launcher.js +1071 -0
- package/build/chrome-launcher.js.map +1 -0
- package/build/chrome-launcher.test.d.ts +11 -0
- package/build/chrome-launcher.test.d.ts.map +1 -0
- package/build/chrome-launcher.test.js +204 -0
- package/build/chrome-launcher.test.js.map +1 -0
- package/build/clickable-cache.d.ts +73 -0
- package/build/clickable-cache.d.ts.map +1 -0
- package/build/clickable-cache.js +90 -0
- package/build/clickable-cache.js.map +1 -0
- package/build/command-recorder.d.ts +401 -0
- package/build/command-recorder.d.ts.map +1 -0
- package/build/command-recorder.js +701 -0
- package/build/command-recorder.js.map +1 -0
- package/build/config.d.ts +390 -0
- package/build/config.d.ts.map +1 -0
- package/build/config.js +826 -0
- package/build/config.js.map +1 -0
- package/build/config.test.d.ts +2 -0
- package/build/config.test.d.ts.map +1 -0
- package/build/config.test.js +112 -0
- package/build/config.test.js.map +1 -0
- package/build/connection-manager.d.ts +159 -0
- package/build/connection-manager.d.ts.map +1 -0
- package/build/connection-manager.js +432 -0
- package/build/connection-manager.js.map +1 -0
- package/build/connection-manager.test.d.ts +11 -0
- package/build/connection-manager.test.d.ts.map +1 -0
- package/build/connection-manager.test.js +114 -0
- package/build/connection-manager.test.js.map +1 -0
- package/build/console-monitor.d.ts +150 -0
- package/build/console-monitor.d.ts.map +1 -0
- package/build/console-monitor.js +454 -0
- package/build/console-monitor.js.map +1 -0
- package/build/dashboard/bundle.js +1 -0
- package/build/dashboard/dashboard-client.d.ts +42 -0
- package/build/dashboard/dashboard-client.d.ts.map +1 -0
- package/build/dashboard/dashboard-client.js +184 -0
- package/build/dashboard/dashboard-client.js.map +1 -0
- package/build/dashboard/dashboard-hub.d.ts +50 -0
- package/build/dashboard/dashboard-hub.d.ts.map +1 -0
- package/build/dashboard/dashboard-hub.js +654 -0
- package/build/dashboard/dashboard-hub.js.map +1 -0
- package/build/dashboard/hub-lock.d.ts +16 -0
- package/build/dashboard/hub-lock.d.ts.map +1 -0
- package/build/dashboard/hub-lock.js +77 -0
- package/build/dashboard/hub-lock.js.map +1 -0
- package/build/dashboard/index.d.ts +25 -0
- package/build/dashboard/index.d.ts.map +1 -0
- package/build/dashboard/index.js +77 -0
- package/build/dashboard/index.js.map +1 -0
- package/build/dashboard/types.d.ts +83 -0
- package/build/dashboard/types.d.ts.map +1 -0
- package/build/dashboard/types.js +6 -0
- package/build/dashboard/types.js.map +1 -0
- package/build/debug-logger.d.ts +85 -0
- package/build/debug-logger.d.ts.map +1 -0
- package/build/debug-logger.js +195 -0
- package/build/debug-logger.js.map +1 -0
- package/build/debugger-aware-wrapper.d.ts +37 -0
- package/build/debugger-aware-wrapper.d.ts.map +1 -0
- package/build/debugger-aware-wrapper.js +128 -0
- package/build/debugger-aware-wrapper.js.map +1 -0
- package/build/dom-change-monitor.d.ts +92 -0
- package/build/dom-change-monitor.d.ts.map +1 -0
- package/build/dom-change-monitor.js +437 -0
- package/build/dom-change-monitor.js.map +1 -0
- package/build/element-collector.d.ts +16 -0
- package/build/element-collector.d.ts.map +1 -0
- package/build/element-collector.js +207 -0
- package/build/element-collector.js.map +1 -0
- package/build/error-helpers.d.ts +43 -0
- package/build/error-helpers.d.ts.map +1 -0
- package/build/error-helpers.js +143 -0
- package/build/error-helpers.js.map +1 -0
- package/build/formatters/console-formatter.d.ts +160 -0
- package/build/formatters/console-formatter.d.ts.map +1 -0
- package/build/formatters/console-formatter.js +338 -0
- package/build/formatters/console-formatter.js.map +1 -0
- package/build/helpers/parser-plugins.d.ts +44 -0
- package/build/helpers/parser-plugins.d.ts.map +1 -0
- package/build/helpers/parser-plugins.js +102 -0
- package/build/helpers/parser-plugins.js.map +1 -0
- package/build/helpers/paths.d.ts +79 -0
- package/build/helpers/paths.d.ts.map +1 -0
- package/build/helpers/paths.js +168 -0
- package/build/helpers/paths.js.map +1 -0
- package/build/helpers/process-liveness.d.ts +24 -0
- package/build/helpers/process-liveness.d.ts.map +1 -0
- package/build/helpers/process-liveness.js +36 -0
- package/build/helpers/process-liveness.js.map +1 -0
- package/build/helpers/process-liveness.test.d.ts +2 -0
- package/build/helpers/process-liveness.test.d.ts.map +1 -0
- package/build/helpers/process-liveness.test.js +40 -0
- package/build/helpers/process-liveness.test.js.map +1 -0
- package/build/helpers/sequence-tree.d.ts +27 -0
- package/build/helpers/sequence-tree.d.ts.map +1 -0
- package/build/helpers/sequence-tree.js +80 -0
- package/build/helpers/sequence-tree.js.map +1 -0
- package/build/helpers/sequence-tree.test.d.ts +2 -0
- package/build/helpers/sequence-tree.test.d.ts.map +1 -0
- package/build/helpers/sequence-tree.test.js +122 -0
- package/build/helpers/sequence-tree.test.js.map +1 -0
- package/build/index.d.ts +3 -0
- package/build/index.d.ts.map +1 -0
- package/build/index.js +2007 -0
- package/build/index.js.map +1 -0
- package/build/interaction-recorder.d.ts +214 -0
- package/build/interaction-recorder.d.ts.map +1 -0
- package/build/interaction-recorder.js +2007 -0
- package/build/interaction-recorder.js.map +1 -0
- package/build/issue-tracker.d.ts +107 -0
- package/build/issue-tracker.d.ts.map +1 -0
- package/build/issue-tracker.js +582 -0
- package/build/issue-tracker.js.map +1 -0
- package/build/issue-tracker.test.d.ts +2 -0
- package/build/issue-tracker.test.d.ts.map +1 -0
- package/build/issue-tracker.test.js +88 -0
- package/build/issue-tracker.test.js.map +1 -0
- package/build/launch-chrome-port.test.d.ts +14 -0
- package/build/launch-chrome-port.test.d.ts.map +1 -0
- package/build/launch-chrome-port.test.js +97 -0
- package/build/launch-chrome-port.test.js.map +1 -0
- package/build/log-processor/orchestrator.d.ts +32 -0
- package/build/log-processor/orchestrator.d.ts.map +1 -0
- package/build/log-processor/orchestrator.js +27 -0
- package/build/log-processor/orchestrator.js.map +1 -0
- package/build/logpoint-execution-tracker.d.ts +57 -0
- package/build/logpoint-execution-tracker.d.ts.map +1 -0
- package/build/logpoint-execution-tracker.js +112 -0
- package/build/logpoint-execution-tracker.js.map +1 -0
- package/build/mcp-supervisor.d.ts +3 -0
- package/build/mcp-supervisor.d.ts.map +1 -0
- package/build/mcp-supervisor.js +211 -0
- package/build/mcp-supervisor.js.map +1 -0
- package/build/messages.d.ts +165 -0
- package/build/messages.d.ts.map +1 -0
- package/build/messages.js +574 -0
- package/build/messages.js.map +1 -0
- package/build/network-monitor.d.ts +172 -0
- package/build/network-monitor.d.ts.map +1 -0
- package/build/network-monitor.js +350 -0
- package/build/network-monitor.js.map +1 -0
- package/build/overlays.d.ts +49 -0
- package/build/overlays.d.ts.map +1 -0
- package/build/overlays.js +409 -0
- package/build/overlays.js.map +1 -0
- package/build/persistent-profiles.test.d.ts +15 -0
- package/build/persistent-profiles.test.d.ts.map +1 -0
- package/build/persistent-profiles.test.js +470 -0
- package/build/persistent-profiles.test.js.map +1 -0
- package/build/port-reserver.d.ts +32 -0
- package/build/port-reserver.d.ts.map +1 -0
- package/build/port-reserver.js +118 -0
- package/build/port-reserver.js.map +1 -0
- package/build/puppeteer-manager.d.ts +47 -0
- package/build/puppeteer-manager.d.ts.map +1 -0
- package/build/puppeteer-manager.js +116 -0
- package/build/puppeteer-manager.js.map +1 -0
- package/build/recording-coverage.test.d.ts +12 -0
- package/build/recording-coverage.test.d.ts.map +1 -0
- package/build/recording-coverage.test.js +72 -0
- package/build/recording-coverage.test.js.map +1 -0
- package/build/reference-validator.d.ts +47 -0
- package/build/reference-validator.d.ts.map +1 -0
- package/build/reference-validator.js +86 -0
- package/build/reference-validator.js.map +1 -0
- package/build/reference-validator.test.d.ts +5 -0
- package/build/reference-validator.test.d.ts.map +1 -0
- package/build/reference-validator.test.js +243 -0
- package/build/reference-validator.test.js.map +1 -0
- package/build/replay-cursor.d.ts +27 -0
- package/build/replay-cursor.d.ts.map +1 -0
- package/build/replay-cursor.js +240 -0
- package/build/replay-cursor.js.map +1 -0
- package/build/runners/docker-compose-runner.d.ts +69 -0
- package/build/runners/docker-compose-runner.d.ts.map +1 -0
- package/build/runners/docker-compose-runner.js +438 -0
- package/build/runners/docker-compose-runner.js.map +1 -0
- package/build/runners/docker-runner.d.ts +65 -0
- package/build/runners/docker-runner.d.ts.map +1 -0
- package/build/runners/docker-runner.js +414 -0
- package/build/runners/docker-runner.js.map +1 -0
- package/build/runners/index.d.ts +19 -0
- package/build/runners/index.d.ts.map +1 -0
- package/build/runners/index.js +35 -0
- package/build/runners/index.js.map +1 -0
- package/build/runners/native-runner.d.ts +95 -0
- package/build/runners/native-runner.d.ts.map +1 -0
- package/build/runners/native-runner.js +370 -0
- package/build/runners/native-runner.js.map +1 -0
- package/build/runners/types.d.ts +147 -0
- package/build/runners/types.d.ts.map +1 -0
- package/build/runners/types.js +25 -0
- package/build/runners/types.js.map +1 -0
- package/build/self-restart.d.ts +12 -0
- package/build/self-restart.d.ts.map +1 -0
- package/build/self-restart.js +41 -0
- package/build/self-restart.js.map +1 -0
- package/build/self-restart.test.d.ts +2 -0
- package/build/self-restart.test.d.ts.map +1 -0
- package/build/self-restart.test.js +34 -0
- package/build/self-restart.test.js.map +1 -0
- package/build/server-claims.d.ts +161 -0
- package/build/server-claims.d.ts.map +1 -0
- package/build/server-claims.js +382 -0
- package/build/server-claims.js.map +1 -0
- package/build/server-claims.test.d.ts +2 -0
- package/build/server-claims.test.d.ts.map +1 -0
- package/build/server-claims.test.js +197 -0
- package/build/server-claims.test.js.map +1 -0
- package/build/server-manager.d.ts +438 -0
- package/build/server-manager.d.ts.map +1 -0
- package/build/server-manager.js +1674 -0
- package/build/server-manager.js.map +1 -0
- package/build/server-manager.test.d.ts +17 -0
- package/build/server-manager.test.d.ts.map +1 -0
- package/build/server-manager.test.js +122 -0
- package/build/server-manager.test.js.map +1 -0
- package/build/server-ownership.test.d.ts +2 -0
- package/build/server-ownership.test.d.ts.map +1 -0
- package/build/server-ownership.test.js +238 -0
- package/build/server-ownership.test.js.map +1 -0
- package/build/server-watcher.d.ts +21 -0
- package/build/server-watcher.d.ts.map +1 -0
- package/build/server-watcher.js +105 -0
- package/build/server-watcher.js.map +1 -0
- package/build/session-detector.d.ts +47 -0
- package/build/session-detector.d.ts.map +1 -0
- package/build/session-detector.js +229 -0
- package/build/session-detector.js.map +1 -0
- package/build/session-detector.test.d.ts +9 -0
- package/build/session-detector.test.d.ts.map +1 -0
- package/build/session-detector.test.js +45 -0
- package/build/session-detector.test.js.map +1 -0
- package/build/sourcemap-handler.d.ts +114 -0
- package/build/sourcemap-handler.d.ts.map +1 -0
- package/build/sourcemap-handler.js +479 -0
- package/build/sourcemap-handler.js.map +1 -0
- package/build/supervisor/child-manager.d.ts +43 -0
- package/build/supervisor/child-manager.d.ts.map +1 -0
- package/build/supervisor/child-manager.js +148 -0
- package/build/supervisor/child-manager.js.map +1 -0
- package/build/supervisor/child-manager.test.d.ts +2 -0
- package/build/supervisor/child-manager.test.d.ts.map +1 -0
- package/build/supervisor/child-manager.test.js +107 -0
- package/build/supervisor/child-manager.test.js.map +1 -0
- package/build/supervisor/client-watcher.d.ts +48 -0
- package/build/supervisor/client-watcher.d.ts.map +1 -0
- package/build/supervisor/client-watcher.js +186 -0
- package/build/supervisor/client-watcher.js.map +1 -0
- package/build/supervisor/client-watcher.test.d.ts +2 -0
- package/build/supervisor/client-watcher.test.d.ts.map +1 -0
- package/build/supervisor/client-watcher.test.js +121 -0
- package/build/supervisor/client-watcher.test.js.map +1 -0
- package/build/supervisor/idle-config.d.ts +30 -0
- package/build/supervisor/idle-config.d.ts.map +1 -0
- package/build/supervisor/idle-config.js +76 -0
- package/build/supervisor/idle-config.js.map +1 -0
- package/build/supervisor/idle-config.test.d.ts +2 -0
- package/build/supervisor/idle-config.test.d.ts.map +1 -0
- package/build/supervisor/idle-config.test.js +119 -0
- package/build/supervisor/idle-config.test.js.map +1 -0
- package/build/supervisor/ndjson-reader.d.ts +47 -0
- package/build/supervisor/ndjson-reader.d.ts.map +1 -0
- package/build/supervisor/ndjson-reader.js +75 -0
- package/build/supervisor/ndjson-reader.js.map +1 -0
- package/build/supervisor/ndjson-reader.test.d.ts +2 -0
- package/build/supervisor/ndjson-reader.test.d.ts.map +1 -0
- package/build/supervisor/ndjson-reader.test.js +92 -0
- package/build/supervisor/ndjson-reader.test.js.map +1 -0
- package/build/supervisor/pidfile.d.ts +11 -0
- package/build/supervisor/pidfile.d.ts.map +1 -0
- package/build/supervisor/pidfile.js +29 -0
- package/build/supervisor/pidfile.js.map +1 -0
- package/build/supervisor/pidfile.test.d.ts +8 -0
- package/build/supervisor/pidfile.test.d.ts.map +1 -0
- package/build/supervisor/pidfile.test.js +46 -0
- package/build/supervisor/pidfile.test.js.map +1 -0
- package/build/supervisor/restart-coordinator.d.ts +73 -0
- package/build/supervisor/restart-coordinator.d.ts.map +1 -0
- package/build/supervisor/restart-coordinator.js +300 -0
- package/build/supervisor/restart-coordinator.js.map +1 -0
- package/build/supervisor/restart-coordinator.test.d.ts +2 -0
- package/build/supervisor/restart-coordinator.test.d.ts.map +1 -0
- package/build/supervisor/restart-coordinator.test.js +434 -0
- package/build/supervisor/restart-coordinator.test.js.map +1 -0
- package/build/test-support/fake-execute-tool-call.d.ts +11 -0
- package/build/test-support/fake-execute-tool-call.d.ts.map +1 -0
- package/build/test-support/fake-execute-tool-call.js +19 -0
- package/build/test-support/fake-execute-tool-call.js.map +1 -0
- package/build/tool-error.d.ts +14 -0
- package/build/tool-error.d.ts.map +1 -0
- package/build/tool-error.js +18 -0
- package/build/tool-error.js.map +1 -0
- package/build/tool-response.d.ts +293 -0
- package/build/tool-response.d.ts.map +1 -0
- package/build/tool-response.js +365 -0
- package/build/tool-response.js.map +1 -0
- package/build/tools/assert-tools.d.ts +62 -0
- package/build/tools/assert-tools.d.ts.map +1 -0
- package/build/tools/assert-tools.js +330 -0
- package/build/tools/assert-tools.js.map +1 -0
- package/build/tools/breakpoint-await-abort.test.d.ts +2 -0
- package/build/tools/breakpoint-await-abort.test.d.ts.map +1 -0
- package/build/tools/breakpoint-await-abort.test.js +124 -0
- package/build/tools/breakpoint-await-abort.test.js.map +1 -0
- package/build/tools/breakpoint-tools.d.ts +99 -0
- package/build/tools/breakpoint-tools.d.ts.map +1 -0
- package/build/tools/breakpoint-tools.js +1197 -0
- package/build/tools/breakpoint-tools.js.map +1 -0
- package/build/tools/config-tools.d.ts +58 -0
- package/build/tools/config-tools.d.ts.map +1 -0
- package/build/tools/config-tools.js +180 -0
- package/build/tools/config-tools.js.map +1 -0
- package/build/tools/connection-routing.test.d.ts +12 -0
- package/build/tools/connection-routing.test.d.ts.map +1 -0
- package/build/tools/connection-routing.test.js +206 -0
- package/build/tools/connection-routing.test.js.map +1 -0
- package/build/tools/console-tools.d.ts +84 -0
- package/build/tools/console-tools.d.ts.map +1 -0
- package/build/tools/console-tools.js +241 -0
- package/build/tools/console-tools.js.map +1 -0
- package/build/tools/content-tools.d.ts +74 -0
- package/build/tools/content-tools.d.ts.map +1 -0
- package/build/tools/content-tools.js +582 -0
- package/build/tools/content-tools.js.map +1 -0
- package/build/tools/dashboard-tools.d.ts +38 -0
- package/build/tools/dashboard-tools.d.ts.map +1 -0
- package/build/tools/dashboard-tools.js +123 -0
- package/build/tools/dashboard-tools.js.map +1 -0
- package/build/tools/dom-tools.d.ts +41 -0
- package/build/tools/dom-tools.d.ts.map +1 -0
- package/build/tools/dom-tools.js +277 -0
- package/build/tools/dom-tools.js.map +1 -0
- package/build/tools/download-tools.d.ts +55 -0
- package/build/tools/download-tools.d.ts.map +1 -0
- package/build/tools/download-tools.js +280 -0
- package/build/tools/download-tools.js.map +1 -0
- package/build/tools/execution-tools.d.ts +40 -0
- package/build/tools/execution-tools.d.ts.map +1 -0
- package/build/tools/execution-tools.js +121 -0
- package/build/tools/execution-tools.js.map +1 -0
- package/build/tools/input-abort.test.d.ts +2 -0
- package/build/tools/input-abort.test.d.ts.map +1 -0
- package/build/tools/input-abort.test.js +227 -0
- package/build/tools/input-abort.test.js.map +1 -0
- package/build/tools/input-ambiguous-selector.test.d.ts +2 -0
- package/build/tools/input-ambiguous-selector.test.d.ts.map +1 -0
- package/build/tools/input-ambiguous-selector.test.js +34 -0
- package/build/tools/input-ambiguous-selector.test.js.map +1 -0
- package/build/tools/input-tools.d.ts +168 -0
- package/build/tools/input-tools.d.ts.map +1 -0
- package/build/tools/input-tools.js +1397 -0
- package/build/tools/input-tools.js.map +1 -0
- package/build/tools/inspection-tools.d.ts +112 -0
- package/build/tools/inspection-tools.d.ts.map +1 -0
- package/build/tools/inspection-tools.js +637 -0
- package/build/tools/inspection-tools.js.map +1 -0
- package/build/tools/interpolation.d.ts +30 -0
- package/build/tools/interpolation.d.ts.map +1 -0
- package/build/tools/interpolation.js +143 -0
- package/build/tools/interpolation.js.map +1 -0
- package/build/tools/issues-abort-hygiene.test.d.ts +2 -0
- package/build/tools/issues-abort-hygiene.test.d.ts.map +1 -0
- package/build/tools/issues-abort-hygiene.test.js +79 -0
- package/build/tools/issues-abort-hygiene.test.js.map +1 -0
- package/build/tools/issues-tools.d.ts +98 -0
- package/build/tools/issues-tools.d.ts.map +1 -0
- package/build/tools/issues-tools.js +821 -0
- package/build/tools/issues-tools.js.map +1 -0
- package/build/tools/issues-tools.test.d.ts +8 -0
- package/build/tools/issues-tools.test.d.ts.map +1 -0
- package/build/tools/issues-tools.test.js +184 -0
- package/build/tools/issues-tools.test.js.map +1 -0
- package/build/tools/modal-tools.d.ts +73 -0
- package/build/tools/modal-tools.d.ts.map +1 -0
- package/build/tools/modal-tools.js +161 -0
- package/build/tools/modal-tools.js.map +1 -0
- package/build/tools/network-tools.d.ts +72 -0
- package/build/tools/network-tools.d.ts.map +1 -0
- package/build/tools/network-tools.js +432 -0
- package/build/tools/network-tools.js.map +1 -0
- package/build/tools/page-tools.d.ts +78 -0
- package/build/tools/page-tools.d.ts.map +1 -0
- package/build/tools/page-tools.js +255 -0
- package/build/tools/page-tools.js.map +1 -0
- package/build/tools/plugin-tools.d.ts +16 -0
- package/build/tools/plugin-tools.d.ts.map +1 -0
- package/build/tools/plugin-tools.js +17 -0
- package/build/tools/plugin-tools.js.map +1 -0
- package/build/tools/replay-abort.test.d.ts +2 -0
- package/build/tools/replay-abort.test.d.ts.map +1 -0
- package/build/tools/replay-abort.test.js +259 -0
- package/build/tools/replay-abort.test.js.map +1 -0
- package/build/tools/replay-add-conditional.test.d.ts +2 -0
- package/build/tools/replay-add-conditional.test.d.ts.map +1 -0
- package/build/tools/replay-add-conditional.test.js +205 -0
- package/build/tools/replay-add-conditional.test.js.map +1 -0
- package/build/tools/replay-background-run.test.d.ts +2 -0
- package/build/tools/replay-background-run.test.d.ts.map +1 -0
- package/build/tools/replay-background-run.test.js +176 -0
- package/build/tools/replay-background-run.test.js.map +1 -0
- package/build/tools/replay-capture-variables.test.d.ts +2 -0
- package/build/tools/replay-capture-variables.test.d.ts.map +1 -0
- package/build/tools/replay-capture-variables.test.js +331 -0
- package/build/tools/replay-capture-variables.test.js.map +1 -0
- package/build/tools/replay-conditional-idb-and-launch.test.d.ts +11 -0
- package/build/tools/replay-conditional-idb-and-launch.test.d.ts.map +1 -0
- package/build/tools/replay-conditional-idb-and-launch.test.js +429 -0
- package/build/tools/replay-conditional-idb-and-launch.test.js.map +1 -0
- package/build/tools/replay-conditional-timeout.test.d.ts +14 -0
- package/build/tools/replay-conditional-timeout.test.d.ts.map +1 -0
- package/build/tools/replay-conditional-timeout.test.js +126 -0
- package/build/tools/replay-conditional-timeout.test.js.map +1 -0
- package/build/tools/replay-declare.test.d.ts +2 -0
- package/build/tools/replay-declare.test.d.ts.map +1 -0
- package/build/tools/replay-declare.test.js +106 -0
- package/build/tools/replay-declare.test.js.map +1 -0
- package/build/tools/replay-declared-browser-cleanup.test.d.ts +2 -0
- package/build/tools/replay-declared-browser-cleanup.test.d.ts.map +1 -0
- package/build/tools/replay-declared-browser-cleanup.test.js +103 -0
- package/build/tools/replay-declared-browser-cleanup.test.js.map +1 -0
- package/build/tools/replay-declared-profile.test.d.ts +2 -0
- package/build/tools/replay-declared-profile.test.d.ts.map +1 -0
- package/build/tools/replay-declared-profile.test.js +116 -0
- package/build/tools/replay-declared-profile.test.js.map +1 -0
- package/build/tools/replay-executor.d.ts +556 -0
- package/build/tools/replay-executor.d.ts.map +1 -0
- package/build/tools/replay-executor.js +2347 -0
- package/build/tools/replay-executor.js.map +1 -0
- package/build/tools/replay-folder-save.test.d.ts +2 -0
- package/build/tools/replay-folder-save.test.d.ts.map +1 -0
- package/build/tools/replay-folder-save.test.js +63 -0
- package/build/tools/replay-folder-save.test.js.map +1 -0
- package/build/tools/replay-formatters.d.ts +148 -0
- package/build/tools/replay-formatters.d.ts.map +1 -0
- package/build/tools/replay-formatters.js +856 -0
- package/build/tools/replay-formatters.js.map +1 -0
- package/build/tools/replay-kill-chrome-on-finish.test.d.ts +2 -0
- package/build/tools/replay-kill-chrome-on-finish.test.d.ts.map +1 -0
- package/build/tools/replay-kill-chrome-on-finish.test.js +175 -0
- package/build/tools/replay-kill-chrome-on-finish.test.js.map +1 -0
- package/build/tools/replay-multi-connection.test.d.ts +2 -0
- package/build/tools/replay-multi-connection.test.d.ts.map +1 -0
- package/build/tools/replay-multi-connection.test.js +547 -0
- package/build/tools/replay-multi-connection.test.js.map +1 -0
- package/build/tools/replay-output-and-record-options.test.d.ts +2 -0
- package/build/tools/replay-output-and-record-options.test.d.ts.map +1 -0
- package/build/tools/replay-output-and-record-options.test.js +240 -0
- package/build/tools/replay-output-and-record-options.test.js.map +1 -0
- package/build/tools/replay-production-error-shape.test.d.ts +7 -0
- package/build/tools/replay-production-error-shape.test.d.ts.map +1 -0
- package/build/tools/replay-production-error-shape.test.js +93 -0
- package/build/tools/replay-production-error-shape.test.js.map +1 -0
- package/build/tools/replay-rebase.test.d.ts +2 -0
- package/build/tools/replay-rebase.test.d.ts.map +1 -0
- package/build/tools/replay-rebase.test.js +58 -0
- package/build/tools/replay-rebase.test.js.map +1 -0
- package/build/tools/replay-retry-classification.test.d.ts +9 -0
- package/build/tools/replay-retry-classification.test.d.ts.map +1 -0
- package/build/tools/replay-retry-classification.test.js +57 -0
- package/build/tools/replay-retry-classification.test.js.map +1 -0
- package/build/tools/replay-run-registry.d.ts +55 -0
- package/build/tools/replay-run-registry.d.ts.map +1 -0
- package/build/tools/replay-run-registry.js +65 -0
- package/build/tools/replay-run-registry.js.map +1 -0
- package/build/tools/replay-sequence-reload.test.d.ts +2 -0
- package/build/tools/replay-sequence-reload.test.d.ts.map +1 -0
- package/build/tools/replay-sequence-reload.test.js +82 -0
- package/build/tools/replay-sequence-reload.test.js.map +1 -0
- package/build/tools/replay-socket-scope.test.d.ts +2 -0
- package/build/tools/replay-socket-scope.test.d.ts.map +1 -0
- package/build/tools/replay-socket-scope.test.js +75 -0
- package/build/tools/replay-socket-scope.test.js.map +1 -0
- package/build/tools/replay-step-connection.test.d.ts +2 -0
- package/build/tools/replay-step-connection.test.d.ts.map +1 -0
- package/build/tools/replay-step-connection.test.js +292 -0
- package/build/tools/replay-step-connection.test.js.map +1 -0
- package/build/tools/replay-step-timeout.test.d.ts +2 -0
- package/build/tools/replay-step-timeout.test.d.ts.map +1 -0
- package/build/tools/replay-step-timeout.test.js +204 -0
- package/build/tools/replay-step-timeout.test.js.map +1 -0
- package/build/tools/replay-tags.test.d.ts +2 -0
- package/build/tools/replay-tags.test.d.ts.map +1 -0
- package/build/tools/replay-tags.test.js +99 -0
- package/build/tools/replay-tags.test.js.map +1 -0
- package/build/tools/replay-teardown-and-foreach.test.d.ts +13 -0
- package/build/tools/replay-teardown-and-foreach.test.d.ts.map +1 -0
- package/build/tools/replay-teardown-and-foreach.test.js +318 -0
- package/build/tools/replay-teardown-and-foreach.test.js.map +1 -0
- package/build/tools/replay-tool-name-validation.test.d.ts +2 -0
- package/build/tools/replay-tool-name-validation.test.d.ts.map +1 -0
- package/build/tools/replay-tool-name-validation.test.js +280 -0
- package/build/tools/replay-tool-name-validation.test.js.map +1 -0
- package/build/tools/replay-tools.d.ts +288 -0
- package/build/tools/replay-tools.d.ts.map +1 -0
- package/build/tools/replay-tools.js +2994 -0
- package/build/tools/replay-tools.js.map +1 -0
- package/build/tools/request-abort.test.d.ts +2 -0
- package/build/tools/request-abort.test.d.ts.map +1 -0
- package/build/tools/request-abort.test.js +130 -0
- package/build/tools/request-abort.test.js.map +1 -0
- package/build/tools/request-tools.d.ts +56 -0
- package/build/tools/request-tools.d.ts.map +1 -0
- package/build/tools/request-tools.js +174 -0
- package/build/tools/request-tools.js.map +1 -0
- package/build/tools/screenshot-tools.d.ts +135 -0
- package/build/tools/screenshot-tools.d.ts.map +1 -0
- package/build/tools/screenshot-tools.js +636 -0
- package/build/tools/screenshot-tools.js.map +1 -0
- package/build/tools/server-tools.d.ts +88 -0
- package/build/tools/server-tools.d.ts.map +1 -0
- package/build/tools/server-tools.js +485 -0
- package/build/tools/server-tools.js.map +1 -0
- package/build/tools/source-tools.d.ts +46 -0
- package/build/tools/source-tools.d.ts.map +1 -0
- package/build/tools/source-tools.js +47 -0
- package/build/tools/source-tools.js.map +1 -0
- package/build/tools/storage-tools.d.ts +141 -0
- package/build/tools/storage-tools.d.ts.map +1 -0
- package/build/tools/storage-tools.js +894 -0
- package/build/tools/storage-tools.js.map +1 -0
- package/build/tools/storage-tools.test.d.ts +13 -0
- package/build/tools/storage-tools.test.d.ts.map +1 -0
- package/build/tools/storage-tools.test.js +707 -0
- package/build/tools/storage-tools.test.js.map +1 -0
- package/build/tools/tab-tools.d.ts +42 -0
- package/build/tools/tab-tools.d.ts.map +1 -0
- package/build/tools/tab-tools.js +296 -0
- package/build/tools/tab-tools.js.map +1 -0
- package/build/tools/wait-tools.d.ts +85 -0
- package/build/tools/wait-tools.d.ts.map +1 -0
- package/build/tools/wait-tools.js +236 -0
- package/build/tools/wait-tools.js.map +1 -0
- package/build/tools/wait-tools.test.d.ts +9 -0
- package/build/tools/wait-tools.test.d.ts.map +1 -0
- package/build/tools/wait-tools.test.js +193 -0
- package/build/tools/wait-tools.test.js.map +1 -0
- package/build/types.d.ts +133 -0
- package/build/types.d.ts.map +1 -0
- package/build/types.js +5 -0
- package/build/types.js.map +1 -0
- package/build/ui-verifier.d.ts +88 -0
- package/build/ui-verifier.d.ts.map +1 -0
- package/build/ui-verifier.js +540 -0
- package/build/ui-verifier.js.map +1 -0
- package/build/utils/abort.d.ts +68 -0
- package/build/utils/abort.d.ts.map +1 -0
- package/build/utils/abort.js +159 -0
- package/build/utils/abort.js.map +1 -0
- package/build/utils/abort.test.d.ts +2 -0
- package/build/utils/abort.test.d.ts.map +1 -0
- package/build/utils/abort.test.js +174 -0
- package/build/utils/abort.test.js.map +1 -0
- package/build/utils/modal-detection-core.d.ts +150 -0
- package/build/utils/modal-detection-core.d.ts.map +1 -0
- package/build/utils/modal-detection-core.js +332 -0
- package/build/utils/modal-detection-core.js.map +1 -0
- package/build/utils/modal-detection-core.test.d.ts +5 -0
- package/build/utils/modal-detection-core.test.d.ts.map +1 -0
- package/build/utils/modal-detection-core.test.js +492 -0
- package/build/utils/modal-detection-core.test.js.map +1 -0
- package/build/utils/modal-detector.d.ts +29 -0
- package/build/utils/modal-detector.d.ts.map +1 -0
- package/build/utils/modal-detector.js +281 -0
- package/build/utils/modal-detector.js.map +1 -0
- package/build/utils/modal-dismissal.d.ts +32 -0
- package/build/utils/modal-dismissal.d.ts.map +1 -0
- package/build/utils/modal-dismissal.js +190 -0
- package/build/utils/modal-dismissal.js.map +1 -0
- package/build/utils/port-check.d.ts +31 -0
- package/build/utils/port-check.d.ts.map +1 -0
- package/build/utils/port-check.js +87 -0
- package/build/utils/port-check.js.map +1 -0
- package/build/utils/port-check.test.d.ts +2 -0
- package/build/utils/port-check.test.d.ts.map +1 -0
- package/build/utils/port-check.test.js +66 -0
- package/build/utils/port-check.test.js.map +1 -0
- package/build/utils/selector-resolver.d.ts +66 -0
- package/build/utils/selector-resolver.d.ts.map +1 -0
- package/build/utils/selector-resolver.js +200 -0
- package/build/utils/selector-resolver.js.map +1 -0
- package/build/validation-helpers.d.ts +41 -0
- package/build/validation-helpers.d.ts.map +1 -0
- package/build/validation-helpers.js +236 -0
- package/build/validation-helpers.js.map +1 -0
- package/build/window-sizing.d.ts +26 -0
- package/build/window-sizing.d.ts.map +1 -0
- package/build/window-sizing.js +87 -0
- package/build/window-sizing.js.map +1 -0
- package/build/window-sizing.test.d.ts +8 -0
- package/build/window-sizing.test.d.ts.map +1 -0
- package/build/window-sizing.test.js +113 -0
- package/build/window-sizing.test.js.map +1 -0
- package/docs/README.md +74 -0
- package/docs/automation.md +562 -0
- package/docs/debugging.md +229 -0
- package/docs/installation.md +133 -0
- package/docs/instructions.md +227 -0
- package/docs/mcp-instructions.md +15 -0
- package/docs/message-system.md +327 -0
- package/docs/messages.md +3480 -0
- package/docs/parser-plugins.md +132 -0
- package/docs/replay.md +1411 -0
- package/docs/troubleshooting.md +272 -0
- package/docs/working_with_llm_notes.md +5 -0
- package/package.json +87 -0
- package/skills/devharness/SKILL.md +195 -0
- package/skills/devharness/references/sequences.md +613 -0
- package/skills/devharness/references/tool-categories.md +99 -0
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
// @vitest-environment node
|
|
2
|
+
/**
|
|
3
|
+
* Cancellation of the `input` tool (#110).
|
|
4
|
+
*
|
|
5
|
+
* IMPORTANT about what this can and cannot prove. Nothing in `input` is
|
|
6
|
+
* genuinely cancellable: `page.mouse.click` becomes an
|
|
7
|
+
* Input.dispatchMouseEvent, and once that is on the wire Chrome WILL process
|
|
8
|
+
* it. There is no CDP "un-click". So the win - and the only thing these tests
|
|
9
|
+
* assert - is that a cancelled step does NOT DISPATCH events that had not gone
|
|
10
|
+
* out yet, and that the handler stops with an abort-shaped error instead of
|
|
11
|
+
* carrying on to the end of a multi-event gesture.
|
|
12
|
+
*
|
|
13
|
+
* The `does not undo` test exists deliberately so nobody later reads the suite
|
|
14
|
+
* as a claim that cancellation rolls anything back.
|
|
15
|
+
*
|
|
16
|
+
* Every dispatch on the fake page is recorded, so "interrupted" means a
|
|
17
|
+
* SHORTER dispatch log, not merely an earlier return.
|
|
18
|
+
*/
|
|
19
|
+
import { describe, it, expect, vi, beforeEach } from 'vitest';
|
|
20
|
+
import { createInputTools } from './input-tools.js';
|
|
21
|
+
import { isAbortError } from '../utils/abort.js';
|
|
22
|
+
import { configManager } from '../config.js';
|
|
23
|
+
/**
|
|
24
|
+
* Fake page recording every input dispatch. `onDispatch` runs before each one
|
|
25
|
+
* is recorded, which is how a test aborts "mid-gesture" at a precise point.
|
|
26
|
+
*/
|
|
27
|
+
function makePage(opts = {}) {
|
|
28
|
+
const dispatches = [];
|
|
29
|
+
const record = (kind, ...args) => {
|
|
30
|
+
const d = { kind, args };
|
|
31
|
+
opts.onDispatch?.(d);
|
|
32
|
+
dispatches.push(d);
|
|
33
|
+
};
|
|
34
|
+
const page = {
|
|
35
|
+
url: () => 'https://example.test/page',
|
|
36
|
+
// Every page.evaluate in the handler is read-only introspection (focus
|
|
37
|
+
// info, click-handler sniffing, the replay-bypass flag) - never a dispatch.
|
|
38
|
+
evaluate: vi.fn(async (fn, ...args) => {
|
|
39
|
+
void fn;
|
|
40
|
+
void args;
|
|
41
|
+
return {};
|
|
42
|
+
}),
|
|
43
|
+
$: vi.fn(async () => (opts.elementExists === false ? null : {})),
|
|
44
|
+
click: vi.fn(async (...a) => record('page.click', ...a)),
|
|
45
|
+
type: vi.fn(async (...a) => record('page.type', ...a)),
|
|
46
|
+
hover: vi.fn(async (...a) => record('page.hover', ...a)),
|
|
47
|
+
focus: vi.fn(async (...a) => record('page.focus', ...a)),
|
|
48
|
+
mouse: {
|
|
49
|
+
click: vi.fn(async (...a) => record('mouse.click', ...a)),
|
|
50
|
+
move: vi.fn(async (...a) => record('mouse.move', ...a)),
|
|
51
|
+
down: vi.fn(async (...a) => record('mouse.down', ...a)),
|
|
52
|
+
up: vi.fn(async (...a) => record('mouse.up', ...a)),
|
|
53
|
+
wheel: vi.fn(async (...a) => record('mouse.wheel', ...a)),
|
|
54
|
+
},
|
|
55
|
+
keyboard: {
|
|
56
|
+
press: vi.fn(async (...a) => record('keyboard.press', ...a)),
|
|
57
|
+
down: vi.fn(async (...a) => record('keyboard.down', ...a)),
|
|
58
|
+
up: vi.fn(async (...a) => record('keyboard.up', ...a)),
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
return { page, dispatches };
|
|
62
|
+
}
|
|
63
|
+
function makeInput(page) {
|
|
64
|
+
const cdpManager = {
|
|
65
|
+
isConnected: () => true,
|
|
66
|
+
getRuntimeType: () => 'chrome',
|
|
67
|
+
isPaused: () => false,
|
|
68
|
+
getPausedInfo: () => ({ paused: false }),
|
|
69
|
+
getClient: () => ({ send: vi.fn(async () => ({})) }),
|
|
70
|
+
// executeWithPauseDetection races the action against this; never pausing
|
|
71
|
+
// means the action's own outcome always wins.
|
|
72
|
+
waitForPause: () => new Promise(() => { }),
|
|
73
|
+
};
|
|
74
|
+
const puppeteerManager = {
|
|
75
|
+
isConnected: () => true,
|
|
76
|
+
getPage: () => page,
|
|
77
|
+
};
|
|
78
|
+
const resolve = async () => ({
|
|
79
|
+
connection: { port: undefined },
|
|
80
|
+
cdpManager,
|
|
81
|
+
puppeteerManager,
|
|
82
|
+
consoleMonitor: {},
|
|
83
|
+
networkMonitor: {},
|
|
84
|
+
});
|
|
85
|
+
const { input } = createInputTools(puppeteerManager, cdpManager, {}, resolve);
|
|
86
|
+
return input;
|
|
87
|
+
}
|
|
88
|
+
/** Run the handler and reify the outcome (abort-shaped throws included). */
|
|
89
|
+
async function callInput(input, args, signal) {
|
|
90
|
+
try {
|
|
91
|
+
return { threw: false, result: await input.handler(args, signal) };
|
|
92
|
+
}
|
|
93
|
+
catch (err) {
|
|
94
|
+
return { threw: true, err };
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
beforeEach(() => {
|
|
98
|
+
// DOM-change detection would add page.evaluate traffic and a settle wait;
|
|
99
|
+
// these tests are about dispatches, so keep it off unless a test opts in.
|
|
100
|
+
vi.spyOn(configManager, 'getChangeDetectionConfig').mockReturnValue({
|
|
101
|
+
enabled: false,
|
|
102
|
+
settleTimeout: 0,
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
describe('input: abort before dispatch means ZERO dispatches', () => {
|
|
106
|
+
it('click by selector dispatches nothing when already aborted', async () => {
|
|
107
|
+
const { page, dispatches } = makePage();
|
|
108
|
+
const input = makeInput(page);
|
|
109
|
+
const controller = new AbortController();
|
|
110
|
+
controller.abort();
|
|
111
|
+
const outcome = await callInput(input, { action: 'click', selector: '#go', connectionReason: 'app' }, controller.signal);
|
|
112
|
+
expect(outcome.threw).toBe(true);
|
|
113
|
+
expect(isAbortError(outcome.err)).toBe(true);
|
|
114
|
+
expect(dispatches).toEqual([]);
|
|
115
|
+
expect(page.click).not.toHaveBeenCalled();
|
|
116
|
+
});
|
|
117
|
+
it('coordinate click dispatches nothing when already aborted', async () => {
|
|
118
|
+
const { page, dispatches } = makePage();
|
|
119
|
+
const input = makeInput(page);
|
|
120
|
+
const controller = new AbortController();
|
|
121
|
+
controller.abort();
|
|
122
|
+
const outcome = await callInput(input, { action: 'click', x: 10, y: 20, connectionReason: 'app' }, controller.signal);
|
|
123
|
+
expect(outcome.threw).toBe(true);
|
|
124
|
+
expect(dispatches).toEqual([]);
|
|
125
|
+
expect(page.mouse.click).not.toHaveBeenCalled();
|
|
126
|
+
});
|
|
127
|
+
it.each([
|
|
128
|
+
['type', { action: 'type', selector: '#field', text: 'hello' }],
|
|
129
|
+
['press', { action: 'press', key: 'Enter' }],
|
|
130
|
+
['hover', { action: 'hover', selector: '#thing' }],
|
|
131
|
+
['focus', { action: 'focus', selector: '#thing' }],
|
|
132
|
+
['focusNext', { action: 'focusNext' }],
|
|
133
|
+
['focusPrevious', { action: 'focusPrevious' }],
|
|
134
|
+
['drag', { action: 'drag', from: { x: 0, y: 0 }, to: { x: 50, y: 50 } }],
|
|
135
|
+
['scroll', { action: 'scroll', deltaY: 300 }],
|
|
136
|
+
['mousemove', { action: 'mousemove', x: 5, y: 5 }],
|
|
137
|
+
['pinch', { action: 'pinch', scale: 2 }],
|
|
138
|
+
])('%s dispatches nothing when already aborted', async (_name, args) => {
|
|
139
|
+
const { page, dispatches } = makePage();
|
|
140
|
+
const input = makeInput(page);
|
|
141
|
+
const controller = new AbortController();
|
|
142
|
+
controller.abort();
|
|
143
|
+
const outcome = await callInput(input, { ...args, connectionReason: 'app' }, controller.signal);
|
|
144
|
+
expect(outcome.threw).toBe(true);
|
|
145
|
+
expect(isAbortError(outcome.err)).toBe(true);
|
|
146
|
+
expect(dispatches).toEqual([]);
|
|
147
|
+
});
|
|
148
|
+
});
|
|
149
|
+
describe('input: multi-dispatch paths stop mid-gesture', () => {
|
|
150
|
+
it('focusNext stops Tabbing after the abort instead of pressing all 5', async () => {
|
|
151
|
+
const controller = new AbortController();
|
|
152
|
+
const { page, dispatches } = makePage({
|
|
153
|
+
onDispatch: (d) => {
|
|
154
|
+
// Cancel once two Tabs have gone out.
|
|
155
|
+
if (d.kind === 'keyboard.press' && dispatches.length === 2)
|
|
156
|
+
controller.abort();
|
|
157
|
+
},
|
|
158
|
+
});
|
|
159
|
+
const input = makeInput(page);
|
|
160
|
+
const outcome = await callInput(input, { action: 'focusNext', count: 5, connectionReason: 'app' }, controller.signal);
|
|
161
|
+
expect(outcome.threw).toBe(true);
|
|
162
|
+
expect(isAbortError(outcome.err)).toBe(true);
|
|
163
|
+
const tabs = dispatches.filter((d) => d.kind === 'keyboard.press').length;
|
|
164
|
+
// 3 = the two before the cancel plus the one that was already in flight.
|
|
165
|
+
expect(tabs).toBe(3);
|
|
166
|
+
expect(tabs).toBeLessThan(5);
|
|
167
|
+
});
|
|
168
|
+
it('drag stops stepping and releases the button rather than leaving it held', async () => {
|
|
169
|
+
const controller = new AbortController();
|
|
170
|
+
const { page, dispatches } = makePage({
|
|
171
|
+
onDispatch: (d) => {
|
|
172
|
+
if (d.kind === 'mouse.move' && dispatches.filter((x) => x.kind === 'mouse.move').length === 3) {
|
|
173
|
+
controller.abort();
|
|
174
|
+
}
|
|
175
|
+
},
|
|
176
|
+
});
|
|
177
|
+
const input = makeInput(page);
|
|
178
|
+
const outcome = await callInput(input, { action: 'drag', from: { x: 0, y: 0 }, to: { x: 100, y: 0 }, steps: 20, connectionReason: 'app' }, controller.signal);
|
|
179
|
+
expect(outcome.threw).toBe(true);
|
|
180
|
+
expect(isAbortError(outcome.err)).toBe(true);
|
|
181
|
+
const moves = dispatches.filter((d) => d.kind === 'mouse.move').length;
|
|
182
|
+
// Interruption, not completion: far fewer than the 1 initial + 20 stepped moves.
|
|
183
|
+
expect(moves).toBeLessThan(21);
|
|
184
|
+
// The button must not be left down on a cancelled drag.
|
|
185
|
+
expect(dispatches.some((d) => d.kind === 'mouse.down')).toBe(true);
|
|
186
|
+
expect(dispatches.some((d) => d.kind === 'mouse.up')).toBe(true);
|
|
187
|
+
});
|
|
188
|
+
it('type stops between the clear and the retype (clear stays applied)', async () => {
|
|
189
|
+
const controller = new AbortController();
|
|
190
|
+
const { page, dispatches } = makePage({
|
|
191
|
+
onDispatch: (d) => {
|
|
192
|
+
// Abort right after the triple-click + Backspace that clears the field.
|
|
193
|
+
if (d.kind === 'keyboard.press' && d.args[0] === 'Backspace')
|
|
194
|
+
controller.abort();
|
|
195
|
+
},
|
|
196
|
+
});
|
|
197
|
+
const input = makeInput(page);
|
|
198
|
+
const outcome = await callInput(input, { action: 'type', selector: '#field', text: 'new value', connectionReason: 'app' }, controller.signal);
|
|
199
|
+
expect(outcome.threw).toBe(true);
|
|
200
|
+
expect(isAbortError(outcome.err)).toBe(true);
|
|
201
|
+
// The clear went out and stays out; the new text never got dispatched.
|
|
202
|
+
expect(dispatches.some((d) => d.kind === 'keyboard.press' && d.args[0] === 'Backspace')).toBe(true);
|
|
203
|
+
expect(page.type).not.toHaveBeenCalled();
|
|
204
|
+
});
|
|
205
|
+
});
|
|
206
|
+
describe('input: cancellation does NOT undo what was already dispatched', () => {
|
|
207
|
+
it('a click already issued is never retracted - no compensating dispatch is sent', async () => {
|
|
208
|
+
const controller = new AbortController();
|
|
209
|
+
const { page, dispatches } = makePage({
|
|
210
|
+
onDispatch: (d) => {
|
|
211
|
+
// Cancel the instant the click is handed to the page.
|
|
212
|
+
if (d.kind === 'page.click')
|
|
213
|
+
controller.abort();
|
|
214
|
+
},
|
|
215
|
+
});
|
|
216
|
+
const input = makeInput(page);
|
|
217
|
+
await callInput(input, { action: 'click', selector: '#submit', connectionReason: 'app' }, controller.signal);
|
|
218
|
+
// The click IS recorded - Chrome already has it, and cancellation cannot
|
|
219
|
+
// and does not take it back.
|
|
220
|
+
expect(dispatches.filter((d) => d.kind === 'page.click')).toHaveLength(1);
|
|
221
|
+
// And nothing "undoing" it was sent afterwards: no second click, no
|
|
222
|
+
// synthetic Escape, no navigation. The dispatch log ends at the click.
|
|
223
|
+
const after = dispatches.slice(dispatches.findIndex((d) => d.kind === 'page.click') + 1);
|
|
224
|
+
expect(after).toEqual([]);
|
|
225
|
+
});
|
|
226
|
+
});
|
|
227
|
+
//# sourceMappingURL=input-abort.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input-abort.test.js","sourceRoot":"","sources":["../../src/tools/input-abort.test.ts"],"names":[],"mappings":"AAAA,2BAA2B;AAC3B;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAC9D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CAAC,CAAC;IAC5B,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input-ambiguous-selector.test.d.ts","sourceRoot":"","sources":["../../src/tools/input-ambiguous-selector.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { ambiguousSelectorWarning } from './input-tools.js';
|
|
3
|
+
/** Minimal page stand-in. `evaluate` is what the rest of input-tools uses, so the
|
|
4
|
+
* stub matches the real surface rather than a convenient one. */
|
|
5
|
+
const pageMatching = (count) => ({
|
|
6
|
+
evaluate: async (_fn, _selector) => count,
|
|
7
|
+
});
|
|
8
|
+
describe('ambiguousSelectorWarning', () => {
|
|
9
|
+
it('says nothing when the selector matches exactly one element', async () => {
|
|
10
|
+
await expect(ambiguousSelectorWarning(pageMatching(1), 'button', 'button')).resolves.toBeUndefined();
|
|
11
|
+
});
|
|
12
|
+
it('says nothing when the selector matches none — that is the action\'s own error', async () => {
|
|
13
|
+
await expect(ambiguousSelectorWarning(pageMatching(0), 'button', 'button')).resolves.toBeUndefined();
|
|
14
|
+
});
|
|
15
|
+
it('reports the count and that the first was used', async () => {
|
|
16
|
+
const warning = await ambiguousSelectorWarning(pageMatching(6), 'button', 'button[aria-label="Use"]');
|
|
17
|
+
expect(warning).toContain('6');
|
|
18
|
+
expect(warning).toMatch(/first/i);
|
|
19
|
+
});
|
|
20
|
+
it('quotes the RAW selector, not the resolved one', async () => {
|
|
21
|
+
// :has-text() is rewritten before the action runs; echoing the rewritten
|
|
22
|
+
// form back would show the caller a selector they never wrote.
|
|
23
|
+
const warning = await ambiguousSelectorWarning(pageMatching(3), '.resolved-xyz', ':has-text("Use")');
|
|
24
|
+
expect(warning).toContain(':has-text("Use")');
|
|
25
|
+
expect(warning).not.toContain('.resolved-xyz');
|
|
26
|
+
});
|
|
27
|
+
it('stays quiet when the page cannot evaluate the selector', async () => {
|
|
28
|
+
// An invalid selector is reported by the action itself; this helper must not
|
|
29
|
+
// turn a counting failure into a spurious warning.
|
|
30
|
+
const page = { evaluate: async () => { throw new Error('invalid selector'); } };
|
|
31
|
+
await expect(ambiguousSelectorWarning(page, '((', '((')).resolves.toBeUndefined();
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
//# sourceMappingURL=input-ambiguous-selector.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input-ambiguous-selector.test.js","sourceRoot":"","sources":["../../src/tools/input-ambiguous-selector.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAE5D;kEACkE;AAClE,MAAM,YAAY,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,CAAC;IACvC,QAAQ,EAAE,KAAK,EAAE,GAA4B,EAAE,SAAiB,EAAE,EAAE,CAAC,KAAK;CAC3E,CAAC,CAAC;AAEH,QAAQ,CAAC,0BAA0B,EAAE,GAAG,EAAE;IACxC,EAAE,CAAC,4DAA4D,EAAE,KAAK,IAAI,EAAE;QAC1E,MAAM,MAAM,CAAC,wBAAwB,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,aAAa,EAAE,CAAC;IACvG,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,+EAA+E,EAAE,KAAK,IAAI,EAAE;QAC7F,MAAM,MAAM,CAAC,wBAAwB,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,aAAa,EAAE,CAAC;IACvG,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,+CAA+C,EAAE,KAAK,IAAI,EAAE;QAC7D,MAAM,OAAO,GAAG,MAAM,wBAAwB,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,0BAA0B,CAAC,CAAC;QACtG,MAAM,CAAC,OAAO,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;QAC/B,MAAM,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACpC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,+CAA+C,EAAE,KAAK,IAAI,EAAE;QAC7D,yEAAyE;QACzE,+DAA+D;QAC/D,MAAM,OAAO,GAAG,MAAM,wBAAwB,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,eAAe,EAAE,kBAAkB,CAAC,CAAC;QACrG,MAAM,CAAC,OAAO,CAAC,CAAC,SAAS,CAAC,kBAAkB,CAAC,CAAC;QAC9C,MAAM,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,eAAe,CAAC,CAAC;IACjD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,wDAAwD,EAAE,KAAK,IAAI,EAAE;QACtE,6EAA6E;QAC7E,mDAAmD;QACnD,MAAM,IAAI,GAAG,EAAE,QAAQ,EAAE,KAAK,IAAI,EAAE,GAAG,MAAM,IAAI,KAAK,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAChF,MAAM,MAAM,CAAC,wBAAwB,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,aAAa,EAAE,CAAC;IACpF,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Input Automation Tools
|
|
3
|
+
*/
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import type { CDPManager } from '../cdp-manager.js';
|
|
6
|
+
import { PuppeteerManager } from '../puppeteer-manager.js';
|
|
7
|
+
import type { ConnectionManager } from '../connection-manager.js';
|
|
8
|
+
/**
|
|
9
|
+
* Warning text when a selector matches more than one element.
|
|
10
|
+
*
|
|
11
|
+
* The action takes the first match. On a list UI that silently drifts onto the
|
|
12
|
+
* wrong row as the list grows, and the step still reports success - so the
|
|
13
|
+
* count has to be said out loud even though the action succeeded.
|
|
14
|
+
*
|
|
15
|
+
* Advisory only: a selector the browser rejects is the action's error to
|
|
16
|
+
* report, not this helper's.
|
|
17
|
+
*/
|
|
18
|
+
export declare function ambiguousSelectorWarning(page: any, selector: string, raw: string): Promise<string | undefined>;
|
|
19
|
+
export declare function createInputTools(puppeteerManager: PuppeteerManager, cdpManager: CDPManager, connectionManager: ConnectionManager, resolveConnectionFromReason: (connectionReason: string) => Promise<any>): {
|
|
20
|
+
input: {
|
|
21
|
+
description: string;
|
|
22
|
+
zodSchema: z.ZodObject<{
|
|
23
|
+
action: z.ZodEnum<["click", "type", "press", "hover", "focus", "focusNext", "focusPrevious", "drag", "scroll", "mousemove", "pinch", "tap", "swipe"]>;
|
|
24
|
+
connectionReason: z.ZodString;
|
|
25
|
+
selector: z.ZodOptional<z.ZodString>;
|
|
26
|
+
handleModals: z.ZodOptional<z.ZodBoolean>;
|
|
27
|
+
dismissStrategy: z.ZodOptional<z.ZodEnum<["accept", "reject", "close", "remove", "auto"]>>;
|
|
28
|
+
clickCount: z.ZodOptional<z.ZodNumber>;
|
|
29
|
+
text: z.ZodOptional<z.ZodString>;
|
|
30
|
+
delay: z.ZodOptional<z.ZodNumber>;
|
|
31
|
+
append: z.ZodOptional<z.ZodBoolean>;
|
|
32
|
+
key: z.ZodOptional<z.ZodString>;
|
|
33
|
+
count: z.ZodOptional<z.ZodNumber>;
|
|
34
|
+
from: z.ZodOptional<z.ZodObject<{
|
|
35
|
+
x: z.ZodNumber;
|
|
36
|
+
y: z.ZodNumber;
|
|
37
|
+
}, "strip", z.ZodTypeAny, {
|
|
38
|
+
x: number;
|
|
39
|
+
y: number;
|
|
40
|
+
}, {
|
|
41
|
+
x: number;
|
|
42
|
+
y: number;
|
|
43
|
+
}>>;
|
|
44
|
+
to: z.ZodOptional<z.ZodObject<{
|
|
45
|
+
x: z.ZodNumber;
|
|
46
|
+
y: z.ZodNumber;
|
|
47
|
+
}, "strip", z.ZodTypeAny, {
|
|
48
|
+
x: number;
|
|
49
|
+
y: number;
|
|
50
|
+
}, {
|
|
51
|
+
x: number;
|
|
52
|
+
y: number;
|
|
53
|
+
}>>;
|
|
54
|
+
steps: z.ZodOptional<z.ZodNumber>;
|
|
55
|
+
direction: z.ZodOptional<z.ZodEnum<["left", "right", "up", "down"]>>;
|
|
56
|
+
distance: z.ZodOptional<z.ZodNumber>;
|
|
57
|
+
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
58
|
+
deltaX: z.ZodOptional<z.ZodNumber>;
|
|
59
|
+
deltaY: z.ZodOptional<z.ZodNumber>;
|
|
60
|
+
x: z.ZodOptional<z.ZodNumber>;
|
|
61
|
+
y: z.ZodOptional<z.ZodNumber>;
|
|
62
|
+
scaleFactor: z.ZodOptional<z.ZodNumber>;
|
|
63
|
+
detectChanges: z.ZodOptional<z.ZodBoolean>;
|
|
64
|
+
settleTimeout: z.ZodOptional<z.ZodNumber>;
|
|
65
|
+
}, "strict", z.ZodTypeAny, {
|
|
66
|
+
action: "type" | "click" | "hover" | "press" | "focus" | "focusNext" | "focusPrevious" | "drag" | "scroll" | "mousemove" | "pinch" | "tap" | "swipe";
|
|
67
|
+
connectionReason: string;
|
|
68
|
+
count?: number | undefined;
|
|
69
|
+
key?: string | undefined;
|
|
70
|
+
to?: {
|
|
71
|
+
x: number;
|
|
72
|
+
y: number;
|
|
73
|
+
} | undefined;
|
|
74
|
+
x?: number | undefined;
|
|
75
|
+
text?: string | undefined;
|
|
76
|
+
selector?: string | undefined;
|
|
77
|
+
delay?: number | undefined;
|
|
78
|
+
y?: number | undefined;
|
|
79
|
+
durationMs?: number | undefined;
|
|
80
|
+
from?: {
|
|
81
|
+
x: number;
|
|
82
|
+
y: number;
|
|
83
|
+
} | undefined;
|
|
84
|
+
append?: boolean | undefined;
|
|
85
|
+
handleModals?: boolean | undefined;
|
|
86
|
+
dismissStrategy?: "close" | "remove" | "auto" | "accept" | "reject" | undefined;
|
|
87
|
+
clickCount?: number | undefined;
|
|
88
|
+
steps?: number | undefined;
|
|
89
|
+
direction?: "up" | "down" | "left" | "right" | undefined;
|
|
90
|
+
distance?: number | undefined;
|
|
91
|
+
deltaX?: number | undefined;
|
|
92
|
+
deltaY?: number | undefined;
|
|
93
|
+
scaleFactor?: number | undefined;
|
|
94
|
+
detectChanges?: boolean | undefined;
|
|
95
|
+
settleTimeout?: number | undefined;
|
|
96
|
+
}, {
|
|
97
|
+
action: "type" | "click" | "hover" | "press" | "focus" | "focusNext" | "focusPrevious" | "drag" | "scroll" | "mousemove" | "pinch" | "tap" | "swipe";
|
|
98
|
+
connectionReason: string;
|
|
99
|
+
count?: number | undefined;
|
|
100
|
+
key?: string | undefined;
|
|
101
|
+
to?: {
|
|
102
|
+
x: number;
|
|
103
|
+
y: number;
|
|
104
|
+
} | undefined;
|
|
105
|
+
x?: number | undefined;
|
|
106
|
+
text?: string | undefined;
|
|
107
|
+
selector?: string | undefined;
|
|
108
|
+
delay?: number | undefined;
|
|
109
|
+
y?: number | undefined;
|
|
110
|
+
durationMs?: number | undefined;
|
|
111
|
+
from?: {
|
|
112
|
+
x: number;
|
|
113
|
+
y: number;
|
|
114
|
+
} | undefined;
|
|
115
|
+
append?: boolean | undefined;
|
|
116
|
+
handleModals?: boolean | undefined;
|
|
117
|
+
dismissStrategy?: "close" | "remove" | "auto" | "accept" | "reject" | undefined;
|
|
118
|
+
clickCount?: number | undefined;
|
|
119
|
+
steps?: number | undefined;
|
|
120
|
+
direction?: "up" | "down" | "left" | "right" | undefined;
|
|
121
|
+
distance?: number | undefined;
|
|
122
|
+
deltaX?: number | undefined;
|
|
123
|
+
deltaY?: number | undefined;
|
|
124
|
+
scaleFactor?: number | undefined;
|
|
125
|
+
detectChanges?: boolean | undefined;
|
|
126
|
+
settleTimeout?: number | undefined;
|
|
127
|
+
}>;
|
|
128
|
+
inputSchema: import("zod-to-json-schema").JsonSchema7Type & {
|
|
129
|
+
$schema?: string | undefined;
|
|
130
|
+
definitions?: {
|
|
131
|
+
[key: string]: import("zod-to-json-schema").JsonSchema7Type;
|
|
132
|
+
} | undefined;
|
|
133
|
+
};
|
|
134
|
+
handler: (args: {
|
|
135
|
+
action: "type" | "click" | "hover" | "press" | "focus" | "focusNext" | "focusPrevious" | "drag" | "scroll" | "mousemove" | "pinch" | "tap" | "swipe";
|
|
136
|
+
connectionReason: string;
|
|
137
|
+
count?: number | undefined;
|
|
138
|
+
key?: string | undefined;
|
|
139
|
+
to?: {
|
|
140
|
+
x: number;
|
|
141
|
+
y: number;
|
|
142
|
+
} | undefined;
|
|
143
|
+
x?: number | undefined;
|
|
144
|
+
text?: string | undefined;
|
|
145
|
+
selector?: string | undefined;
|
|
146
|
+
delay?: number | undefined;
|
|
147
|
+
y?: number | undefined;
|
|
148
|
+
durationMs?: number | undefined;
|
|
149
|
+
from?: {
|
|
150
|
+
x: number;
|
|
151
|
+
y: number;
|
|
152
|
+
} | undefined;
|
|
153
|
+
append?: boolean | undefined;
|
|
154
|
+
handleModals?: boolean | undefined;
|
|
155
|
+
dismissStrategy?: "close" | "remove" | "auto" | "accept" | "reject" | undefined;
|
|
156
|
+
clickCount?: number | undefined;
|
|
157
|
+
steps?: number | undefined;
|
|
158
|
+
direction?: "up" | "down" | "left" | "right" | undefined;
|
|
159
|
+
distance?: number | undefined;
|
|
160
|
+
deltaX?: number | undefined;
|
|
161
|
+
deltaY?: number | undefined;
|
|
162
|
+
scaleFactor?: number | undefined;
|
|
163
|
+
detectChanges?: boolean | undefined;
|
|
164
|
+
settleTimeout?: number | undefined;
|
|
165
|
+
}, abortSignal?: AbortSignal) => Promise<any>;
|
|
166
|
+
};
|
|
167
|
+
};
|
|
168
|
+
//# sourceMappingURL=input-tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input-tools.d.ts","sourceRoot":"","sources":["../../src/tools/input-tools.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAwFlE;;;;;;;;;GASG;AACH,wBAAsB,wBAAwB,CAAC,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAapH;AAED,wBAAgB,gBAAgB,CAC9B,gBAAgB,EAAE,gBAAgB,EAClC,UAAU,EAAE,UAAU,EACtB,iBAAiB,EAAE,iBAAiB,EACpC,2BAA2B,EAAE,CAAC,gBAAgB,EAAE,MAAM,KAAK,OAAO,CAAC,GAAG,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAk3CxE"}
|