tabwright 1.0.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/bin.js +4 -0
- package/dist/a11y-client.js +204 -0
- package/dist/agent-skills/tabwright/SKILL.md +119 -0
- package/dist/aria-snapshot.d.ts +262 -0
- package/dist/aria-snapshot.d.ts.map +1 -0
- package/dist/aria-snapshot.js +1256 -0
- package/dist/aria-snapshot.js.map +1 -0
- package/dist/aria-snapshot.test.d.ts +2 -0
- package/dist/aria-snapshot.test.d.ts.map +1 -0
- package/dist/aria-snapshot.test.js +270 -0
- package/dist/aria-snapshot.test.js.map +1 -0
- package/dist/aria-snapshot.unit.test.d.ts +2 -0
- package/dist/aria-snapshot.unit.test.d.ts.map +1 -0
- package/dist/aria-snapshot.unit.test.js +542 -0
- package/dist/aria-snapshot.unit.test.js.map +1 -0
- package/dist/assets/cursors/screen-studio/pointer-macos-tahoe-data-url.d.ts +5 -0
- package/dist/assets/cursors/screen-studio/pointer-macos-tahoe-data-url.d.ts.map +1 -0
- package/dist/assets/cursors/screen-studio/pointer-macos-tahoe-data-url.js +5 -0
- package/dist/assets/cursors/screen-studio/pointer-macos-tahoe-data-url.js.map +1 -0
- package/dist/bippy.js +894 -0
- package/dist/browser-config.d.ts +13 -0
- package/dist/browser-config.d.ts.map +1 -0
- package/dist/browser-config.js +126 -0
- package/dist/browser-config.js.map +1 -0
- package/dist/browser-install.d.ts +16 -0
- package/dist/browser-install.d.ts.map +1 -0
- package/dist/browser-install.js +238 -0
- package/dist/browser-install.js.map +1 -0
- package/dist/browser-launch.d.ts +17 -0
- package/dist/browser-launch.d.ts.map +1 -0
- package/dist/browser-launch.js +44 -0
- package/dist/browser-launch.js.map +1 -0
- package/dist/builtin-capabilities.d.ts +28 -0
- package/dist/builtin-capabilities.d.ts.map +1 -0
- package/dist/builtin-capabilities.js +2673 -0
- package/dist/builtin-capabilities.js.map +1 -0
- package/dist/capability-agent-skill.d.ts +60 -0
- package/dist/capability-agent-skill.d.ts.map +1 -0
- package/dist/capability-agent-skill.js +225 -0
- package/dist/capability-agent-skill.js.map +1 -0
- package/dist/capability-auth-state.d.ts +34 -0
- package/dist/capability-auth-state.d.ts.map +1 -0
- package/dist/capability-auth-state.js +157 -0
- package/dist/capability-auth-state.js.map +1 -0
- package/dist/capability-auth.d.ts +36 -0
- package/dist/capability-auth.d.ts.map +1 -0
- package/dist/capability-auth.js +198 -0
- package/dist/capability-auth.js.map +1 -0
- package/dist/capability-cli-confirmation.test.d.ts +2 -0
- package/dist/capability-cli-confirmation.test.d.ts.map +1 -0
- package/dist/capability-cli-confirmation.test.js +79 -0
- package/dist/capability-cli-confirmation.test.js.map +1 -0
- package/dist/capability-options.d.ts +20 -0
- package/dist/capability-options.d.ts.map +1 -0
- package/dist/capability-options.js +31 -0
- package/dist/capability-options.js.map +1 -0
- package/dist/capability-options.test.d.ts +2 -0
- package/dist/capability-options.test.d.ts.map +1 -0
- package/dist/capability-options.test.js +81 -0
- package/dist/capability-options.test.js.map +1 -0
- package/dist/capability-package.d.ts +27 -0
- package/dist/capability-package.d.ts.map +1 -0
- package/dist/capability-package.js +444 -0
- package/dist/capability-package.js.map +1 -0
- package/dist/capability-package.test.d.ts +2 -0
- package/dist/capability-package.test.d.ts.map +1 -0
- package/dist/capability-package.test.js +179 -0
- package/dist/capability-package.test.js.map +1 -0
- package/dist/capability-registry.d.ts +262 -0
- package/dist/capability-registry.d.ts.map +1 -0
- package/dist/capability-registry.js +931 -0
- package/dist/capability-registry.js.map +1 -0
- package/dist/capability-registry.test.d.ts +2 -0
- package/dist/capability-registry.test.d.ts.map +1 -0
- package/dist/capability-registry.test.js +1683 -0
- package/dist/capability-registry.test.js.map +1 -0
- package/dist/capability-runner.d.ts +99 -0
- package/dist/capability-runner.d.ts.map +1 -0
- package/dist/capability-runner.js +608 -0
- package/dist/capability-runner.js.map +1 -0
- package/dist/capability-search-relevance.test.d.ts +2 -0
- package/dist/capability-search-relevance.test.d.ts.map +1 -0
- package/dist/capability-search-relevance.test.js +67 -0
- package/dist/capability-search-relevance.test.js.map +1 -0
- package/dist/capability-studio.d.ts +11 -0
- package/dist/capability-studio.d.ts.map +1 -0
- package/dist/capability-studio.js +593 -0
- package/dist/capability-studio.js.map +1 -0
- package/dist/capability-studio.test.d.ts +2 -0
- package/dist/capability-studio.test.d.ts.map +1 -0
- package/dist/capability-studio.test.js +41 -0
- package/dist/capability-studio.test.js.map +1 -0
- package/dist/cdp-log.d.ts +19 -0
- package/dist/cdp-log.d.ts.map +1 -0
- package/dist/cdp-log.js +83 -0
- package/dist/cdp-log.js.map +1 -0
- package/dist/cdp-log.test.d.ts +2 -0
- package/dist/cdp-log.test.d.ts.map +1 -0
- package/dist/cdp-log.test.js +109 -0
- package/dist/cdp-log.test.js.map +1 -0
- package/dist/cdp-relay.d.ts +19 -0
- package/dist/cdp-relay.d.ts.map +1 -0
- package/dist/cdp-relay.js +2375 -0
- package/dist/cdp-relay.js.map +1 -0
- package/dist/cdp-session.d.ts +37 -0
- package/dist/cdp-session.d.ts.map +1 -0
- package/dist/cdp-session.js +36 -0
- package/dist/cdp-session.js.map +1 -0
- package/dist/cdp-types.d.ts +65 -0
- package/dist/cdp-types.d.ts.map +1 -0
- package/dist/cdp-types.js +91 -0
- package/dist/cdp-types.js.map +1 -0
- package/dist/channel-owner-inspect.test.d.ts +2 -0
- package/dist/channel-owner-inspect.test.d.ts.map +1 -0
- package/dist/channel-owner-inspect.test.js +75 -0
- package/dist/channel-owner-inspect.test.js.map +1 -0
- package/dist/chrome-discovery.d.ts +65 -0
- package/dist/chrome-discovery.d.ts.map +1 -0
- package/dist/chrome-discovery.js +173 -0
- package/dist/chrome-discovery.js.map +1 -0
- package/dist/chrome-discovery.test.d.ts +2 -0
- package/dist/chrome-discovery.test.d.ts.map +1 -0
- package/dist/chrome-discovery.test.js +41 -0
- package/dist/chrome-discovery.test.js.map +1 -0
- package/dist/clean-html.d.ts +11 -0
- package/dist/clean-html.d.ts.map +1 -0
- package/dist/clean-html.js +106 -0
- package/dist/clean-html.js.map +1 -0
- package/dist/cli-help.test.d.ts +2 -0
- package/dist/cli-help.test.d.ts.map +1 -0
- package/dist/cli-help.test.js +98 -0
- package/dist/cli-help.test.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +2709 -0
- package/dist/cli.js.map +1 -0
- package/dist/cloud-client.d.ts +56 -0
- package/dist/cloud-client.d.ts.map +1 -0
- package/dist/cloud-client.js +127 -0
- package/dist/cloud-client.js.map +1 -0
- package/dist/create-logger.d.ts +9 -0
- package/dist/create-logger.d.ts.map +1 -0
- package/dist/create-logger.js +27 -0
- package/dist/create-logger.js.map +1 -0
- package/dist/debugger-api.md +458 -0
- package/dist/debugger-examples-types.d.ts +24 -0
- package/dist/debugger-examples-types.d.ts.map +1 -0
- package/dist/debugger-examples-types.js +2 -0
- package/dist/debugger-examples-types.js.map +1 -0
- package/dist/debugger-examples.d.ts +6 -0
- package/dist/debugger-examples.d.ts.map +1 -0
- package/dist/debugger-examples.js +53 -0
- package/dist/debugger-examples.js.map +1 -0
- package/dist/debugger.d.ts +381 -0
- package/dist/debugger.d.ts.map +1 -0
- package/dist/debugger.js +630 -0
- package/dist/debugger.js.map +1 -0
- package/dist/diff-utils.d.ts +20 -0
- package/dist/diff-utils.d.ts.map +1 -0
- package/dist/diff-utils.js +50 -0
- package/dist/diff-utils.js.map +1 -0
- package/dist/diff-utils.test.d.ts +2 -0
- package/dist/diff-utils.test.d.ts.map +1 -0
- package/dist/diff-utils.test.js +137 -0
- package/dist/diff-utils.test.js.map +1 -0
- package/dist/doctor.d.ts +44 -0
- package/dist/doctor.d.ts.map +1 -0
- package/dist/doctor.js +246 -0
- package/dist/doctor.js.map +1 -0
- package/dist/doctor.test.d.ts +2 -0
- package/dist/doctor.test.d.ts.map +1 -0
- package/dist/doctor.test.js +208 -0
- package/dist/doctor.test.js.map +1 -0
- package/dist/editor-api.md +374 -0
- package/dist/editor-examples.d.ts +11 -0
- package/dist/editor-examples.d.ts.map +1 -0
- package/dist/editor-examples.js +124 -0
- package/dist/editor-examples.js.map +1 -0
- package/dist/editor.d.ts +203 -0
- package/dist/editor.d.ts.map +1 -0
- package/dist/editor.js +363 -0
- package/dist/editor.js.map +1 -0
- package/dist/env-compat.d.ts +2 -0
- package/dist/env-compat.d.ts.map +1 -0
- package/dist/env-compat.js +27 -0
- package/dist/env-compat.js.map +1 -0
- package/dist/executor.d.ts +229 -0
- package/dist/executor.d.ts.map +1 -0
- package/dist/executor.js +1465 -0
- package/dist/executor.js.map +1 -0
- package/dist/executor.unit.test.d.ts +2 -0
- package/dist/executor.unit.test.d.ts.map +1 -0
- package/dist/executor.unit.test.js +143 -0
- package/dist/executor.unit.test.js.map +1 -0
- package/dist/extension/_locales/en/messages.json +278 -0
- package/dist/extension/_locales/zh_CN/messages.json +256 -0
- package/dist/extension/assets/options-CYH96Lcx.css +1349 -0
- package/dist/extension/background.js +3994 -0
- package/dist/extension/icons/SolarCursorSquareBold.png +0 -0
- package/dist/extension/icons/icon-black-128.png +0 -0
- package/dist/extension/icons/icon-black-16.png +0 -0
- package/dist/extension/icons/icon-black-32.png +0 -0
- package/dist/extension/icons/icon-black-48.png +0 -0
- package/dist/extension/icons/icon-gray-128.png +0 -0
- package/dist/extension/icons/icon-gray-16.png +0 -0
- package/dist/extension/icons/icon-gray-32.png +0 -0
- package/dist/extension/icons/icon-gray-48.png +0 -0
- package/dist/extension/icons/icon-green-128.png +0 -0
- package/dist/extension/icons/icon-green-16.png +0 -0
- package/dist/extension/icons/icon-green-32.png +0 -0
- package/dist/extension/icons/icon-green-48.png +0 -0
- package/dist/extension/icons/tabwright-icon-black.png +0 -0
- package/dist/extension/icons/tabwright-icon-gray-disabled.png +0 -0
- package/dist/extension/icons/tabwright-icon-gray-disabled.svg +1 -0
- package/dist/extension/manifest.json +54 -0
- package/dist/extension/options.js +16145 -0
- package/dist/extension/rrweb-recorder.js +12952 -0
- package/dist/extension/src/options.html +165 -0
- package/dist/extension/src/prism-bash.min.js +1 -0
- package/dist/extension/src/prism.min.js +1 -0
- package/dist/extension/src/welcome.html +396 -0
- package/dist/extension-connection.test.d.ts +2 -0
- package/dist/extension-connection.test.d.ts.map +1 -0
- package/dist/extension-connection.test.js +708 -0
- package/dist/extension-connection.test.js.map +1 -0
- package/dist/extension-icon-warning.test.d.ts +2 -0
- package/dist/extension-icon-warning.test.d.ts.map +1 -0
- package/dist/extension-icon-warning.test.js +33 -0
- package/dist/extension-icon-warning.test.js.map +1 -0
- package/dist/ghost-browser.d.ts +62 -0
- package/dist/ghost-browser.d.ts.map +1 -0
- package/dist/ghost-browser.js +107 -0
- package/dist/ghost-browser.js.map +1 -0
- package/dist/ghost-cursor-client.js +374 -0
- package/dist/ghost-cursor-controller.d.ts +46 -0
- package/dist/ghost-cursor-controller.d.ts.map +1 -0
- package/dist/ghost-cursor-controller.js +98 -0
- package/dist/ghost-cursor-controller.js.map +1 -0
- package/dist/ghost-cursor.d.ts +27 -0
- package/dist/ghost-cursor.d.ts.map +1 -0
- package/dist/ghost-cursor.js +79 -0
- package/dist/ghost-cursor.js.map +1 -0
- package/dist/htmlrewrite.d.ts +8 -0
- package/dist/htmlrewrite.d.ts.map +1 -0
- package/dist/htmlrewrite.js +339 -0
- package/dist/htmlrewrite.js.map +1 -0
- package/dist/htmlrewrite.test.d.ts +2 -0
- package/dist/htmlrewrite.test.d.ts.map +1 -0
- package/dist/htmlrewrite.test.js +7975 -0
- package/dist/htmlrewrite.test.js.map +1 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -0
- package/dist/kill-port.d.ts +29 -0
- package/dist/kill-port.d.ts.map +1 -0
- package/dist/kill-port.js +190 -0
- package/dist/kill-port.js.map +1 -0
- package/dist/kitty-graphics.d.ts +22 -0
- package/dist/kitty-graphics.d.ts.map +1 -0
- package/dist/kitty-graphics.js +71 -0
- package/dist/kitty-graphics.js.map +1 -0
- package/dist/kitty-graphics.test.d.ts +2 -0
- package/dist/kitty-graphics.test.d.ts.map +1 -0
- package/dist/kitty-graphics.test.js +125 -0
- package/dist/kitty-graphics.test.js.map +1 -0
- package/dist/locator-selector.test.d.ts +2 -0
- package/dist/locator-selector.test.d.ts.map +1 -0
- package/dist/locator-selector.test.js +98 -0
- package/dist/locator-selector.test.js.map +1 -0
- package/dist/mcp-client.d.ts +20 -0
- package/dist/mcp-client.d.ts.map +1 -0
- package/dist/mcp-client.js +56 -0
- package/dist/mcp-client.js.map +1 -0
- package/dist/mcp.d.ts +6 -0
- package/dist/mcp.d.ts.map +1 -0
- package/dist/mcp.js +511 -0
- package/dist/mcp.js.map +1 -0
- package/dist/on-mouse-action.test.d.ts +2 -0
- package/dist/on-mouse-action.test.d.ts.map +1 -0
- package/dist/on-mouse-action.test.js +180 -0
- package/dist/on-mouse-action.test.js.map +1 -0
- package/dist/options-page.test.d.ts +2 -0
- package/dist/options-page.test.d.ts.map +1 -0
- package/dist/options-page.test.js +773 -0
- package/dist/options-page.test.js.map +1 -0
- package/dist/package-paths.d.ts +4 -0
- package/dist/package-paths.d.ts.map +1 -0
- package/dist/package-paths.js +30 -0
- package/dist/package-paths.js.map +1 -0
- package/dist/page-markdown.d.ts +40 -0
- package/dist/page-markdown.d.ts.map +1 -0
- package/dist/page-markdown.js +181 -0
- package/dist/page-markdown.js.map +1 -0
- package/dist/performance-examples.d.ts +5 -0
- package/dist/performance-examples.d.ts.map +1 -0
- package/dist/performance-examples.js +112 -0
- package/dist/performance-examples.js.map +1 -0
- package/dist/performance-profiling.md +417 -0
- package/dist/playwright-import.d.ts +19 -0
- package/dist/playwright-import.d.ts.map +1 -0
- package/dist/playwright-import.js +40 -0
- package/dist/playwright-import.js.map +1 -0
- package/dist/popup-relocation.test.d.ts +7 -0
- package/dist/popup-relocation.test.d.ts.map +1 -0
- package/dist/popup-relocation.test.js +139 -0
- package/dist/popup-relocation.test.js.map +1 -0
- package/dist/product-paths.d.ts +9 -0
- package/dist/product-paths.d.ts.map +1 -0
- package/dist/product-paths.js +24 -0
- package/dist/product-paths.js.map +1 -0
- package/dist/product-paths.test.d.ts +2 -0
- package/dist/product-paths.test.d.ts.map +1 -0
- package/dist/product-paths.test.js +39 -0
- package/dist/product-paths.test.js.map +1 -0
- package/dist/prompt.md +1004 -0
- package/dist/protocol.d.ts +248 -0
- package/dist/protocol.d.ts.map +1 -0
- package/dist/protocol.js +59 -0
- package/dist/protocol.js.map +1 -0
- package/dist/protocol.test.d.ts +2 -0
- package/dist/protocol.test.d.ts.map +1 -0
- package/dist/protocol.test.js +31 -0
- package/dist/protocol.test.js.map +1 -0
- package/dist/react-source.d.ts +57 -0
- package/dist/react-source.d.ts.map +1 -0
- package/dist/react-source.js +254 -0
- package/dist/react-source.js.map +1 -0
- package/dist/readability.js +1674 -0
- package/dist/relay-client.d.ts +104 -0
- package/dist/relay-client.d.ts.map +1 -0
- package/dist/relay-client.js +426 -0
- package/dist/relay-client.js.map +1 -0
- package/dist/relay-client.test.d.ts +2 -0
- package/dist/relay-client.test.d.ts.map +1 -0
- package/dist/relay-client.test.js +305 -0
- package/dist/relay-client.test.js.map +1 -0
- package/dist/relay-core.test.d.ts +2 -0
- package/dist/relay-core.test.d.ts.map +1 -0
- package/dist/relay-core.test.js +1427 -0
- package/dist/relay-core.test.js.map +1 -0
- package/dist/relay-navigation.test.d.ts +2 -0
- package/dist/relay-navigation.test.d.ts.map +1 -0
- package/dist/relay-navigation.test.js +661 -0
- package/dist/relay-navigation.test.js.map +1 -0
- package/dist/relay-session.test.d.ts +2 -0
- package/dist/relay-session.test.d.ts.map +1 -0
- package/dist/relay-session.test.js +1121 -0
- package/dist/relay-session.test.js.map +1 -0
- package/dist/relay-state.d.ts +178 -0
- package/dist/relay-state.d.ts.map +1 -0
- package/dist/relay-state.js +346 -0
- package/dist/relay-state.js.map +1 -0
- package/dist/relay-state.test.d.ts +2 -0
- package/dist/relay-state.test.d.ts.map +1 -0
- package/dist/relay-state.test.js +594 -0
- package/dist/relay-state.test.js.map +1 -0
- package/dist/replay-ai-index.d.ts +99 -0
- package/dist/replay-ai-index.d.ts.map +1 -0
- package/dist/replay-ai-index.js +677 -0
- package/dist/replay-ai-index.js.map +1 -0
- package/dist/replay-ai-index.test.d.ts +2 -0
- package/dist/replay-ai-index.test.d.ts.map +1 -0
- package/dist/replay-ai-index.test.js +255 -0
- package/dist/replay-ai-index.test.js.map +1 -0
- package/dist/replay-cli.test.d.ts +2 -0
- package/dist/replay-cli.test.d.ts.map +1 -0
- package/dist/replay-cli.test.js +275 -0
- package/dist/replay-cli.test.js.map +1 -0
- package/dist/replay-eval.d.ts +44 -0
- package/dist/replay-eval.d.ts.map +1 -0
- package/dist/replay-eval.js +902 -0
- package/dist/replay-eval.js.map +1 -0
- package/dist/replay-handoff.d.ts +29 -0
- package/dist/replay-handoff.d.ts.map +1 -0
- package/dist/replay-handoff.js +83 -0
- package/dist/replay-handoff.js.map +1 -0
- package/dist/replay-handoff.test.d.ts +2 -0
- package/dist/replay-handoff.test.d.ts.map +1 -0
- package/dist/replay-handoff.test.js +123 -0
- package/dist/replay-handoff.test.js.map +1 -0
- package/dist/replay-workflow-compiler.d.ts +44 -0
- package/dist/replay-workflow-compiler.d.ts.map +1 -0
- package/dist/replay-workflow-compiler.js +601 -0
- package/dist/replay-workflow-compiler.js.map +1 -0
- package/dist/replay-workflow-compiler.test.d.ts +2 -0
- package/dist/replay-workflow-compiler.test.d.ts.map +1 -0
- package/dist/replay-workflow-compiler.test.js +223 -0
- package/dist/replay-workflow-compiler.test.js.map +1 -0
- package/dist/rrweb-recording-relay.d.ts +56 -0
- package/dist/rrweb-recording-relay.d.ts.map +1 -0
- package/dist/rrweb-recording-relay.js +299 -0
- package/dist/rrweb-recording-relay.js.map +1 -0
- package/dist/rrweb-recording-relay.test.d.ts +2 -0
- package/dist/rrweb-recording-relay.test.d.ts.map +1 -0
- package/dist/rrweb-recording-relay.test.js +85 -0
- package/dist/rrweb-recording-relay.test.js.map +1 -0
- package/dist/rrweb-recording.d.ts +104 -0
- package/dist/rrweb-recording.d.ts.map +1 -0
- package/dist/rrweb-recording.js +180 -0
- package/dist/rrweb-recording.js.map +1 -0
- package/dist/scoped-fs.d.ts +95 -0
- package/dist/scoped-fs.d.ts.map +1 -0
- package/dist/scoped-fs.js +358 -0
- package/dist/scoped-fs.js.map +1 -0
- package/dist/scoped-fs.test.d.ts +5 -0
- package/dist/scoped-fs.test.d.ts.map +1 -0
- package/dist/scoped-fs.test.js +73 -0
- package/dist/scoped-fs.test.js.map +1 -0
- package/dist/selector-generator.js +7378 -0
- package/dist/skill-stub.test.d.ts +2 -0
- package/dist/skill-stub.test.d.ts.map +1 -0
- package/dist/skill-stub.test.js +22 -0
- package/dist/skill-stub.test.js.map +1 -0
- package/dist/snapshot-tools.test.d.ts +2 -0
- package/dist/snapshot-tools.test.d.ts.map +1 -0
- package/dist/snapshot-tools.test.js +856 -0
- package/dist/snapshot-tools.test.js.map +1 -0
- package/dist/start-relay-server.d.ts +6 -0
- package/dist/start-relay-server.d.ts.map +1 -0
- package/dist/start-relay-server.js +57 -0
- package/dist/start-relay-server.js.map +1 -0
- package/dist/styles-api.md +124 -0
- package/dist/styles-examples.d.ts +8 -0
- package/dist/styles-examples.d.ts.map +1 -0
- package/dist/styles-examples.js +64 -0
- package/dist/styles-examples.js.map +1 -0
- package/dist/styles.d.ts +27 -0
- package/dist/styles.d.ts.map +1 -0
- package/dist/styles.js +231 -0
- package/dist/styles.js.map +1 -0
- package/dist/tabwright-agent-skill.d.ts +30 -0
- package/dist/tabwright-agent-skill.d.ts.map +1 -0
- package/dist/tabwright-agent-skill.js +74 -0
- package/dist/tabwright-agent-skill.js.map +1 -0
- package/dist/tabwright-agent-skill.test.d.ts +2 -0
- package/dist/tabwright-agent-skill.test.d.ts.map +1 -0
- package/dist/tabwright-agent-skill.test.js +51 -0
- package/dist/tabwright-agent-skill.test.js.map +1 -0
- package/dist/test-declarations.d.ts +13 -0
- package/dist/test-declarations.d.ts.map +1 -0
- package/dist/test-declarations.js +2 -0
- package/dist/test-declarations.js.map +1 -0
- package/dist/test-utils.d.ts +69 -0
- package/dist/test-utils.d.ts.map +1 -0
- package/dist/test-utils.js +448 -0
- package/dist/test-utils.js.map +1 -0
- package/dist/test-utils.test.d.ts +2 -0
- package/dist/test-utils.test.d.ts.map +1 -0
- package/dist/test-utils.test.js +55 -0
- package/dist/test-utils.test.js.map +1 -0
- package/dist/utils.d.ts +26 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +60 -0
- package/dist/utils.js.map +1 -0
- package/dist/wait-for-page-load.d.ts +16 -0
- package/dist/wait-for-page-load.d.ts.map +1 -0
- package/dist/wait-for-page-load.js +146 -0
- package/dist/wait-for-page-load.js.map +1 -0
- package/dist/workflow-capability.d.ts +72 -0
- package/dist/workflow-capability.d.ts.map +1 -0
- package/dist/workflow-capability.js +316 -0
- package/dist/workflow-capability.js.map +1 -0
- package/dist/workflow-script-flow.test.d.ts +2 -0
- package/dist/workflow-script-flow.test.d.ts.map +1 -0
- package/dist/workflow-script-flow.test.js +285 -0
- package/dist/workflow-script-flow.test.js.map +1 -0
- package/package.json +80 -0
- package/src/__snapshots__/x.com.processed.html +1003 -0
- package/src/__snapshots__/x.com.processed.withStyles.html +2720 -0
- package/src/a11y-client.ts +241 -0
- package/src/agent-skills/conan-config/SKILL.md +141 -0
- package/src/agent-skills/conan-config/agents/openai.yaml +4 -0
- package/src/aria-snapshot.test.ts +311 -0
- package/src/aria-snapshot.ts +1681 -0
- package/src/aria-snapshot.unit.test.ts +615 -0
- package/src/aria-snapshots/github-interactive.txt +193 -0
- package/src/aria-snapshots/github-raw.txt +309 -0
- package/src/aria-snapshots/hackernews-interactive.txt +477 -0
- package/src/aria-snapshots/hackernews-raw.txt +428 -0
- package/src/aria-snapshots/prosemirror-interactive.txt +66 -0
- package/src/aria-snapshots/prosemirror-raw.txt +145 -0
- package/src/assets/aria-labels-hacker-news.png +0 -0
- package/src/assets/aria-labels-old-reddit.png +0 -0
- package/src/assets/cursors/screen-studio/pointer-macos-tahoe-data-url.ts +5 -0
- package/src/assets/cursors/screen-studio/pointer-macos-tahoe.svg +18 -0
- package/src/assets/x.com.html +32946 -0
- package/src/browser-config.ts +179 -0
- package/src/browser-install.ts +284 -0
- package/src/browser-launch.ts +75 -0
- package/src/builtin-capabilities.ts +2765 -0
- package/src/capability-agent-skill.ts +305 -0
- package/src/capability-auth-state.ts +197 -0
- package/src/capability-auth.ts +249 -0
- package/src/capability-cli-confirmation.test.ts +90 -0
- package/src/capability-options.test.ts +89 -0
- package/src/capability-options.ts +57 -0
- package/src/capability-package.test.ts +204 -0
- package/src/capability-package.ts +555 -0
- package/src/capability-registry.test.ts +1905 -0
- package/src/capability-registry.ts +1234 -0
- package/src/capability-runner.ts +801 -0
- package/src/capability-search-relevance.test.ts +73 -0
- package/src/capability-studio.test.ts +45 -0
- package/src/capability-studio.ts +641 -0
- package/src/cdp-log.test.ts +131 -0
- package/src/cdp-log.ts +112 -0
- package/src/cdp-relay.ts +2944 -0
- package/src/cdp-session.ts +77 -0
- package/src/cdp-types.ts +158 -0
- package/src/channel-owner-inspect.test.ts +94 -0
- package/src/chrome-discovery.test.ts +50 -0
- package/src/chrome-discovery.ts +220 -0
- package/src/clean-html.ts +141 -0
- package/src/cli-help.test.ts +123 -0
- package/src/cli.ts +3181 -0
- package/src/cloud-client.ts +179 -0
- package/src/create-logger.ts +38 -0
- package/src/debugger-examples-types.ts +16 -0
- package/src/debugger-examples.ts +66 -0
- package/src/debugger.ts +708 -0
- package/src/diff-utils.test.ts +152 -0
- package/src/diff-utils.ts +70 -0
- package/src/doctor.test.ts +244 -0
- package/src/doctor.ts +321 -0
- package/src/editor-examples.ts +158 -0
- package/src/editor.ts +426 -0
- package/src/env-compat.ts +28 -0
- package/src/executor.ts +1824 -0
- package/src/executor.unit.test.ts +168 -0
- package/src/extension-connection.test.ts +855 -0
- package/src/extension-icon-warning.test.ts +45 -0
- package/src/ghost-browser.ts +149 -0
- package/src/ghost-cursor-client.ts +494 -0
- package/src/ghost-cursor-controller.ts +129 -0
- package/src/ghost-cursor.ts +123 -0
- package/src/htmlrewrite.test.ts +8008 -0
- package/src/htmlrewrite.ts +390 -0
- package/src/index.ts +53 -0
- package/src/kill-port.ts +219 -0
- package/src/kitty-graphics.test.ts +139 -0
- package/src/kitty-graphics.ts +79 -0
- package/src/locator-selector.test.ts +119 -0
- package/src/mcp-client.ts +78 -0
- package/src/mcp.ts +629 -0
- package/src/on-mouse-action.test.ts +226 -0
- package/src/options-page.test.ts +839 -0
- package/src/package-paths.ts +38 -0
- package/src/page-markdown.ts +240 -0
- package/src/performance-examples.ts +186 -0
- package/src/playwright-import.ts +59 -0
- package/src/popup-relocation.test.ts +163 -0
- package/src/product-paths.test.ts +47 -0
- package/src/product-paths.ts +28 -0
- package/src/protocol.test.ts +52 -0
- package/src/protocol.ts +351 -0
- package/src/react-source.ts +379 -0
- package/src/relay-client.test.ts +375 -0
- package/src/relay-client.ts +572 -0
- package/src/relay-core.test.ts +1603 -0
- package/src/relay-navigation.test.ts +790 -0
- package/src/relay-session.test.ts +1375 -0
- package/src/relay-state.test.ts +729 -0
- package/src/relay-state.ts +561 -0
- package/src/replay-ai-index.test.ts +278 -0
- package/src/replay-ai-index.ts +872 -0
- package/src/replay-cli.test.ts +325 -0
- package/src/replay-eval.ts +1039 -0
- package/src/replay-handoff.test.ts +163 -0
- package/src/replay-handoff.ts +109 -0
- package/src/replay-workflow-compiler.test.ts +250 -0
- package/src/replay-workflow-compiler.ts +700 -0
- package/src/resource.md +409 -0
- package/src/rrweb-recording-relay.test.ts +99 -0
- package/src/rrweb-recording-relay.ts +400 -0
- package/src/rrweb-recording.ts +322 -0
- package/src/scoped-fs.test.ts +80 -0
- package/src/scoped-fs.ts +420 -0
- package/src/skill-stub.test.ts +24 -0
- package/src/skill.md +1413 -0
- package/src/snapshot-tools.test.ts +1017 -0
- package/src/snapshots/hacker-news-accessibility-full.md +81 -0
- package/src/snapshots/hacker-news-accessibility-interactive.md +43 -0
- package/src/snapshots/page-markdown-output.txt +16 -0
- package/src/snapshots/shadcn-ui-accessibility-full.md +201 -0
- package/src/snapshots/shadcn-ui-accessibility-interactive.md +109 -0
- package/src/start-relay-server.ts +69 -0
- package/src/styles-examples.ts +84 -0
- package/src/styles.ts +343 -0
- package/src/tabwright-agent-skill.test.ts +61 -0
- package/src/tabwright-agent-skill.ts +105 -0
- package/src/test-declarations.ts +13 -0
- package/src/test-utils.test.ts +70 -0
- package/src/test-utils.ts +566 -0
- package/src/utils.ts +78 -0
- package/src/wait-for-page-load.ts +198 -0
- package/src/workflow-capability.ts +417 -0
- package/src/workflow-script-flow.test.ts +388 -0
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { describe, expect, test } from 'vitest'
|
|
2
|
+
import { buildKittySequence, canEmitKittyGraphics } from './kitty-graphics.js'
|
|
3
|
+
|
|
4
|
+
// Minimal valid PNG (1x1 transparent pixel) as base64
|
|
5
|
+
const TINY_PNG_B64 =
|
|
6
|
+
'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg=='
|
|
7
|
+
|
|
8
|
+
describe('kitty-graphics', () => {
|
|
9
|
+
describe('canEmitKittyGraphics', () => {
|
|
10
|
+
test('returns false when AGENT_GRAPHICS is not set', () => {
|
|
11
|
+
const prev = process.env.AGENT_GRAPHICS
|
|
12
|
+
delete process.env.AGENT_GRAPHICS
|
|
13
|
+
expect(canEmitKittyGraphics()).toBe(false)
|
|
14
|
+
if (prev !== undefined) {
|
|
15
|
+
process.env.AGENT_GRAPHICS = prev
|
|
16
|
+
}
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
test('returns true when AGENT_GRAPHICS=kitty', () => {
|
|
20
|
+
const prev = process.env.AGENT_GRAPHICS
|
|
21
|
+
process.env.AGENT_GRAPHICS = 'kitty'
|
|
22
|
+
expect(canEmitKittyGraphics()).toBe(true)
|
|
23
|
+
if (prev !== undefined) {
|
|
24
|
+
process.env.AGENT_GRAPHICS = prev
|
|
25
|
+
} else {
|
|
26
|
+
delete process.env.AGENT_GRAPHICS
|
|
27
|
+
}
|
|
28
|
+
})
|
|
29
|
+
|
|
30
|
+
test('returns true when AGENT_GRAPHICS contains kitty among others', () => {
|
|
31
|
+
const prev = process.env.AGENT_GRAPHICS
|
|
32
|
+
process.env.AGENT_GRAPHICS = 'kitty,iterm2'
|
|
33
|
+
expect(canEmitKittyGraphics()).toBe(true)
|
|
34
|
+
if (prev !== undefined) {
|
|
35
|
+
process.env.AGENT_GRAPHICS = prev
|
|
36
|
+
} else {
|
|
37
|
+
delete process.env.AGENT_GRAPHICS
|
|
38
|
+
}
|
|
39
|
+
})
|
|
40
|
+
})
|
|
41
|
+
|
|
42
|
+
describe('buildKittySequence', () => {
|
|
43
|
+
test('small payload produces single escape sequence', () => {
|
|
44
|
+
const result = buildKittySequence({ base64: 'AAAA' })
|
|
45
|
+
expect(result).toMatchInlineSnapshot(`"_Ga=T,f=100;AAAA\\"`)
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
test('sequence starts with APC and ends with ST', () => {
|
|
49
|
+
const result = buildKittySequence({ base64: 'AAAA' })
|
|
50
|
+
expect(result.startsWith('\x1b_G')).toBe(true)
|
|
51
|
+
expect(result.endsWith('\x1b\\')).toBe(true)
|
|
52
|
+
})
|
|
53
|
+
|
|
54
|
+
test('real PNG base64 produces valid sequence', () => {
|
|
55
|
+
const result = buildKittySequence({ base64: TINY_PNG_B64 })
|
|
56
|
+
// Should be a single chunk (small payload)
|
|
57
|
+
expect(result).toContain('a=T,f=100')
|
|
58
|
+
expect(result).toContain(TINY_PNG_B64)
|
|
59
|
+
})
|
|
60
|
+
|
|
61
|
+
test('large payload is chunked at 4096 bytes', () => {
|
|
62
|
+
// Create a payload larger than 4096 bytes
|
|
63
|
+
const bigPayload = 'A'.repeat(10000)
|
|
64
|
+
const result = buildKittySequence({ base64: bigPayload })
|
|
65
|
+
|
|
66
|
+
// Should have multiple escape sequences
|
|
67
|
+
// First chunk: a=T,f=100,m=1
|
|
68
|
+
expect(result).toContain('a=T,f=100,m=1')
|
|
69
|
+
// Last chunk: m=0
|
|
70
|
+
expect(result).toContain('\x1b_Gm=0;')
|
|
71
|
+
// Should NOT contain single-shot a=T,f=100; (without m=)
|
|
72
|
+
expect(result).not.toMatch(/a=T,f=100;/)
|
|
73
|
+
})
|
|
74
|
+
|
|
75
|
+
test('three-chunk payload has correct structure', () => {
|
|
76
|
+
// 9000 bytes = 3 chunks: 4096 + 4096 + 808
|
|
77
|
+
const payload = 'B'.repeat(9000)
|
|
78
|
+
const result = buildKittySequence({ base64: payload })
|
|
79
|
+
|
|
80
|
+
const sequences = result.split('\x1b\\').filter(Boolean)
|
|
81
|
+
expect(sequences.length).toBe(3)
|
|
82
|
+
|
|
83
|
+
// First: a=T,f=100,m=1
|
|
84
|
+
expect(sequences[0]).toContain('a=T,f=100,m=1')
|
|
85
|
+
// Middle: m=1
|
|
86
|
+
expect(sequences[1]).toContain('\x1b_Gm=1;')
|
|
87
|
+
// Last: m=0
|
|
88
|
+
expect(sequences[2]).toContain('\x1b_Gm=0;')
|
|
89
|
+
})
|
|
90
|
+
})
|
|
91
|
+
|
|
92
|
+
describe('round-trip with kitty-graphics-agent parser', () => {
|
|
93
|
+
test('emitted sequence can be parsed back to extract the image', async () => {
|
|
94
|
+
// Dynamically import the parser to test round-trip
|
|
95
|
+
let extractKittyGraphics: typeof import('kitty-graphics-agent/parser').extractKittyGraphics
|
|
96
|
+
try {
|
|
97
|
+
const mod = await import('kitty-graphics-agent/parser')
|
|
98
|
+
extractKittyGraphics = mod.extractKittyGraphics
|
|
99
|
+
} catch {
|
|
100
|
+
// kitty-graphics-agent not installed, skip
|
|
101
|
+
console.log('kitty-graphics-agent not installed, skipping round-trip test')
|
|
102
|
+
return
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
const sequence = buildKittySequence({ base64: TINY_PNG_B64 })
|
|
106
|
+
const output = `some text before\n${sequence}\nsome text after`
|
|
107
|
+
const result = extractKittyGraphics(output)
|
|
108
|
+
|
|
109
|
+
expect(result.cleanedOutput).toMatchInlineSnapshot(`
|
|
110
|
+
"some text before
|
|
111
|
+
|
|
112
|
+
some text after"
|
|
113
|
+
`)
|
|
114
|
+
expect(result.images.length).toBe(1)
|
|
115
|
+
expect(result.images[0].mime).toBe('image/png')
|
|
116
|
+
expect(result.images[0].data).toBe(TINY_PNG_B64)
|
|
117
|
+
})
|
|
118
|
+
|
|
119
|
+
test('chunked sequence round-trips correctly', async () => {
|
|
120
|
+
let extractKittyGraphics: typeof import('kitty-graphics-agent/parser').extractKittyGraphics
|
|
121
|
+
try {
|
|
122
|
+
const mod = await import('kitty-graphics-agent/parser')
|
|
123
|
+
extractKittyGraphics = mod.extractKittyGraphics
|
|
124
|
+
} catch {
|
|
125
|
+
console.log('kitty-graphics-agent not installed, skipping round-trip test')
|
|
126
|
+
return
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
const bigPayload = 'A'.repeat(10000)
|
|
130
|
+
const sequence = buildKittySequence({ base64: bigPayload })
|
|
131
|
+
const result = extractKittyGraphics(sequence)
|
|
132
|
+
|
|
133
|
+
expect(result.cleanedOutput).toBe('')
|
|
134
|
+
expect(result.images.length).toBe(1)
|
|
135
|
+
expect(result.images[0].mime).toBe('image/png')
|
|
136
|
+
expect(result.images[0].data).toBe(bigPayload)
|
|
137
|
+
})
|
|
138
|
+
})
|
|
139
|
+
})
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
// Kitty Graphics Protocol emitter for CLI output.
|
|
2
|
+
// Emits base64-encoded PNG images as APC escape sequences so agents with
|
|
3
|
+
// kitty-graphics-agent (or compatible parsers) can extract and pass them
|
|
4
|
+
// to LLMs as media parts.
|
|
5
|
+
//
|
|
6
|
+
// Protocol format:
|
|
7
|
+
// \x1b_G<control_data>;<base64_payload>\x1b\\
|
|
8
|
+
//
|
|
9
|
+
// Only emits when AGENT_GRAPHICS env var contains 'kitty', signaling that
|
|
10
|
+
// an agent is intercepting stdout and can handle Kitty Graphics Protocol.
|
|
11
|
+
// See: https://github.com/remorses/kitty-graphics-agent
|
|
12
|
+
|
|
13
|
+
// Kitty spec recommends max 4096 bytes per chunk payload
|
|
14
|
+
const CHUNK_SIZE = 4096
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Check if the current environment supports Kitty Graphics Protocol output.
|
|
18
|
+
* Returns true when AGENT_GRAPHICS=kitty is set (agent is intercepting stdout).
|
|
19
|
+
*/
|
|
20
|
+
export function canEmitKittyGraphics(): boolean {
|
|
21
|
+
return process.env.AGENT_GRAPHICS?.includes('kitty') ?? false
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Emit a PNG image to stdout using the Kitty Graphics Protocol.
|
|
26
|
+
* The image is chunked per the spec (4096 bytes per chunk).
|
|
27
|
+
*
|
|
28
|
+
* Only call this when canEmitKittyGraphics() returns true.
|
|
29
|
+
*/
|
|
30
|
+
export function emitKittyImage({ base64 }: { base64: string }): void {
|
|
31
|
+
const chunks = splitIntoChunks(base64, CHUNK_SIZE)
|
|
32
|
+
|
|
33
|
+
if (chunks.length === 1) {
|
|
34
|
+
// Single chunk: no chunked transfer needed
|
|
35
|
+
process.stdout.write(`\x1b_Ga=T,f=100;${chunks[0]}\x1b\\`)
|
|
36
|
+
return
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// Multi-chunk: first chunk has full control data + m=1,
|
|
40
|
+
// continuation chunks have only m=1, last chunk has m=0
|
|
41
|
+
for (let i = 0; i < chunks.length; i++) {
|
|
42
|
+
const isFirst = i === 0
|
|
43
|
+
const isLast = i === chunks.length - 1
|
|
44
|
+
const control = isFirst ? 'a=T,f=100,m=1' : isLast ? 'm=0' : 'm=1'
|
|
45
|
+
process.stdout.write(`\x1b_G${control};${chunks[i]}\x1b\\`)
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function splitIntoChunks(str: string, size: number): string[] {
|
|
50
|
+
if (str.length <= size) {
|
|
51
|
+
return [str]
|
|
52
|
+
}
|
|
53
|
+
const chunks: string[] = []
|
|
54
|
+
for (let i = 0; i < str.length; i += size) {
|
|
55
|
+
chunks.push(str.slice(i, i + size))
|
|
56
|
+
}
|
|
57
|
+
return chunks
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Build the raw Kitty Graphics escape sequence string for a PNG image.
|
|
62
|
+
* Useful for testing without writing to stdout.
|
|
63
|
+
*/
|
|
64
|
+
export function buildKittySequence({ base64 }: { base64: string }): string {
|
|
65
|
+
const chunks = splitIntoChunks(base64, CHUNK_SIZE)
|
|
66
|
+
|
|
67
|
+
if (chunks.length === 1) {
|
|
68
|
+
return `\x1b_Ga=T,f=100;${chunks[0]}\x1b\\`
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
const parts: string[] = []
|
|
72
|
+
for (let i = 0; i < chunks.length; i++) {
|
|
73
|
+
const isFirst = i === 0
|
|
74
|
+
const isLast = i === chunks.length - 1
|
|
75
|
+
const control = isFirst ? 'a=T,f=100,m=1' : isLast ? 'm=0' : 'm=1'
|
|
76
|
+
parts.push(`\x1b_G${control};${chunks[i]}\x1b\\`)
|
|
77
|
+
}
|
|
78
|
+
return parts.join('')
|
|
79
|
+
}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
// Tests for Locator.selector() — verifies the raw selector strings returned
|
|
2
|
+
// by various locator creation methods (getByRole, locator, getByText, etc.)
|
|
3
|
+
|
|
4
|
+
import { describe, it, expect, beforeAll, afterAll } from 'vitest'
|
|
5
|
+
import { chromium, type Page, type Browser } from '@xmorse/playwright-core'
|
|
6
|
+
import { getLocalChromeExecutable } from './test-utils.js'
|
|
7
|
+
|
|
8
|
+
const HTML = `<!DOCTYPE html>
|
|
9
|
+
<html>
|
|
10
|
+
<body>
|
|
11
|
+
<div id="main">
|
|
12
|
+
<button>Submit</button>
|
|
13
|
+
<button>Cancel</button>
|
|
14
|
+
<button class="primary">Save</button>
|
|
15
|
+
<input type="text" placeholder="Enter name" />
|
|
16
|
+
<input type="email" placeholder="Enter email" />
|
|
17
|
+
<a href="/about">About Us</a>
|
|
18
|
+
<h1>Page Title</h1>
|
|
19
|
+
<p>Some paragraph text</p>
|
|
20
|
+
<div class="card">
|
|
21
|
+
<span>Card content</span>
|
|
22
|
+
</div>
|
|
23
|
+
<div class="card">
|
|
24
|
+
<span>Another card</span>
|
|
25
|
+
</div>
|
|
26
|
+
<div class="card">
|
|
27
|
+
<span>Third card</span>
|
|
28
|
+
</div>
|
|
29
|
+
<label for="age">Age</label>
|
|
30
|
+
<input id="age" type="number" />
|
|
31
|
+
<img alt="Logo" src="/logo.png" />
|
|
32
|
+
<div data-testid="dashboard">Dashboard</div>
|
|
33
|
+
</div>
|
|
34
|
+
</body>
|
|
35
|
+
</html>`
|
|
36
|
+
|
|
37
|
+
describe('Locator.selector()', () => {
|
|
38
|
+
let browser: Browser
|
|
39
|
+
let page: Page
|
|
40
|
+
|
|
41
|
+
beforeAll(async () => {
|
|
42
|
+
const chromeExecutable = getLocalChromeExecutable()
|
|
43
|
+
browser = await chromium.launch(
|
|
44
|
+
chromeExecutable ? { executablePath: chromeExecutable, headless: true } : { channel: 'chromium', headless: true },
|
|
45
|
+
)
|
|
46
|
+
const context = await browser.newContext()
|
|
47
|
+
page = await context.newPage()
|
|
48
|
+
await page.setContent(HTML)
|
|
49
|
+
})
|
|
50
|
+
|
|
51
|
+
afterAll(async () => {
|
|
52
|
+
await browser.close()
|
|
53
|
+
})
|
|
54
|
+
|
|
55
|
+
it('CSS selectors', () => {
|
|
56
|
+
expect(page.locator('#main').selector()).toMatchInlineSnapshot(`"#main"`)
|
|
57
|
+
expect(page.locator('.card').selector()).toMatchInlineSnapshot(`".card"`)
|
|
58
|
+
expect(page.locator('button').selector()).toMatchInlineSnapshot(`"button"`)
|
|
59
|
+
expect(page.locator('div.card > span').selector()).toMatchInlineSnapshot(`"div.card > span"`)
|
|
60
|
+
expect(page.locator('#main .card:first-child').selector()).toMatchInlineSnapshot(`"#main .card:first-child"`)
|
|
61
|
+
})
|
|
62
|
+
|
|
63
|
+
it('getByRole', () => {
|
|
64
|
+
expect(page.getByRole('button').selector()).toMatchInlineSnapshot(`"internal:role=button"`)
|
|
65
|
+
expect(page.getByRole('button', { name: 'Submit' }).selector()).toMatchInlineSnapshot(`"internal:role=button[name="Submit"i]"`)
|
|
66
|
+
expect(page.getByRole('link').selector()).toMatchInlineSnapshot(`"internal:role=link"`)
|
|
67
|
+
expect(page.getByRole('heading').selector()).toMatchInlineSnapshot(`"internal:role=heading"`)
|
|
68
|
+
expect(page.getByRole('textbox').selector()).toMatchInlineSnapshot(`"internal:role=textbox"`)
|
|
69
|
+
})
|
|
70
|
+
|
|
71
|
+
it('getByText', () => {
|
|
72
|
+
expect(page.getByText('Submit').selector()).toMatchInlineSnapshot(`"internal:text="Submit"i"`)
|
|
73
|
+
expect(page.getByText('Some paragraph').selector()).toMatchInlineSnapshot(`"internal:text="Some paragraph"i"`)
|
|
74
|
+
expect(page.getByText(/card/i).selector()).toMatchInlineSnapshot(`"internal:text=/card/i"`)
|
|
75
|
+
})
|
|
76
|
+
|
|
77
|
+
it('getByPlaceholder', () => {
|
|
78
|
+
expect(page.getByPlaceholder('Enter name').selector()).toMatchInlineSnapshot(`"internal:attr=[placeholder="Enter name"i]"`)
|
|
79
|
+
expect(page.getByPlaceholder('Enter email').selector()).toMatchInlineSnapshot(`"internal:attr=[placeholder="Enter email"i]"`)
|
|
80
|
+
})
|
|
81
|
+
|
|
82
|
+
it('getByLabel', () => {
|
|
83
|
+
expect(page.getByLabel('Age').selector()).toMatchInlineSnapshot(`"internal:label="Age"i"`)
|
|
84
|
+
})
|
|
85
|
+
|
|
86
|
+
it('getByAltText', () => {
|
|
87
|
+
expect(page.getByAltText('Logo').selector()).toMatchInlineSnapshot(`"internal:attr=[alt="Logo"i]"`)
|
|
88
|
+
})
|
|
89
|
+
|
|
90
|
+
it('getByTestId', () => {
|
|
91
|
+
expect(page.getByTestId('dashboard').selector()).toMatchInlineSnapshot(`"internal:testid=[data-testid="dashboard"s]"`)
|
|
92
|
+
})
|
|
93
|
+
|
|
94
|
+
it('chained locators', () => {
|
|
95
|
+
expect(page.locator('#main').locator('.card').selector()).toMatchInlineSnapshot(`"#main >> .card"`)
|
|
96
|
+
expect(page.locator('.card').first().selector()).toMatchInlineSnapshot(`".card >> nth=0"`)
|
|
97
|
+
expect(page.locator('.card').last().selector()).toMatchInlineSnapshot(`".card >> nth=-1"`)
|
|
98
|
+
expect(page.locator('.card').nth(1).selector()).toMatchInlineSnapshot(`".card >> nth=1"`)
|
|
99
|
+
})
|
|
100
|
+
|
|
101
|
+
it('filtered locators', () => {
|
|
102
|
+
expect(page.locator('button').filter({ hasText: 'Save' }).selector()).toMatchInlineSnapshot(`"button >> internal:has-text="Save"i"`)
|
|
103
|
+
expect(page.locator('div').filter({ has: page.locator('span') }).selector()).toMatchInlineSnapshot(`"div >> internal:has="span""`)
|
|
104
|
+
expect(page.locator('button').filter({ hasNotText: 'Cancel' }).selector()).toMatchInlineSnapshot(`"button >> internal:has-not-text="Cancel"i"`)
|
|
105
|
+
})
|
|
106
|
+
|
|
107
|
+
it('described locators', () => {
|
|
108
|
+
expect(page.locator('button').describe('main action button').selector()).toMatchInlineSnapshot(`"button >> internal:describe="main action button""`)
|
|
109
|
+
})
|
|
110
|
+
|
|
111
|
+
it('combined with and/or', () => {
|
|
112
|
+
expect(
|
|
113
|
+
page.locator('button').and(page.locator('.primary')).selector(),
|
|
114
|
+
).toMatchInlineSnapshot(`"button >> internal:and=".primary""`)
|
|
115
|
+
expect(
|
|
116
|
+
page.locator('button').or(page.locator('a')).selector(),
|
|
117
|
+
).toMatchInlineSnapshot(`"button >> internal:or="a""`)
|
|
118
|
+
})
|
|
119
|
+
})
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { Client } from '@modelcontextprotocol/sdk/client/index.js'
|
|
2
|
+
import { StdioClientTransport } from '@modelcontextprotocol/sdk/client/stdio.js'
|
|
3
|
+
import type { Transport } from '@modelcontextprotocol/sdk/shared/transport.js'
|
|
4
|
+
import { Stream } from 'node:stream'
|
|
5
|
+
import path from 'node:path'
|
|
6
|
+
import url from 'node:url'
|
|
7
|
+
|
|
8
|
+
const __filename = url.fileURLToPath(import.meta.url)
|
|
9
|
+
|
|
10
|
+
export interface CreateTransportOptions {
|
|
11
|
+
clientName?: string
|
|
12
|
+
port?: number
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export async function createTransport({ args = [], port }: { args?: string[]; port?: number } = {}): Promise<{
|
|
16
|
+
transport: Transport
|
|
17
|
+
stderr: Stream | null
|
|
18
|
+
}> {
|
|
19
|
+
const env: Record<string, string> = {
|
|
20
|
+
...(process.env as Record<string, string>),
|
|
21
|
+
DEBUG: 'tabwright:mcp:test',
|
|
22
|
+
DEBUG_COLORS: '0',
|
|
23
|
+
DEBUG_HIDE_DATE: '1',
|
|
24
|
+
}
|
|
25
|
+
if (port) {
|
|
26
|
+
env.PLAYWRITER_PORT = String(port)
|
|
27
|
+
}
|
|
28
|
+
const transport = new StdioClientTransport({
|
|
29
|
+
command: 'pnpm',
|
|
30
|
+
args: ['vite-node', path.join(path.dirname(__filename), 'cli.ts'), ...args],
|
|
31
|
+
cwd: path.join(path.dirname(__filename), '..'),
|
|
32
|
+
stderr: 'pipe',
|
|
33
|
+
env,
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
return {
|
|
37
|
+
transport,
|
|
38
|
+
stderr: transport.stderr!,
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export async function createMCPClient(options?: CreateTransportOptions): Promise<{
|
|
43
|
+
client: Client
|
|
44
|
+
stderr: string
|
|
45
|
+
cleanup: () => Promise<void>
|
|
46
|
+
}> {
|
|
47
|
+
const client = new Client({
|
|
48
|
+
name: options?.clientName ?? 'test',
|
|
49
|
+
version: '1.0.0',
|
|
50
|
+
})
|
|
51
|
+
|
|
52
|
+
const { transport, stderr } = await createTransport({ port: options?.port })
|
|
53
|
+
|
|
54
|
+
let stderrBuffer = ''
|
|
55
|
+
stderr?.on('data', (data) => {
|
|
56
|
+
process.stderr.write(data)
|
|
57
|
+
|
|
58
|
+
stderrBuffer += data.toString()
|
|
59
|
+
})
|
|
60
|
+
|
|
61
|
+
await client.connect(transport)
|
|
62
|
+
await client.ping()
|
|
63
|
+
|
|
64
|
+
const cleanup = async () => {
|
|
65
|
+
try {
|
|
66
|
+
await client.close()
|
|
67
|
+
} catch (e) {
|
|
68
|
+
console.error('Error during MCP client cleanup:', e)
|
|
69
|
+
// Ignore errors during cleanup
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
return {
|
|
74
|
+
client,
|
|
75
|
+
stderr: stderrBuffer,
|
|
76
|
+
cleanup,
|
|
77
|
+
}
|
|
78
|
+
}
|