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 @@
|
|
|
1
|
+
{"version":3,"file":"replay-declare.test.d.ts","sourceRoot":"","sources":["../../src/tools/replay-declare.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `declare` is the authoring route for what a sequence NEEDS, as opposed to
|
|
3
|
+
* what it does: the browsers (`requiredConnections`) and the sockets its
|
|
4
|
+
* assertions ride on (`requiredSockets`).
|
|
5
|
+
*
|
|
6
|
+
* Neither can be recorded - they are statements about a run, not steps in it -
|
|
7
|
+
* so before this the only way to add them was to hand-edit the JSON, which the
|
|
8
|
+
* rest of the guidance tells you not to do.
|
|
9
|
+
*/
|
|
10
|
+
import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest';
|
|
11
|
+
import { promises as fs } from 'fs';
|
|
12
|
+
import { tmpdir } from 'os';
|
|
13
|
+
import { join } from 'path';
|
|
14
|
+
import { CommandRecorder } from '../command-recorder.js';
|
|
15
|
+
import { createReplayTools } from './replay-tools.js';
|
|
16
|
+
import { productionShaped } from '../test-support/fake-execute-tool-call.js';
|
|
17
|
+
let dir;
|
|
18
|
+
let recorder;
|
|
19
|
+
let replay;
|
|
20
|
+
beforeEach(async () => {
|
|
21
|
+
dir = await fs.mkdtemp(join(tmpdir(), 'cdp-declare-'));
|
|
22
|
+
recorder = new CommandRecorder();
|
|
23
|
+
vi.spyOn(recorder, 'getSequencesDir').mockReturnValue(dir);
|
|
24
|
+
await fs.writeFile(join(dir, 'duo-flow.json'), JSON.stringify({
|
|
25
|
+
id: 'seq-duo', name: 'duo-flow', createdAt: 1,
|
|
26
|
+
commands: [{ tool: 'dom', params: { action: 'querySelector', selector: '#a' } }],
|
|
27
|
+
}));
|
|
28
|
+
await recorder.loadSequenceFromDisk(join(dir, 'duo-flow.json'));
|
|
29
|
+
({ replay } = createReplayTools(recorder, vi.fn(productionShaped(async () => ({ content: [{ type: 'text', text: '' }] }))), async () => null, async () => 9222, undefined));
|
|
30
|
+
});
|
|
31
|
+
afterEach(async () => {
|
|
32
|
+
recorder.stopSequenceWatch();
|
|
33
|
+
await fs.rm(dir, { recursive: true, force: true });
|
|
34
|
+
});
|
|
35
|
+
const declare = (params) => replay.handler({ action: 'declare', name: 'duo-flow', ...params });
|
|
36
|
+
const text = (res) => res.content[0].text;
|
|
37
|
+
const onDisk = async () => JSON.parse(await fs.readFile(join(dir, 'duo-flow.json'), 'utf-8'));
|
|
38
|
+
describe('declare', () => {
|
|
39
|
+
it('records the browsers a sequence needs, and writes them back to its file', async () => {
|
|
40
|
+
const res = await declare({
|
|
41
|
+
requiredConnections: [
|
|
42
|
+
{ reference: 'duo-member-two', profile: 'device-a', role: 'the enrolled member' },
|
|
43
|
+
],
|
|
44
|
+
});
|
|
45
|
+
expect(text(res)).toContain('duo-member-two');
|
|
46
|
+
expect(text(res)).toContain('device-a');
|
|
47
|
+
expect((await onDisk()).requiredConnections).toEqual([
|
|
48
|
+
{ reference: 'duo-member-two', profile: 'device-a', role: 'the enrolled member' },
|
|
49
|
+
]);
|
|
50
|
+
});
|
|
51
|
+
it('records the sockets the assertions ride on', async () => {
|
|
52
|
+
await declare({ requiredSockets: ['/api/sync/socket'] });
|
|
53
|
+
expect((await onDisk()).requiredSockets).toEqual(['/api/sync/socket']);
|
|
54
|
+
});
|
|
55
|
+
it('replaces rather than merges, so a browser can be removed', async () => {
|
|
56
|
+
await declare({ requiredConnections: [{ reference: 'device-one' }, { reference: 'device-two' }] });
|
|
57
|
+
await declare({ requiredConnections: [{ reference: 'device-one' }] });
|
|
58
|
+
expect((await onDisk()).requiredConnections).toEqual([{ reference: 'device-one' }]);
|
|
59
|
+
});
|
|
60
|
+
it('clears a declaration with an empty list', async () => {
|
|
61
|
+
await declare({ requiredSockets: ['/api/sync/socket'] });
|
|
62
|
+
await declare({ requiredSockets: [] });
|
|
63
|
+
expect((await onDisk()).requiredSockets).toBeUndefined();
|
|
64
|
+
});
|
|
65
|
+
it('leaves the other declaration alone', async () => {
|
|
66
|
+
await declare({ requiredSockets: ['/api/sync/socket'] });
|
|
67
|
+
await declare({ requiredConnections: [{ reference: 'device-one' }] });
|
|
68
|
+
const saved = await onDisk();
|
|
69
|
+
expect(saved.requiredSockets).toEqual(['/api/sync/socket']);
|
|
70
|
+
expect(saved.requiredConnections).toEqual([{ reference: 'device-one' }]);
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
describe('declarations that cannot mean what they say are refused at authoring time', () => {
|
|
74
|
+
it('refuses two references on one profile', async () => {
|
|
75
|
+
const res = await declare({
|
|
76
|
+
requiredConnections: [
|
|
77
|
+
{ reference: 'device-one', profile: 'shared' },
|
|
78
|
+
{ reference: 'device-two', profile: 'shared' },
|
|
79
|
+
],
|
|
80
|
+
});
|
|
81
|
+
expect(text(res)).toContain('same persistent profile "shared"');
|
|
82
|
+
expect((await onDisk()).requiredConnections).toBeUndefined();
|
|
83
|
+
});
|
|
84
|
+
it('refuses the same reference twice', async () => {
|
|
85
|
+
const res = await declare({
|
|
86
|
+
requiredConnections: [{ reference: 'device-one' }, { reference: 'device-one' }],
|
|
87
|
+
});
|
|
88
|
+
expect(text(res)).toContain('declared twice');
|
|
89
|
+
});
|
|
90
|
+
it('refuses a profile name that is not a safe directory segment', async () => {
|
|
91
|
+
const res = await declare({
|
|
92
|
+
requiredConnections: [{ reference: 'device-one', profile: '../escape' }],
|
|
93
|
+
});
|
|
94
|
+
expect(text(res)).toContain('Invalid profile name');
|
|
95
|
+
});
|
|
96
|
+
it('refuses an empty socket pattern, which would match every socket', async () => {
|
|
97
|
+
const res = await declare({ requiredSockets: [' '] });
|
|
98
|
+
expect(text(res)).toContain('matches every socket');
|
|
99
|
+
});
|
|
100
|
+
it('says what it needs when given neither list', async () => {
|
|
101
|
+
const res = await declare({});
|
|
102
|
+
expect(text(res)).toContain('requiredConnections');
|
|
103
|
+
expect(text(res)).toContain('requiredSockets');
|
|
104
|
+
});
|
|
105
|
+
});
|
|
106
|
+
//# sourceMappingURL=replay-declare.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"replay-declare.test.js","sourceRoot":"","sources":["../../src/tools/replay-declare.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AACzE,OA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-browser-cleanup.test.d.ts","sourceRoot":"","sources":["../../src/tools/replay-declared-browser-cleanup.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The browsers a sequence DECLARES (`requiredConnections`) are launched by the
|
|
3
|
+
* run, so the run owns them and every terminal outcome closes them. Pause is
|
|
4
|
+
* the single exception - those browsers are the state someone stopped to look
|
|
5
|
+
* at - but every exit from a pause is terminal and pays the debt.
|
|
6
|
+
*
|
|
7
|
+
* Both gaps this covers were silent: the browser stayed up and the next run
|
|
8
|
+
* reused it carrying the previous run's state, which reads as a broken
|
|
9
|
+
* sequence rather than a stale browser (issues #127, #137).
|
|
10
|
+
*/
|
|
11
|
+
import { describe, it, expect, vi } from 'vitest';
|
|
12
|
+
import { createReplayTools } from './replay-tools.js';
|
|
13
|
+
import { productionShaped } from '../test-support/fake-execute-tool-call.js';
|
|
14
|
+
const PORTS = {
|
|
15
|
+
'run-device': 9222,
|
|
16
|
+
'declared-b': 9333,
|
|
17
|
+
};
|
|
18
|
+
function makeReplay(commands) {
|
|
19
|
+
const sequence = {
|
|
20
|
+
id: 'seq-declared',
|
|
21
|
+
name: 'declared-seq',
|
|
22
|
+
commands,
|
|
23
|
+
createdAt: 1,
|
|
24
|
+
requiredConnections: [{ reference: 'declared-b' }],
|
|
25
|
+
};
|
|
26
|
+
let activeSequence = null;
|
|
27
|
+
const recorder = {
|
|
28
|
+
getSequence: vi.fn(() => sequence),
|
|
29
|
+
getFreshSequence: vi.fn(async () => sequence),
|
|
30
|
+
listSequences: vi.fn(() => [sequence]),
|
|
31
|
+
loadSequenceFromDisk: vi.fn(async () => sequence),
|
|
32
|
+
getHistory: vi.fn(() => []),
|
|
33
|
+
getCurrentHistoryIndex: vi.fn(() => 0),
|
|
34
|
+
recordCommand: vi.fn(),
|
|
35
|
+
getActiveSequence: vi.fn(() => activeSequence),
|
|
36
|
+
setActiveSequence: vi.fn((s) => { activeSequence = s; }),
|
|
37
|
+
getCommandsSincePause: vi.fn(() => []),
|
|
38
|
+
};
|
|
39
|
+
const calls = [];
|
|
40
|
+
const executeToolCall = vi.fn(productionShaped(async (tool, params) => {
|
|
41
|
+
calls.push({ tool, params });
|
|
42
|
+
if (tool === 'listConnections') {
|
|
43
|
+
return {
|
|
44
|
+
content: [{
|
|
45
|
+
type: 'text',
|
|
46
|
+
text: `Active debugger connections\n\n\`\`\`json\n${JSON.stringify({
|
|
47
|
+
connections: Object.entries(PORTS).map(([reference, port]) => ({ reference, port })),
|
|
48
|
+
}, null, 2)}\n\`\`\``,
|
|
49
|
+
}],
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
return { content: [{ type: 'text', text: '' }] };
|
|
53
|
+
}));
|
|
54
|
+
const { replay } = createReplayTools(recorder, executeToolCall, async () => null, async (reference) => PORTS[reference] ?? null, undefined);
|
|
55
|
+
return { replay, calls };
|
|
56
|
+
}
|
|
57
|
+
const killedPorts = (calls) => calls.filter(c => c.tool === 'killChrome').map(c => c.params.port);
|
|
58
|
+
const twoSteps = [
|
|
59
|
+
{ tool: 'dom', params: { action: 'querySelector', selector: '#a' } },
|
|
60
|
+
{ tool: 'dom', params: { action: 'querySelector', selector: '#b' } },
|
|
61
|
+
];
|
|
62
|
+
describe('declared browsers', () => {
|
|
63
|
+
it('are closed when a cancel ends a paused run', async () => {
|
|
64
|
+
const { replay, calls } = makeReplay(twoSteps);
|
|
65
|
+
const paused = await replay.handler({
|
|
66
|
+
action: 'run', wait: true, sequenceId: 'seq-declared',
|
|
67
|
+
connectionReason: 'run-device', stepTo: 1,
|
|
68
|
+
});
|
|
69
|
+
expect(paused.content[0].text).toMatch(/paus/i);
|
|
70
|
+
expect(calls.some(c => c.tool === 'launchChrome' && c.params.reference === 'declared-b')).toBe(true);
|
|
71
|
+
// A pause keeps them: that is the state the user stopped to inspect.
|
|
72
|
+
expect(killedPorts(calls)).not.toContain(PORTS['declared-b']);
|
|
73
|
+
await replay.handler({ action: 'cancel' });
|
|
74
|
+
expect(killedPorts(calls)).toContain(PORTS['declared-b']);
|
|
75
|
+
// The reference is released too, or the next run declaring it launches
|
|
76
|
+
// against a browser that no longer exists.
|
|
77
|
+
expect(calls.some(c => c.tool === 'disconnectDebugger' && c.params.reference === 'declared-b')).toBe(true);
|
|
78
|
+
});
|
|
79
|
+
it('are closed when finish ends a paused run', async () => {
|
|
80
|
+
const { replay, calls } = makeReplay(twoSteps);
|
|
81
|
+
await replay.handler({
|
|
82
|
+
action: 'run', wait: true, sequenceId: 'seq-declared',
|
|
83
|
+
connectionReason: 'run-device', stepTo: 1,
|
|
84
|
+
});
|
|
85
|
+
await replay.handler({ action: 'finish' });
|
|
86
|
+
expect(killedPorts(calls)).toContain(PORTS['declared-b']);
|
|
87
|
+
});
|
|
88
|
+
it('are closed when a BACKGROUND run completes', async () => {
|
|
89
|
+
// The default mode. Cleanup used to live in the `wait: true` branch only,
|
|
90
|
+
// so an ordinary suite run leaked one browser per multi-browser sequence.
|
|
91
|
+
const { replay, calls } = makeReplay(twoSteps);
|
|
92
|
+
const started = await replay.handler({
|
|
93
|
+
action: 'run', sequenceId: 'seq-declared', connectionReason: 'run-device',
|
|
94
|
+
});
|
|
95
|
+
const runId = started._meta?.replay?.runId ?? started.content[0].text.match(/run-\d+-\w+/)?.[0];
|
|
96
|
+
await vi.waitFor(async () => {
|
|
97
|
+
const status = await replay.handler({ action: 'status', runId });
|
|
98
|
+
expect(status.content[0].text).toMatch(/completed|failed/i);
|
|
99
|
+
}, { timeout: 5000 });
|
|
100
|
+
expect(killedPorts(calls)).toContain(PORTS['declared-b']);
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
//# sourceMappingURL=replay-declared-browser-cleanup.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"replay-declared-browser-cleanup.test.js","sourceRoot":"","sources":["../../src/tools/replay-declared-browser-cleanup.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,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AK,GAAG,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAEhG,MAAM,EAAE,CAAC,OAAO,CAAC,KAAK,IAAI,EAAE;YAC1B,MAAM,MAAM,GAAQ,MAAM,MAAM,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAS,CAAC,CAAC;YAC7E,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC;QAC9D,CAAC,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;QAEtB,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC;IAC5D,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"replay-declared-profile.test.d.ts","sourceRoot":"","sources":["../../src/tools/replay-declared-profile.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A sequence can declare which persistent Chrome profile a browser comes up
|
|
3
|
+
* on: `requiredConnections: [{ reference: 'device-a', profile: 'device-a' }]`.
|
|
4
|
+
*
|
|
5
|
+
* The profile is the durable half - cookies, localStorage and IndexedDB
|
|
6
|
+
* survive between runs, so a device enrolled once stays enrolled - while the
|
|
7
|
+
* reference is only a name for this session. Steps still address browsers by
|
|
8
|
+
* reference; nothing about a step changes (issue #104).
|
|
9
|
+
*/
|
|
10
|
+
import { describe, it, expect, vi } from 'vitest';
|
|
11
|
+
import { createReplayTools } from './replay-tools.js';
|
|
12
|
+
import { productionShaped } from '../test-support/fake-execute-tool-call.js';
|
|
13
|
+
function makeReplay(declared, commands) {
|
|
14
|
+
const sequence = {
|
|
15
|
+
id: 'seq-profile',
|
|
16
|
+
name: 'profile-seq',
|
|
17
|
+
createdAt: 1,
|
|
18
|
+
startUrl: 'http://localhost:5173/',
|
|
19
|
+
commands: (commands ?? [{ tool: 'dom', params: { action: 'querySelector', selector: '#a' } }]),
|
|
20
|
+
requiredConnections: declared,
|
|
21
|
+
};
|
|
22
|
+
const recorder = {
|
|
23
|
+
getSequence: vi.fn(() => sequence),
|
|
24
|
+
getFreshSequence: vi.fn(async () => sequence),
|
|
25
|
+
listSequences: vi.fn(() => [sequence]),
|
|
26
|
+
loadSequenceFromDisk: vi.fn(async () => sequence),
|
|
27
|
+
getHistory: vi.fn(() => []),
|
|
28
|
+
getCurrentHistoryIndex: vi.fn(() => 0),
|
|
29
|
+
recordCommand: vi.fn(),
|
|
30
|
+
setActiveSequence: vi.fn(),
|
|
31
|
+
getActiveSequence: vi.fn(() => null),
|
|
32
|
+
};
|
|
33
|
+
const calls = [];
|
|
34
|
+
const executeToolCall = vi.fn(productionShaped(async (tool, params) => {
|
|
35
|
+
calls.push({ tool, params });
|
|
36
|
+
return { content: [{ type: 'text', text: '' }] };
|
|
37
|
+
}));
|
|
38
|
+
const { replay } = createReplayTools(recorder, executeToolCall, async () => null, async () => 9222, undefined);
|
|
39
|
+
return { replay, calls };
|
|
40
|
+
}
|
|
41
|
+
const run = (replay, extra = {}) => replay.handler({
|
|
42
|
+
action: 'run', wait: true, sequenceId: 'seq-profile',
|
|
43
|
+
connectionReason: 'run-device', ...extra,
|
|
44
|
+
});
|
|
45
|
+
const launches = (calls) => calls.filter(c => c.tool === 'launchChrome').map(c => c.params);
|
|
46
|
+
const text = (res) => res.content[0].text;
|
|
47
|
+
describe('a declared connection with a profile', () => {
|
|
48
|
+
it('launches the reference on that profile', async () => {
|
|
49
|
+
const { replay, calls } = makeReplay([
|
|
50
|
+
{ reference: 'device-a', profile: 'device-a', role: 'the enrolled member' },
|
|
51
|
+
]);
|
|
52
|
+
await run(replay);
|
|
53
|
+
expect(launches(calls)).toContainEqual(expect.objectContaining({
|
|
54
|
+
reference: 'device-a',
|
|
55
|
+
profile: 'device-a',
|
|
56
|
+
}));
|
|
57
|
+
});
|
|
58
|
+
it('reuses the browser already on that profile rather than forcing a second', async () => {
|
|
59
|
+
// Only one live Chrome may hold a profile, so the declaration default of
|
|
60
|
+
// "a distinct process" would fail against the very browser it wants.
|
|
61
|
+
const { replay, calls } = makeReplay([{ reference: 'device-a', profile: 'device-a' }]);
|
|
62
|
+
await run(replay);
|
|
63
|
+
expect(launches(calls)).toContainEqual(expect.objectContaining({
|
|
64
|
+
reference: 'device-a',
|
|
65
|
+
forceNewInstance: false,
|
|
66
|
+
}));
|
|
67
|
+
});
|
|
68
|
+
it('still forces a new process when the declaration asks for one explicitly', async () => {
|
|
69
|
+
const { replay, calls } = makeReplay([
|
|
70
|
+
{ reference: 'device-a', profile: 'device-a', forceNewInstance: true },
|
|
71
|
+
]);
|
|
72
|
+
await run(replay);
|
|
73
|
+
expect(launches(calls)).toContainEqual(expect.objectContaining({
|
|
74
|
+
reference: 'device-a',
|
|
75
|
+
forceNewInstance: true,
|
|
76
|
+
}));
|
|
77
|
+
});
|
|
78
|
+
it('keeps the profile-less default of a distinct process', async () => {
|
|
79
|
+
const { replay, calls } = makeReplay([{ reference: 'plain-b' }]);
|
|
80
|
+
await run(replay);
|
|
81
|
+
expect(launches(calls)).toContainEqual(expect.objectContaining({
|
|
82
|
+
reference: 'plain-b',
|
|
83
|
+
forceNewInstance: true,
|
|
84
|
+
}));
|
|
85
|
+
expect(launches(calls).every(p => p.profile === undefined)).toBe(true);
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
describe('declarations that cannot mean what they say', () => {
|
|
89
|
+
it('refuses two references on one profile, before launching anything', async () => {
|
|
90
|
+
const { replay, calls } = makeReplay([
|
|
91
|
+
{ reference: 'device-a', profile: 'shared' },
|
|
92
|
+
{ reference: 'device-b', profile: 'shared' },
|
|
93
|
+
]);
|
|
94
|
+
const res = await run(replay);
|
|
95
|
+
expect(text(res)).toContain('same persistent profile "shared"');
|
|
96
|
+
expect(text(res)).toContain('device-a, device-b');
|
|
97
|
+
expect(launches(calls)).toEqual([]);
|
|
98
|
+
});
|
|
99
|
+
it('refuses a connections rebind of a profile-bearing reference', async () => {
|
|
100
|
+
// A declaration is normally just a default that a rebind overrides. A
|
|
101
|
+
// profile is an identity claim: pointing it elsewhere would run device-a's
|
|
102
|
+
// steps in a browser that is not device-a, and pass.
|
|
103
|
+
const { replay, calls } = makeReplay([{ reference: 'device-a', profile: 'device-a' }], [{ tool: 'dom', params: { action: 'querySelector', selector: '#a', connectionReason: 'device-a' } }]);
|
|
104
|
+
const res = await run(replay, { connections: { 'device-a': 'some-other-browser' } });
|
|
105
|
+
expect(text(res)).toContain('identity');
|
|
106
|
+
expect(text(res)).toContain('device-a');
|
|
107
|
+
expect(launches(calls)).toEqual([]);
|
|
108
|
+
});
|
|
109
|
+
it('still lets a profile-less declaration be rebound', async () => {
|
|
110
|
+
const { replay, calls } = makeReplay([{ reference: 'plain-b' }], [{ tool: 'dom', params: { action: 'querySelector', selector: '#a', connectionReason: 'plain-b' } }]);
|
|
111
|
+
await run(replay, { connections: { 'plain-b': 'my-second-browser' } });
|
|
112
|
+
// Rebound onto a browser the caller supplied: nothing to launch for it.
|
|
113
|
+
expect(launches(calls).some(p => p.reference === 'plain-b')).toBe(false);
|
|
114
|
+
});
|
|
115
|
+
});
|
|
116
|
+
//# sourceMappingURL=replay-declared-profile.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"replay-declared-profile.test.js","sourceRoot":"","sources":["../../src/tools/replay-declared-profile.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAClD,OAAO,EAAE,iBAAiB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