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,318 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Two features that exist because a sequence suite drifts:
|
|
3
|
+
*
|
|
4
|
+
* 1. `teardown` - steps that run when the MAIN steps reach a terminal state,
|
|
5
|
+
* including the states nothing else survives (a failed step, an abort, the
|
|
6
|
+
* total timeout). A cleanup that only runs on the happy path is absent
|
|
7
|
+
* exactly when it is needed.
|
|
8
|
+
* 2. `forEach` - conditions can only ask whether ONE named thing exists, so
|
|
9
|
+
* "remove everything that shouldn't be here" was inexpressible. This
|
|
10
|
+
* enumerates a source and runs a sequence per item.
|
|
11
|
+
*/
|
|
12
|
+
import { describe, it, expect, beforeEach, vi } from 'vitest';
|
|
13
|
+
import { executeSteps, resolveForEachItems } from './replay-executor.js';
|
|
14
|
+
import { formatExecutionResults } from './replay-formatters.js';
|
|
15
|
+
import { configManager } from '../config.js';
|
|
16
|
+
import { ToolError } from '../tool-error.js';
|
|
17
|
+
function makeHarness(responses = {}, nested) {
|
|
18
|
+
const calls = [];
|
|
19
|
+
const executeToolCall = vi.fn(async (tool, params) => {
|
|
20
|
+
calls.push({ tool, params });
|
|
21
|
+
const key = `${tool}.${params.action}`;
|
|
22
|
+
const r = key in responses ? responses[key] : responses[tool];
|
|
23
|
+
const response = r !== undefined
|
|
24
|
+
? (typeof r === 'function' ? r(params) : r)
|
|
25
|
+
: { content: [{ type: 'text', text: '' }] };
|
|
26
|
+
if (response?.isError)
|
|
27
|
+
throw new ToolError(response);
|
|
28
|
+
return response;
|
|
29
|
+
});
|
|
30
|
+
const commandRecorder = {
|
|
31
|
+
recordCommand: vi.fn(),
|
|
32
|
+
getCurrentHistoryIndex: () => 0,
|
|
33
|
+
getSequence: (id) => nested?.find(s => s.id === id),
|
|
34
|
+
getFreshSequence: async (id) => nested?.find(s => s.id === id),
|
|
35
|
+
listSequences: () => nested ?? [],
|
|
36
|
+
loadSequenceFromDisk: vi.fn(async () => null),
|
|
37
|
+
listSavedSequencesOnDisk: vi.fn(async () => []),
|
|
38
|
+
};
|
|
39
|
+
const ctx = {
|
|
40
|
+
executeToolCall,
|
|
41
|
+
commandRecorder,
|
|
42
|
+
connectionReason: 'device-a',
|
|
43
|
+
logPrefix: 'test',
|
|
44
|
+
};
|
|
45
|
+
return { calls, ctx, executeToolCall };
|
|
46
|
+
}
|
|
47
|
+
const seq = (name, commands, teardown) => ({
|
|
48
|
+
id: `seq-${name}`,
|
|
49
|
+
name,
|
|
50
|
+
commands,
|
|
51
|
+
...(teardown ? { teardown } : {}),
|
|
52
|
+
createdAt: 1,
|
|
53
|
+
});
|
|
54
|
+
const text = (t) => ({ content: [{ type: 'text', text: t }] });
|
|
55
|
+
const evaluated = (value) => ({
|
|
56
|
+
content: [{ type: 'text', text: 'ok' }],
|
|
57
|
+
_meta: { tool: 'inspect', action: 'evaluateExpression', timestamp: 0, inspect: { value } },
|
|
58
|
+
});
|
|
59
|
+
const errorText = (t) => ({ isError: true, content: [{ type: 'text', text: t }] });
|
|
60
|
+
/**
|
|
61
|
+
* Which tool names ran, in order - the cheapest way to assert "cleanup
|
|
62
|
+
* happened". `inspect` is dropped: the executor makes its own probing calls
|
|
63
|
+
* around steps, and they are not what any of these tests are about.
|
|
64
|
+
*/
|
|
65
|
+
const toolsCalled = (calls) => calls.filter(c => c.tool !== 'inspect').map(c => c.tool);
|
|
66
|
+
beforeEach(() => {
|
|
67
|
+
vi.spyOn(configManager, 'getClickValidationConfig').mockReturnValue({
|
|
68
|
+
enabled: false, validateNavigation: false, requireDomChanges: false,
|
|
69
|
+
});
|
|
70
|
+
vi.spyOn(configManager, 'getReplayConfig').mockReturnValue({
|
|
71
|
+
maxConditionalDepth: 10, maxRegexLength: 500,
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
describe('teardown', () => {
|
|
75
|
+
it('runs after the main steps succeed', async () => {
|
|
76
|
+
const { ctx, calls } = makeHarness({ screenshot: text('ok'), storage: text('cleared') });
|
|
77
|
+
const s = seq('main', [{ tool: 'screenshot', params: {} }], [{ tool: 'storage', params: {} }]);
|
|
78
|
+
const result = await executeSteps({ sequence: s, ctx, startStep: 0 });
|
|
79
|
+
expect(result.results.every(r => r.success)).toBe(true);
|
|
80
|
+
expect(result.teardownResults).toHaveLength(1);
|
|
81
|
+
expect(result.teardownFailed).toBe(false);
|
|
82
|
+
expect(toolsCalled(calls)).toEqual(['screenshot', 'storage']);
|
|
83
|
+
});
|
|
84
|
+
it('runs even when a main step fails - the case cleanup exists for', async () => {
|
|
85
|
+
const { ctx, calls } = makeHarness({
|
|
86
|
+
screenshot: errorText('boom'),
|
|
87
|
+
storage: text('cleared'),
|
|
88
|
+
});
|
|
89
|
+
const s = seq('main', [{ tool: 'screenshot', params: {} }], [{ tool: 'storage', params: {} }]);
|
|
90
|
+
const result = await executeSteps({ sequence: s, ctx, startStep: 0 });
|
|
91
|
+
expect(result.results[0].success).toBe(false);
|
|
92
|
+
expect(result.teardownResults).toHaveLength(1);
|
|
93
|
+
expect(result.teardownResults[0].success).toBe(true);
|
|
94
|
+
expect(toolsCalled(calls)).toContain('storage');
|
|
95
|
+
});
|
|
96
|
+
it('runs after the run is cancelled, because the signal is NOT passed down', async () => {
|
|
97
|
+
const controller = new AbortController();
|
|
98
|
+
const { ctx, calls } = makeHarness({ screenshot: text('ok'), storage: text('cleared') });
|
|
99
|
+
const s = seq('main', [{ tool: 'screenshot', params: {} }], [{ tool: 'storage', params: {} }]);
|
|
100
|
+
controller.abort();
|
|
101
|
+
const result = await executeSteps({
|
|
102
|
+
sequence: s, ctx, startStep: 0, abortSignal: controller.signal,
|
|
103
|
+
});
|
|
104
|
+
expect(result.results[0].error).toBe('Replay aborted by user');
|
|
105
|
+
// The whole point: a cancelled run is precisely one that left something behind.
|
|
106
|
+
expect(result.teardownResults?.[0].success).toBe(true);
|
|
107
|
+
expect(toolsCalled(calls)).toEqual(['storage']);
|
|
108
|
+
});
|
|
109
|
+
it('has its own budget, so an exhausted totalTimeout does not skip it', async () => {
|
|
110
|
+
const { ctx, calls } = makeHarness({ screenshot: text('ok'), storage: text('cleared') });
|
|
111
|
+
const s = seq('main', [{ tool: 'screenshot', params: {} }], [{ tool: 'storage', params: {} }]);
|
|
112
|
+
// totalTimeout of 0 means the main loop gives up before its first step.
|
|
113
|
+
const result = await executeSteps({ sequence: s, ctx, startStep: 0, totalTimeout: 0 });
|
|
114
|
+
expect(result.results[0].error).toContain('Total timeout exceeded');
|
|
115
|
+
expect(result.teardownResults?.[0].success).toBe(true);
|
|
116
|
+
expect(toolsCalled(calls)).toEqual(['storage']);
|
|
117
|
+
});
|
|
118
|
+
it('does NOT run when the sequence pauses at stepTo - the run is not over', async () => {
|
|
119
|
+
const { ctx, calls } = makeHarness({ screenshot: text('ok'), storage: text('cleared') });
|
|
120
|
+
const s = seq('main', [{ tool: 'screenshot', params: {} }, { tool: 'screenshot', params: {} }], [{ tool: 'storage', params: {} }]);
|
|
121
|
+
const result = await executeSteps({ sequence: s, ctx, startStep: 0, endStep: 1 });
|
|
122
|
+
expect(result.teardownResults).toBeUndefined();
|
|
123
|
+
expect(toolsCalled(calls)).toEqual(['screenshot']);
|
|
124
|
+
});
|
|
125
|
+
it('reads variables the main steps captured, so it can undo what setup minted', async () => {
|
|
126
|
+
const { ctx, calls } = makeHarness({
|
|
127
|
+
request: {
|
|
128
|
+
content: [{ type: 'text', text: 'ok' }],
|
|
129
|
+
_meta: { tool: 'request', action: 'send', timestamp: 0, request: { body: { id: 'share-42' } } },
|
|
130
|
+
},
|
|
131
|
+
navigate: text('ok'),
|
|
132
|
+
});
|
|
133
|
+
const s = seq('main', [{ tool: 'request', params: { url: '/mint', saveAs: 'mint' } }], [{ tool: 'navigate', params: { action: 'goto', url: '/revoke/{{var:mint.body.id}}' } }]);
|
|
134
|
+
await executeSteps({ sequence: s, ctx, startStep: 0 });
|
|
135
|
+
const revoke = calls.find(c => c.tool === 'navigate');
|
|
136
|
+
expect(revoke?.params.url).toBe('/revoke/share-42');
|
|
137
|
+
});
|
|
138
|
+
it('does not change the run verdict when a teardown step fails', async () => {
|
|
139
|
+
const { ctx } = makeHarness({ navigate: text('ok'), storage: errorText('cleanup broke') });
|
|
140
|
+
const s = seq('main', [{ tool: 'screenshot', params: {} }], [{ tool: 'storage', params: {} }]);
|
|
141
|
+
const result = await executeSteps({ sequence: s, ctx, startStep: 0 });
|
|
142
|
+
expect(result.results.every(r => r.success)).toBe(true);
|
|
143
|
+
expect(result.teardownFailed).toBe(true);
|
|
144
|
+
const rendered = formatExecutionResults('main', result.results, 1, 0, {
|
|
145
|
+
results: result.teardownResults, failed: true,
|
|
146
|
+
});
|
|
147
|
+
expect(rendered).toContain("does not change the run's verdict");
|
|
148
|
+
expect(rendered).toContain('**Successful:** 1');
|
|
149
|
+
expect(rendered).toContain('**Failed:** 0');
|
|
150
|
+
});
|
|
151
|
+
it('does not recurse - a teardown does not run its own teardown', async () => {
|
|
152
|
+
const { ctx, calls } = makeHarness({ screenshot: text('ok'), storage: text('cleared') });
|
|
153
|
+
const s = seq('main', [{ tool: 'screenshot', params: {} }], [{ tool: 'storage', params: {} }]);
|
|
154
|
+
await executeSteps({ sequence: s, ctx, startStep: 0 });
|
|
155
|
+
expect(calls.filter(c => c.tool === 'storage')).toHaveLength(1);
|
|
156
|
+
});
|
|
157
|
+
});
|
|
158
|
+
describe('resolveForEachItems', () => {
|
|
159
|
+
it('reads an array a previous saveAs captured', async () => {
|
|
160
|
+
const { ctx } = makeHarness();
|
|
161
|
+
ctx.variableStore = { rows: [{ id: 1 }, { id: 2 }] };
|
|
162
|
+
const result = await resolveForEachItems('{{var:rows}}', ctx);
|
|
163
|
+
expect(result).toEqual({ ok: true, items: [{ id: 1 }, { id: 2 }] });
|
|
164
|
+
});
|
|
165
|
+
it('addresses into a captured object', async () => {
|
|
166
|
+
const { ctx } = makeHarness();
|
|
167
|
+
ctx.variableStore = { list: { body: { shares: ['a', 'b'] } } };
|
|
168
|
+
const result = await resolveForEachItems('{{var:list.body.shares}}', ctx);
|
|
169
|
+
expect(result).toEqual({ ok: true, items: ['a', 'b'] });
|
|
170
|
+
});
|
|
171
|
+
it('rejects a non-array rather than looping over its characters', async () => {
|
|
172
|
+
const { ctx } = makeHarness();
|
|
173
|
+
ctx.variableStore = { name: 'employees' };
|
|
174
|
+
const result = await resolveForEachItems('{{var:name}}', ctx);
|
|
175
|
+
expect(result).toMatchObject({ ok: false });
|
|
176
|
+
expect(result.error).toContain('not an array');
|
|
177
|
+
});
|
|
178
|
+
it('names the missing variable instead of yielding nothing', async () => {
|
|
179
|
+
const { ctx } = makeHarness();
|
|
180
|
+
const result = await resolveForEachItems('{{var:nope}}', ctx);
|
|
181
|
+
expect(result.error).toContain('no variable named "nope"');
|
|
182
|
+
});
|
|
183
|
+
it('enumerates the DOM via selectorAll', async () => {
|
|
184
|
+
const { ctx, calls } = makeHarness({
|
|
185
|
+
'inspect.evaluateExpression': evaluated([{ index: 0, text: 'Employees' }]),
|
|
186
|
+
});
|
|
187
|
+
const result = await resolveForEachItems('{{selectorAll:.share-row}}', ctx);
|
|
188
|
+
expect(result).toEqual({ ok: true, items: [{ index: 0, text: 'Employees' }] });
|
|
189
|
+
expect(calls[0].params.expression).toContain('.share-row');
|
|
190
|
+
});
|
|
191
|
+
it('rejects an unrecognised source instead of treating it as empty', async () => {
|
|
192
|
+
const { ctx } = makeHarness();
|
|
193
|
+
const result = await resolveForEachItems('.share-row', ctx);
|
|
194
|
+
expect(result.error).toContain('unrecognised source');
|
|
195
|
+
});
|
|
196
|
+
});
|
|
197
|
+
describe('forEach step', () => {
|
|
198
|
+
const body = seq('revoke-one', [
|
|
199
|
+
{ tool: 'storage', params: { action: 'setLocalStorage', key: 'revoked', value: '{{var:row.id}}' } },
|
|
200
|
+
]);
|
|
201
|
+
/** What the body actually wrote, one entry per iteration. */
|
|
202
|
+
const revoked = (calls) => calls.filter(c => c.tool === 'storage').map(c => c.params.value);
|
|
203
|
+
it('runs the body once per item, binding each to `as`', async () => {
|
|
204
|
+
const { ctx, calls } = makeHarness({ storage: text('ok') }, [body]);
|
|
205
|
+
const main = seq('main', [
|
|
206
|
+
{ tool: 'forEach', params: { in: '{{var:rows}}', as: 'row', do: 'revoke-one' } },
|
|
207
|
+
]);
|
|
208
|
+
ctx.variableStore = { rows: [{ id: 'a' }, { id: 'b' }, { id: 'c' }] };
|
|
209
|
+
const result = await executeSteps({ sequence: main, ctx, startStep: 0 });
|
|
210
|
+
expect(result.results[0].success).toBe(true);
|
|
211
|
+
expect(result.results[0].iterations).toBe(3);
|
|
212
|
+
expect(result.results[0].itemsFound).toBe(3);
|
|
213
|
+
expect(revoked(calls)).toEqual(['a', 'b', 'c']);
|
|
214
|
+
});
|
|
215
|
+
it('an empty source is a success, not a failure', async () => {
|
|
216
|
+
const { ctx, calls } = makeHarness({ storage: text('ok') }, [body]);
|
|
217
|
+
const main = seq('main', [
|
|
218
|
+
{ tool: 'forEach', params: { in: '{{var:rows}}', as: 'row', do: 'revoke-one' } },
|
|
219
|
+
]);
|
|
220
|
+
ctx.variableStore = { rows: [] };
|
|
221
|
+
const result = await executeSteps({ sequence: main, ctx, startStep: 0 });
|
|
222
|
+
expect(result.results[0].success).toBe(true);
|
|
223
|
+
expect(result.results[0].iterations).toBe(0);
|
|
224
|
+
expect(revoked(calls)).toEqual([]);
|
|
225
|
+
});
|
|
226
|
+
it('states the count when nothing ran, so an empty set is not mistaken for a broken selector', async () => {
|
|
227
|
+
const rendered = formatExecutionResults('main', [
|
|
228
|
+
{ step: 1, tool: 'forEach', success: true, sequenceName: 'revoke-one', itemsFound: 0, iterations: 0 },
|
|
229
|
+
], 1, 0);
|
|
230
|
+
expect(rendered).toContain('0 item(s) found, none ran');
|
|
231
|
+
});
|
|
232
|
+
it('filters with `where`, evaluated as JS with item in scope', async () => {
|
|
233
|
+
const { ctx, calls } = makeHarness({
|
|
234
|
+
storage: text('ok'),
|
|
235
|
+
'inspect.evaluateExpression': (params) => evaluated(!params.expression.includes('"keep":false')),
|
|
236
|
+
}, [body]);
|
|
237
|
+
const main = seq('main', [
|
|
238
|
+
{ tool: 'forEach', params: { in: '{{var:rows}}', as: 'row', do: 'revoke-one', where: 'item.keep' } },
|
|
239
|
+
]);
|
|
240
|
+
ctx.variableStore = { rows: [{ id: 'a', keep: true }, { id: 'b', keep: false }] };
|
|
241
|
+
const result = await executeSteps({ sequence: main, ctx, startStep: 0 });
|
|
242
|
+
expect(result.results[0].itemsFound).toBe(2);
|
|
243
|
+
expect(result.results[0].iterations).toBe(1);
|
|
244
|
+
expect(revoked(calls)).toEqual(['a']);
|
|
245
|
+
});
|
|
246
|
+
it('fails the step when `where` cannot be evaluated, rather than quietly excluding everything', async () => {
|
|
247
|
+
const { ctx } = makeHarness({
|
|
248
|
+
storage: text('ok'),
|
|
249
|
+
'inspect.evaluateExpression': errorText('SyntaxError'),
|
|
250
|
+
}, [body]);
|
|
251
|
+
const main = seq('main', [
|
|
252
|
+
{ tool: 'forEach', params: { in: '{{var:rows}}', as: 'row', do: 'revoke-one', where: 'item.((' } },
|
|
253
|
+
]);
|
|
254
|
+
ctx.variableStore = { rows: [{ id: 'a' }] };
|
|
255
|
+
const result = await executeSteps({ sequence: main, ctx, startStep: 0 });
|
|
256
|
+
expect(result.results[0].success).toBe(false);
|
|
257
|
+
expect(result.results[0].error).toContain('could not be evaluated');
|
|
258
|
+
});
|
|
259
|
+
it('stops the run when the body fails, naming which item', async () => {
|
|
260
|
+
const { ctx } = makeHarness({
|
|
261
|
+
storage: (params) => (params.value === 'b' ? errorText('nope') : text('ok')),
|
|
262
|
+
}, [body]);
|
|
263
|
+
const main = seq('main', [
|
|
264
|
+
{ tool: 'forEach', params: { in: '{{var:rows}}', as: 'row', do: 'revoke-one' } },
|
|
265
|
+
]);
|
|
266
|
+
ctx.variableStore = { rows: [{ id: 'a' }, { id: 'b' }, { id: 'c' }] };
|
|
267
|
+
const result = await executeSteps({ sequence: main, ctx, startStep: 0 });
|
|
268
|
+
expect(result.results[0].success).toBe(false);
|
|
269
|
+
expect(result.results[0].error).toContain('item 2/3');
|
|
270
|
+
});
|
|
271
|
+
it('caps iterations and says so rather than silently truncating', async () => {
|
|
272
|
+
const { ctx, calls } = makeHarness({ storage: text('ok') }, [body]);
|
|
273
|
+
const main = seq('main', [
|
|
274
|
+
{ tool: 'forEach', params: { in: '{{var:rows}}', as: 'row', do: 'revoke-one', maxItems: 2 } },
|
|
275
|
+
]);
|
|
276
|
+
ctx.variableStore = { rows: [{ id: 'a' }, { id: 'b' }, { id: 'c' }] };
|
|
277
|
+
const result = await executeSteps({ sequence: main, ctx, startStep: 0 });
|
|
278
|
+
expect(result.results[0].iterations).toBe(2);
|
|
279
|
+
expect(result.results[0].itemsFound).toBe(3);
|
|
280
|
+
expect(revoked(calls)).toEqual(['a', 'b']);
|
|
281
|
+
});
|
|
282
|
+
it('stops between iterations when the run is cancelled', async () => {
|
|
283
|
+
const controller = new AbortController();
|
|
284
|
+
const { ctx, calls } = makeHarness({
|
|
285
|
+
storage: () => { controller.abort(); return text('ok'); },
|
|
286
|
+
}, [body]);
|
|
287
|
+
const main = seq('main', [
|
|
288
|
+
{ tool: 'forEach', params: { in: '{{var:rows}}', as: 'row', do: 'revoke-one' } },
|
|
289
|
+
]);
|
|
290
|
+
ctx.variableStore = { rows: [{ id: 'a' }, { id: 'b' }, { id: 'c' }] };
|
|
291
|
+
const result = await executeSteps({
|
|
292
|
+
sequence: main, ctx, startStep: 0, abortSignal: controller.signal,
|
|
293
|
+
});
|
|
294
|
+
expect(result.results[0].success).toBe(false);
|
|
295
|
+
expect(revoked(calls).length).toBeLessThan(3);
|
|
296
|
+
});
|
|
297
|
+
it('reports the missing parameters instead of failing mid-loop', async () => {
|
|
298
|
+
const { ctx } = makeHarness({}, [body]);
|
|
299
|
+
// A selectorAll source, so param interpolation leaves it alone and the
|
|
300
|
+
// step's own validation is what reports.
|
|
301
|
+
const main = seq('main', [{ tool: 'forEach', params: { in: '{{selectorAll:.row}}' } }]);
|
|
302
|
+
const result = await executeSteps({ sequence: main, ctx, startStep: 0 });
|
|
303
|
+
expect(result.results[0].success).toBe(false);
|
|
304
|
+
expect(result.results[0].error).toContain('"as"');
|
|
305
|
+
expect(result.results[0].error).toContain('"do"');
|
|
306
|
+
});
|
|
307
|
+
it('names the sequence when the body does not exist', async () => {
|
|
308
|
+
const { ctx } = makeHarness({}, []);
|
|
309
|
+
const main = seq('main', [
|
|
310
|
+
{ tool: 'forEach', params: { in: '{{var:rows}}', as: 'row', do: 'no-such-sequence' } },
|
|
311
|
+
]);
|
|
312
|
+
ctx.variableStore = { rows: [{ id: 'a' }] };
|
|
313
|
+
const result = await executeSteps({ sequence: main, ctx, startStep: 0 });
|
|
314
|
+
expect(result.results[0].success).toBe(false);
|
|
315
|
+
expect(result.results[0].error).toContain('no-such-sequence');
|
|
316
|
+
});
|
|
317
|
+
});
|
|
318
|
+
//# sourceMappingURL=replay-teardown-and-foreach.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"replay-teardown-and-foreach.test.js","sourceRoot":"","sources":["../../src/tools/replay-teardown-and-foreach.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AACzE,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAGhE,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,SAAS,WAAW,CAAC,YAAiC,EAAE,EAAE,MAA0B;IAClF,MAAM,KAAK,GAAyD,EAAE,CAAC;IACvE,MAAM,eAAe,GAAG,EAAE,CAAC,EAAE,CAAC,KAAK,EAAE,IAAY,EAAE,MAA2B,EAAE,EAAE;QAChF,KAAK,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;QAC7B,MAAM,GAAG,GAAG,GAAG,IAAI,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;QACvC,MAAM,CAAC,GAAG,GAAG,IAAI,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QAC9D,MAAM,QAAQ,GAA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EAAE,KAAK,IAAI,EAAE;QAC/D,MAAM,EAAE,GAAG,EAAE,GAAG,WAAW,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;QACpC,MAAM,IAAI,GAAG,GAAG,CAAC,MAAM,EAAE;YACvB,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,cAAc,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,kBAAkB,EAAE,EAAE;SACvF,CAAC,CAAC;QACH,GAAG,CAAC,aAAa,GAAG,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;QAE5C,MAAM,MAAM,GAAG,MAAM,YAAY,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC,CAAC;QAEzE,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC9C,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,kBAAkB,CAAC,CAAC;IAChE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"replay-tool-name-validation.test.d.ts","sourceRoot":"","sources":["../../src/tools/replay-tool-name-validation.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* bug-010: sequence steps naming a nonexistent tool must be rejected at
|
|
3
|
+
* create/load time, before any step has mutated browser state.
|
|
4
|
+
*/
|
|
5
|
+
import { describe, it, expect, vi, beforeAll, afterAll } from 'vitest';
|
|
6
|
+
import { promises as fsp } from 'fs';
|
|
7
|
+
import { join } from 'path';
|
|
8
|
+
import { tmpdir } from 'os';
|
|
9
|
+
import { createReplayTools, findUnknownStepTools } from './replay-tools.js';
|
|
10
|
+
import { CommandRecorder } from '../command-recorder.js';
|
|
11
|
+
const KNOWN_TOOLS = ['navigate', 'inspect', 'input', 'screenshot', 'launchChrome'];
|
|
12
|
+
const seq = (commands, name = 'hand-authored') => ({
|
|
13
|
+
id: 'seq-1',
|
|
14
|
+
name,
|
|
15
|
+
commands,
|
|
16
|
+
createdAt: 1,
|
|
17
|
+
});
|
|
18
|
+
function makeRecorder(sequence) {
|
|
19
|
+
return {
|
|
20
|
+
// Mirrors the real recorder: the parsed candidate is validated BEFORE it
|
|
21
|
+
// replaces any same-named sequence, and a rejected candidate is never stored.
|
|
22
|
+
loadSequenceFromDisk: vi.fn(async (_filename, options) => {
|
|
23
|
+
if (sequence && options?.validate && !options.validate(sequence))
|
|
24
|
+
return null;
|
|
25
|
+
return sequence;
|
|
26
|
+
}),
|
|
27
|
+
// Mirrors the real recorder: the candidate is validated BEFORE it is stored,
|
|
28
|
+
// and a rejected candidate is never stored at all (nothing to delete after).
|
|
29
|
+
createSequence: vi.fn(async (_name, _indices, options) => {
|
|
30
|
+
if (sequence && options?.validate && !options.validate(sequence))
|
|
31
|
+
return null;
|
|
32
|
+
return sequence;
|
|
33
|
+
}),
|
|
34
|
+
deleteSequence: vi.fn(() => true),
|
|
35
|
+
recordCommand: vi.fn(),
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
function makeReplay(sequence, getKnownToolNames) {
|
|
39
|
+
const recorder = makeRecorder(sequence);
|
|
40
|
+
const tools = createReplayTools(recorder, vi.fn(), undefined, undefined, getKnownToolNames);
|
|
41
|
+
return { recorder, replay: tools.replay };
|
|
42
|
+
}
|
|
43
|
+
const text = (res) => res.content[0].text;
|
|
44
|
+
// ---------------------------------------------------------------------------
|
|
45
|
+
// findUnknownStepTools
|
|
46
|
+
// ---------------------------------------------------------------------------
|
|
47
|
+
describe('findUnknownStepTools', () => {
|
|
48
|
+
it('returns nothing when every step names a known tool', () => {
|
|
49
|
+
const commands = [{ tool: 'navigate' }, { tool: 'inspect' }];
|
|
50
|
+
expect(findUnknownStepTools(commands, KNOWN_TOOLS)).toEqual([]);
|
|
51
|
+
});
|
|
52
|
+
it('reports 1-based step number and offending name', () => {
|
|
53
|
+
const commands = [{ tool: 'navigate' }, { tool: 'inpsect' }, { tool: 'nope' }];
|
|
54
|
+
const unknown = findUnknownStepTools(commands, KNOWN_TOOLS);
|
|
55
|
+
expect(unknown.map(u => ({ step: u.step, tool: u.tool }))).toEqual([
|
|
56
|
+
{ step: 2, tool: 'inpsect' },
|
|
57
|
+
{ step: 3, tool: 'nope' },
|
|
58
|
+
]);
|
|
59
|
+
});
|
|
60
|
+
it('suggests a near-miss tool name for a typo', () => {
|
|
61
|
+
const [unknown] = findUnknownStepTools([{ tool: 'inpsect' }], KNOWN_TOOLS);
|
|
62
|
+
expect(unknown.suggestion).toBe('inspect');
|
|
63
|
+
});
|
|
64
|
+
it('accepts the "conditional" virtual step, which is not a registered tool', () => {
|
|
65
|
+
expect(findUnknownStepTools([{ tool: 'conditional' }], KNOWN_TOOLS)).toEqual([]);
|
|
66
|
+
});
|
|
67
|
+
it('flags a non-string tool field instead of throwing', () => {
|
|
68
|
+
const unknown = findUnknownStepTools([{ tool: undefined }, {}], KNOWN_TOOLS);
|
|
69
|
+
expect(unknown).toHaveLength(2);
|
|
70
|
+
});
|
|
71
|
+
it('does not inspect params (interpolation tokens must stay valid)', () => {
|
|
72
|
+
const commands = [
|
|
73
|
+
{ tool: 'input', params: { action: 'click', x: '{{var:pos.x}}' } },
|
|
74
|
+
{ tool: 'navigate', params: { url: '{{var:base}}/page?t={{timestamp}}' } },
|
|
75
|
+
];
|
|
76
|
+
expect(findUnknownStepTools(commands, KNOWN_TOOLS)).toEqual([]);
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
// ---------------------------------------------------------------------------
|
|
80
|
+
// load
|
|
81
|
+
// ---------------------------------------------------------------------------
|
|
82
|
+
describe('replay load - tool name validation', () => {
|
|
83
|
+
it('rejects a sequence with an unknown tool name when the provider is supplied', async () => {
|
|
84
|
+
const { replay, recorder } = makeReplay(seq([{ tool: 'navigate', params: {} }, { tool: 'inpsect', params: {} }]), () => KNOWN_TOOLS);
|
|
85
|
+
const res = await replay.handler({ action: 'load', filename: 'x.json' });
|
|
86
|
+
expect(res.isError).toBe(true);
|
|
87
|
+
expect(text(res)).toContain('Step 2');
|
|
88
|
+
expect(text(res)).toContain('inpsect');
|
|
89
|
+
expect(text(res)).toContain('inspect');
|
|
90
|
+
// rejected before storage, so there is nothing to clean up afterwards
|
|
91
|
+
expect(recorder.deleteSequence).not.toHaveBeenCalled();
|
|
92
|
+
// and nothing was pushed into history
|
|
93
|
+
expect(recorder.recordCommand).not.toHaveBeenCalled();
|
|
94
|
+
});
|
|
95
|
+
it('rejects before loading into history when intoHistory is set', async () => {
|
|
96
|
+
const { replay, recorder } = makeReplay(seq([{ tool: 'bogus', params: {} }]), () => KNOWN_TOOLS);
|
|
97
|
+
const res = await replay.handler({ action: 'load', filename: 'x.json', intoHistory: true });
|
|
98
|
+
expect(res.isError).toBe(true);
|
|
99
|
+
expect(recorder.recordCommand).not.toHaveBeenCalled();
|
|
100
|
+
});
|
|
101
|
+
it('loads a valid sequence normally', async () => {
|
|
102
|
+
const { replay, recorder } = makeReplay(seq([{ tool: 'navigate', params: {} }, { tool: 'conditional', params: {} }]), () => KNOWN_TOOLS);
|
|
103
|
+
const res = await replay.handler({ action: 'load', filename: 'x.json' });
|
|
104
|
+
expect(res.isError).toBeUndefined();
|
|
105
|
+
expect(recorder.deleteSequence).not.toHaveBeenCalled();
|
|
106
|
+
});
|
|
107
|
+
it('does not validate when no tool-name provider is supplied (previous behaviour)', async () => {
|
|
108
|
+
const { replay, recorder } = makeReplay(seq([{ tool: 'inpsect', params: {} }]));
|
|
109
|
+
const res = await replay.handler({ action: 'load', filename: 'x.json' });
|
|
110
|
+
expect(res.isError).toBeUndefined();
|
|
111
|
+
expect(recorder.deleteSequence).not.toHaveBeenCalled();
|
|
112
|
+
});
|
|
113
|
+
it('does not validate when the provider returns an empty list', async () => {
|
|
114
|
+
const { replay } = makeReplay(seq([{ tool: 'inpsect', params: {} }]), () => []);
|
|
115
|
+
const res = await replay.handler({ action: 'load', filename: 'x.json' });
|
|
116
|
+
expect(res.isError).toBeUndefined();
|
|
117
|
+
});
|
|
118
|
+
});
|
|
119
|
+
// ---------------------------------------------------------------------------
|
|
120
|
+
// create
|
|
121
|
+
// ---------------------------------------------------------------------------
|
|
122
|
+
describe('replay create - tool name validation', () => {
|
|
123
|
+
it('rejects a created sequence containing an unknown tool name', async () => {
|
|
124
|
+
const { replay, recorder } = makeReplay(seq([{ tool: 'ntavigate', params: {} }], 'from-history'), () => KNOWN_TOOLS);
|
|
125
|
+
const res = await replay.handler({ action: 'create', name: 'from-history', indices: [0] });
|
|
126
|
+
expect(res.isError).toBe(true);
|
|
127
|
+
expect(text(res)).toContain('Step 1');
|
|
128
|
+
expect(text(res)).toContain('ntavigate');
|
|
129
|
+
// Rejected before storage, so there is nothing to clean up afterwards
|
|
130
|
+
expect(recorder.deleteSequence).not.toHaveBeenCalled();
|
|
131
|
+
});
|
|
132
|
+
it('creates a valid sequence normally', async () => {
|
|
133
|
+
const { replay, recorder } = makeReplay(seq([{ tool: 'navigate', params: {} }], 'from-history'), () => KNOWN_TOOLS);
|
|
134
|
+
const res = await replay.handler({ action: 'create', name: 'from-history', indices: [0] });
|
|
135
|
+
expect(res.isError).toBeUndefined();
|
|
136
|
+
expect(recorder.deleteSequence).not.toHaveBeenCalled();
|
|
137
|
+
});
|
|
138
|
+
it('does not validate when no tool-name provider is supplied', async () => {
|
|
139
|
+
const { replay } = makeReplay(seq([{ tool: 'ntavigate', params: {} }], 'from-history'));
|
|
140
|
+
const res = await replay.handler({ action: 'create', name: 'from-history', indices: [0] });
|
|
141
|
+
expect(res.isError).toBeUndefined();
|
|
142
|
+
});
|
|
143
|
+
});
|
|
144
|
+
// ---------------------------------------------------------------------------
|
|
145
|
+
// create ordering: validation must run before the same-name replace
|
|
146
|
+
// ---------------------------------------------------------------------------
|
|
147
|
+
describe('replay create - a rejected create must not destroy the existing sequence', () => {
|
|
148
|
+
async function realRecorderReplay() {
|
|
149
|
+
const recorder = new CommandRecorder();
|
|
150
|
+
await recorder.recordCommand('navigate', { action: 'goto', url: 'http://example.test/' });
|
|
151
|
+
await recorder.recordCommand('ntavigate', { action: 'goto', url: 'http://example.test/bad' });
|
|
152
|
+
const { replay } = createReplayTools(recorder, vi.fn(), undefined, undefined, () => KNOWN_TOOLS);
|
|
153
|
+
return { recorder, replay };
|
|
154
|
+
}
|
|
155
|
+
it('keeps the good in-memory sequence when a same-named create is rejected', async () => {
|
|
156
|
+
const { recorder, replay } = await realRecorderReplay();
|
|
157
|
+
const good = await replay.handler({ action: 'create', name: 'login', indices: [0] });
|
|
158
|
+
expect(good.isError).toBeUndefined();
|
|
159
|
+
const goodId = recorder.listSequences()[0].id;
|
|
160
|
+
const bad = await replay.handler({ action: 'create', name: 'login', indices: [1] });
|
|
161
|
+
expect(bad.isError).toBe(true);
|
|
162
|
+
expect(text(bad)).toContain('ntavigate');
|
|
163
|
+
// the original survives, unchanged, under the same id - and nothing else was stored
|
|
164
|
+
const remaining = recorder.listSequences();
|
|
165
|
+
expect(remaining).toHaveLength(1);
|
|
166
|
+
expect(remaining[0].id).toBe(goodId);
|
|
167
|
+
expect(remaining[0].commands.map(c => c.tool)).toEqual(['navigate']);
|
|
168
|
+
});
|
|
169
|
+
it('still resolves the pre-existing sequence by name after a rejected create', async () => {
|
|
170
|
+
const { replay } = await realRecorderReplay();
|
|
171
|
+
await replay.handler({ action: 'create', name: 'login', indices: [0] });
|
|
172
|
+
await replay.handler({ action: 'create', name: 'login', indices: [1] });
|
|
173
|
+
const got = await replay.handler({ action: 'get', name: 'login' });
|
|
174
|
+
expect(got.isError).toBeUndefined();
|
|
175
|
+
expect(text(got)).toContain('navigate');
|
|
176
|
+
expect(text(got)).not.toContain('ntavigate');
|
|
177
|
+
});
|
|
178
|
+
it('replaces the existing sequence when the new one is valid (dedupe still works, #75)', async () => {
|
|
179
|
+
const { recorder, replay } = await realRecorderReplay();
|
|
180
|
+
await recorder.recordCommand('inspect', { action: 'evaluateExpression', expression: '1+1' });
|
|
181
|
+
await replay.handler({ action: 'create', name: 'login', indices: [0] });
|
|
182
|
+
const res = await replay.handler({ action: 'create', name: 'login', indices: [0, 2] });
|
|
183
|
+
expect(res.isError).toBeUndefined();
|
|
184
|
+
const remaining = recorder.listSequences();
|
|
185
|
+
expect(remaining).toHaveLength(1);
|
|
186
|
+
expect(remaining[0].commands.map(c => c.tool)).toEqual(['navigate', 'inspect']);
|
|
187
|
+
});
|
|
188
|
+
});
|
|
189
|
+
// ---------------------------------------------------------------------------
|
|
190
|
+
// load ordering: validation must run before the same-name replace
|
|
191
|
+
// (same defect class as the create path above, on the disk-load path)
|
|
192
|
+
// ---------------------------------------------------------------------------
|
|
193
|
+
describe('replay load - a rejected load must not destroy the existing sequence', () => {
|
|
194
|
+
let dir;
|
|
195
|
+
beforeAll(async () => {
|
|
196
|
+
dir = await fsp.mkdtemp(join(tmpdir(), 'replay-load-order-'));
|
|
197
|
+
});
|
|
198
|
+
afterAll(async () => {
|
|
199
|
+
await fsp.rm(dir, { recursive: true, force: true });
|
|
200
|
+
});
|
|
201
|
+
/** Write a sequence file and return its absolute path (load takes absolute paths as-is). */
|
|
202
|
+
async function writeSequenceFile(file, sequence) {
|
|
203
|
+
const filepath = join(dir, file);
|
|
204
|
+
await fsp.writeFile(filepath, JSON.stringify(sequence), 'utf-8');
|
|
205
|
+
return filepath;
|
|
206
|
+
}
|
|
207
|
+
/** Real recorder holding one good in-memory sequence named "login". */
|
|
208
|
+
async function withGoodSequence() {
|
|
209
|
+
const recorder = new CommandRecorder();
|
|
210
|
+
await recorder.recordCommand('navigate', { action: 'goto', url: 'http://example.test/' });
|
|
211
|
+
const { replay } = createReplayTools(recorder, vi.fn(), undefined, undefined, () => KNOWN_TOOLS);
|
|
212
|
+
const created = await replay.handler({ action: 'create', name: 'login', indices: [0] });
|
|
213
|
+
expect(created.isError).toBeUndefined();
|
|
214
|
+
const goodId = recorder.listSequences()[0].id;
|
|
215
|
+
return { recorder, replay, goodId };
|
|
216
|
+
}
|
|
217
|
+
it('keeps the good in-memory sequence when a same-named load is rejected', async () => {
|
|
218
|
+
const { recorder, replay, goodId } = await withGoodSequence();
|
|
219
|
+
const filepath = await writeSequenceFile('bad.json', {
|
|
220
|
+
id: 'seq-from-disk-bad',
|
|
221
|
+
name: 'login',
|
|
222
|
+
commands: [{ tool: 'ntavigate', params: {} }],
|
|
223
|
+
createdAt: 2,
|
|
224
|
+
});
|
|
225
|
+
const res = await replay.handler({ action: 'load', filename: filepath });
|
|
226
|
+
expect(res.isError).toBe(true);
|
|
227
|
+
expect(text(res)).toContain('ntavigate');
|
|
228
|
+
// the original survives, unchanged, under the same id - and nothing else was stored
|
|
229
|
+
const remaining = recorder.listSequences();
|
|
230
|
+
expect(remaining).toHaveLength(1);
|
|
231
|
+
expect(remaining[0].id).toBe(goodId);
|
|
232
|
+
expect(remaining[0].commands.map(c => c.tool)).toEqual(['navigate']);
|
|
233
|
+
expect(recorder.getSequence('seq-from-disk-bad')).toBeUndefined();
|
|
234
|
+
});
|
|
235
|
+
it('still resolves the pre-existing sequence by name after a rejected load', async () => {
|
|
236
|
+
const { replay } = await withGoodSequence();
|
|
237
|
+
const filepath = await writeSequenceFile('bad-get.json', {
|
|
238
|
+
id: 'seq-from-disk-bad-2',
|
|
239
|
+
name: 'login',
|
|
240
|
+
commands: [{ tool: 'ntavigate', params: {} }],
|
|
241
|
+
createdAt: 2,
|
|
242
|
+
});
|
|
243
|
+
await replay.handler({ action: 'load', filename: filepath });
|
|
244
|
+
const got = await replay.handler({ action: 'get', name: 'login' });
|
|
245
|
+
expect(got.isError).toBeUndefined();
|
|
246
|
+
expect(text(got)).toContain('navigate');
|
|
247
|
+
expect(text(got)).not.toContain('ntavigate');
|
|
248
|
+
});
|
|
249
|
+
it('records nothing into history when a load with intoHistory is rejected', async () => {
|
|
250
|
+
const { recorder, replay, goodId } = await withGoodSequence();
|
|
251
|
+
const before = recorder.getStats().historyCount;
|
|
252
|
+
const filepath = await writeSequenceFile('bad-history.json', {
|
|
253
|
+
id: 'seq-from-disk-bad-3',
|
|
254
|
+
name: 'login',
|
|
255
|
+
commands: [{ tool: 'ntavigate', params: {} }],
|
|
256
|
+
createdAt: 2,
|
|
257
|
+
});
|
|
258
|
+
const res = await replay.handler({ action: 'load', filename: filepath, intoHistory: true });
|
|
259
|
+
expect(res.isError).toBe(true);
|
|
260
|
+
expect(recorder.getStats().historyCount).toBe(before);
|
|
261
|
+
expect(recorder.listSequences()).toHaveLength(1);
|
|
262
|
+
expect(recorder.listSequences()[0].id).toBe(goodId);
|
|
263
|
+
});
|
|
264
|
+
it('replaces the existing same-named sequence when the loaded one is valid', async () => {
|
|
265
|
+
const { recorder, replay } = await withGoodSequence();
|
|
266
|
+
const filepath = await writeSequenceFile('good.json', {
|
|
267
|
+
id: 'seq-from-disk-good',
|
|
268
|
+
name: 'login',
|
|
269
|
+
commands: [{ tool: 'navigate', params: {} }, { tool: 'inspect', params: {} }],
|
|
270
|
+
createdAt: 2,
|
|
271
|
+
});
|
|
272
|
+
const res = await replay.handler({ action: 'load', filename: filepath });
|
|
273
|
+
expect(res.isError).toBeUndefined();
|
|
274
|
+
const remaining = recorder.listSequences();
|
|
275
|
+
expect(remaining).toHaveLength(1);
|
|
276
|
+
expect(remaining[0].id).toBe('seq-from-disk-good');
|
|
277
|
+
expect(remaining[0].commands.map(c => c.tool)).toEqual(['navigate', 'inspect']);
|
|
278
|
+
});
|
|
279
|
+
});
|
|
280
|
+
//# sourceMappingURL=replay-tool-name-validation.test.js.map
|