@browserbasehq/orca 3.4.0-preview-3 → 3.4.0-preview-5
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/dist/cjs/lib/v3/agent/AgentProvider.d.ts +1 -1
- package/dist/cjs/lib/v3/agent/AgentProvider.js.map +1 -1
- package/dist/cjs/lib/v3/agent/AnthropicCUAClient.js +10 -0
- package/dist/cjs/lib/v3/agent/AnthropicCUAClient.js.map +1 -1
- package/dist/cjs/lib/v3/handlers/v3CuaAgentHandler.js +1 -0
- package/dist/cjs/lib/v3/handlers/v3CuaAgentHandler.js.map +1 -1
- package/dist/cjs/lib/v3/launch/local.d.ts +2 -7
- package/dist/cjs/lib/v3/launch/local.js +47 -7
- package/dist/cjs/lib/v3/launch/local.js.map +1 -1
- package/dist/cjs/lib/v3/llm/aisdk.js +5 -0
- package/dist/cjs/lib/v3/llm/aisdk.js.map +1 -1
- package/dist/cjs/lib/v3/types/private/snapshot.d.ts +2 -0
- package/dist/cjs/lib/v3/types/private/snapshot.js.map +1 -1
- package/dist/cjs/lib/v3/types/public/agent.d.ts +1 -1
- package/dist/cjs/lib/v3/types/public/agent.js.map +1 -1
- package/dist/cjs/lib/v3/types/public/api.d.ts +283 -0
- package/dist/cjs/lib/v3/types/public/api.js +50 -3
- package/dist/cjs/lib/v3/types/public/api.js.map +1 -1
- package/dist/cjs/lib/v3/types/public/model.d.ts +11 -7
- package/dist/cjs/lib/v3/types/public/model.js.map +1 -1
- package/dist/cjs/lib/v3/understudy/a11y/snapshot/a11yTree.js +25 -0
- package/dist/cjs/lib/v3/understudy/a11y/snapshot/a11yTree.js.map +1 -1
- package/dist/cjs/lib/v3/understudy/a11y/snapshot/treeFormatUtils.js +10 -1
- package/dist/cjs/lib/v3/understudy/a11y/snapshot/treeFormatUtils.js.map +1 -1
- package/dist/cjs/lib/v3/v3.js +2 -47
- package/dist/cjs/lib/v3/v3.js.map +1 -1
- package/dist/cjs/lib/version.d.ts +1 -1
- package/dist/cjs/lib/version.js +1 -1
- package/dist/cjs/lib/version.js.map +1 -1
- package/dist/esm/lib/v3/agent/AgentProvider.d.ts +1 -1
- package/dist/esm/lib/v3/agent/AgentProvider.js.map +1 -1
- package/dist/esm/lib/v3/agent/AnthropicCUAClient.js +10 -0
- package/dist/esm/lib/v3/agent/AnthropicCUAClient.js.map +1 -1
- package/dist/esm/lib/v3/handlers/v3CuaAgentHandler.js +1 -0
- package/dist/esm/lib/v3/handlers/v3CuaAgentHandler.js.map +1 -1
- package/dist/esm/lib/v3/launch/local.d.ts +2 -7
- package/dist/esm/lib/v3/launch/local.js +48 -8
- package/dist/esm/lib/v3/launch/local.js.map +1 -1
- package/dist/esm/lib/v3/llm/aisdk.js +5 -0
- package/dist/esm/lib/v3/llm/aisdk.js.map +1 -1
- package/dist/esm/lib/v3/types/private/snapshot.d.ts +2 -0
- package/dist/esm/lib/v3/types/private/snapshot.js.map +1 -1
- package/dist/esm/lib/v3/types/public/agent.d.ts +1 -1
- package/dist/esm/lib/v3/types/public/agent.js.map +1 -1
- package/dist/esm/lib/v3/types/public/api.d.ts +283 -0
- package/dist/esm/lib/v3/types/public/api.js +48 -1
- package/dist/esm/lib/v3/types/public/api.js.map +1 -1
- package/dist/esm/lib/v3/types/public/model.d.ts +11 -7
- package/dist/esm/lib/v3/types/public/model.js.map +1 -1
- package/dist/esm/lib/v3/understudy/a11y/snapshot/a11yTree.js +25 -0
- package/dist/esm/lib/v3/understudy/a11y/snapshot/a11yTree.js.map +1 -1
- package/dist/esm/lib/v3/understudy/a11y/snapshot/treeFormatUtils.js +10 -1
- package/dist/esm/lib/v3/understudy/a11y/snapshot/treeFormatUtils.js.map +1 -1
- package/dist/esm/lib/v3/v3.js +2 -47
- package/dist/esm/lib/v3/v3.js.map +1 -1
- package/dist/esm/lib/version.d.ts +1 -1
- package/dist/esm/lib/version.js +1 -1
- package/dist/esm/lib/version.js.map +1 -1
- package/package.json +8 -8
- package/dist/cjs/tests/cache-variables.test.d.ts +0 -1
- package/dist/cjs/tests/cache-variables.test.js +0 -221
- package/dist/cjs/tests/cache-variables.test.js.map +0 -1
- package/dist/cjs/tests/integration/agent-abort-signal.spec.d.ts +0 -1
- package/dist/cjs/tests/integration/agent-abort-signal.spec.js +0 -123
- package/dist/cjs/tests/integration/agent-abort-signal.spec.js.map +0 -1
- package/dist/cjs/tests/integration/agent-cache-self-heal.spec.d.ts +0 -1
- package/dist/cjs/tests/integration/agent-cache-self-heal.spec.js +0 -83
- package/dist/cjs/tests/integration/agent-cache-self-heal.spec.js.map +0 -1
- package/dist/cjs/tests/integration/agent-callbacks.spec.d.ts +0 -1
- package/dist/cjs/tests/integration/agent-callbacks.spec.js +0 -385
- package/dist/cjs/tests/integration/agent-callbacks.spec.js.map +0 -1
- package/dist/cjs/tests/integration/agent-experimental-validation.spec.d.ts +0 -1
- package/dist/cjs/tests/integration/agent-experimental-validation.spec.js +0 -362
- package/dist/cjs/tests/integration/agent-experimental-validation.spec.js.map +0 -1
- package/dist/cjs/tests/integration/agent-hybrid-mode.spec.d.ts +0 -1
- package/dist/cjs/tests/integration/agent-hybrid-mode.spec.js +0 -262
- package/dist/cjs/tests/integration/agent-hybrid-mode.spec.js.map +0 -1
- package/dist/cjs/tests/integration/agent-message-continuation.spec.d.ts +0 -1
- package/dist/cjs/tests/integration/agent-message-continuation.spec.js +0 -112
- package/dist/cjs/tests/integration/agent-message-continuation.spec.js.map +0 -1
- package/dist/cjs/tests/integration/agent-streaming.spec.d.ts +0 -1
- package/dist/cjs/tests/integration/agent-streaming.spec.js +0 -140
- package/dist/cjs/tests/integration/agent-streaming.spec.js.map +0 -1
- package/dist/cjs/tests/integration/cdp-close-api-region.spec.d.ts +0 -1
- package/dist/cjs/tests/integration/cdp-close-api-region.spec.js +0 -41
- package/dist/cjs/tests/integration/cdp-close-api-region.spec.js.map +0 -1
- package/dist/cjs/tests/integration/cdp-connection-close.spec.d.ts +0 -1
- package/dist/cjs/tests/integration/cdp-connection-close.spec.js +0 -76
- package/dist/cjs/tests/integration/cdp-connection-close.spec.js.map +0 -1
- package/dist/cjs/tests/integration/cdp-session-detached.spec.d.ts +0 -1
- package/dist/cjs/tests/integration/cdp-session-detached.spec.js +0 -45
- package/dist/cjs/tests/integration/cdp-session-detached.spec.js.map +0 -1
- package/dist/cjs/tests/integration/chrome-newtab-page-tracking.spec.d.ts +0 -1
- package/dist/cjs/tests/integration/chrome-newtab-page-tracking.spec.js +0 -56
- package/dist/cjs/tests/integration/chrome-newtab-page-tracking.spec.js.map +0 -1
- package/dist/cjs/tests/integration/click-count.spec.d.ts +0 -1
- package/dist/cjs/tests/integration/click-count.spec.js +0 -163
- package/dist/cjs/tests/integration/click-count.spec.js.map +0 -1
- package/dist/cjs/tests/integration/connect-to-existing-browser.spec.d.ts +0 -1
- package/dist/cjs/tests/integration/connect-to-existing-browser.spec.js +0 -99
- package/dist/cjs/tests/integration/connect-to-existing-browser.spec.js.map +0 -1
- package/dist/cjs/tests/integration/context-addInitScript.spec.d.ts +0 -1
- package/dist/cjs/tests/integration/context-addInitScript.spec.js +0 -285
- package/dist/cjs/tests/integration/context-addInitScript.spec.js.map +0 -1
- package/dist/cjs/tests/integration/context-extra-http-headers.spec.d.ts +0 -1
- package/dist/cjs/tests/integration/context-extra-http-headers.spec.js +0 -49
- package/dist/cjs/tests/integration/context-extra-http-headers.spec.js.map +0 -1
- package/dist/cjs/tests/integration/cookies.spec.d.ts +0 -1
- package/dist/cjs/tests/integration/cookies.spec.js +0 -187
- package/dist/cjs/tests/integration/cookies.spec.js.map +0 -1
- package/dist/cjs/tests/integration/default-page-tracking.spec.d.ts +0 -1
- package/dist/cjs/tests/integration/default-page-tracking.spec.js +0 -52
- package/dist/cjs/tests/integration/default-page-tracking.spec.js.map +0 -1
- package/dist/cjs/tests/integration/downloads.spec.d.ts +0 -1
- package/dist/cjs/tests/integration/downloads.spec.js +0 -52
- package/dist/cjs/tests/integration/downloads.spec.js.map +0 -1
- package/dist/cjs/tests/integration/flowLogger.spec.d.ts +0 -1
- package/dist/cjs/tests/integration/flowLogger.spec.js +0 -718
- package/dist/cjs/tests/integration/flowLogger.spec.js.map +0 -1
- package/dist/cjs/tests/integration/frame-get-location-and-click.spec.d.ts +0 -1
- package/dist/cjs/tests/integration/frame-get-location-and-click.spec.js +0 -57
- package/dist/cjs/tests/integration/frame-get-location-and-click.spec.js.map +0 -1
- package/dist/cjs/tests/integration/iframe-ctx-addInitScript-race.spec.d.ts +0 -1
- package/dist/cjs/tests/integration/iframe-ctx-addInitScript-race.spec.js +0 -219
- package/dist/cjs/tests/integration/iframe-ctx-addInitScript-race.spec.js.map +0 -1
- package/dist/cjs/tests/integration/iframe-ctx-addInitScript.spec.d.ts +0 -1
- package/dist/cjs/tests/integration/iframe-ctx-addInitScript.spec.js +0 -474
- package/dist/cjs/tests/integration/iframe-ctx-addInitScript.spec.js.map +0 -1
- package/dist/cjs/tests/integration/keep-alive.child.d.ts +0 -1
- package/dist/cjs/tests/integration/keep-alive.child.js +0 -85
- package/dist/cjs/tests/integration/keep-alive.child.js.map +0 -1
- package/dist/cjs/tests/integration/keep-alive.spec.d.ts +0 -22
- package/dist/cjs/tests/integration/keep-alive.spec.js +0 -490
- package/dist/cjs/tests/integration/keep-alive.spec.js.map +0 -1
- package/dist/cjs/tests/integration/keyboard.spec.d.ts +0 -1
- package/dist/cjs/tests/integration/keyboard.spec.js +0 -259
- package/dist/cjs/tests/integration/keyboard.spec.js.map +0 -1
- package/dist/cjs/tests/integration/locator-backend-node-id.spec.d.ts +0 -1
- package/dist/cjs/tests/integration/locator-backend-node-id.spec.js +0 -150
- package/dist/cjs/tests/integration/locator-backend-node-id.spec.js.map +0 -1
- package/dist/cjs/tests/integration/locator-content-methods.spec.d.ts +0 -1
- package/dist/cjs/tests/integration/locator-content-methods.spec.js +0 -180
- package/dist/cjs/tests/integration/locator-content-methods.spec.js.map +0 -1
- package/dist/cjs/tests/integration/locator-count-iframe.spec.d.ts +0 -1
- package/dist/cjs/tests/integration/locator-count-iframe.spec.js +0 -129
- package/dist/cjs/tests/integration/locator-count-iframe.spec.js.map +0 -1
- package/dist/cjs/tests/integration/locator-count.spec.d.ts +0 -1
- package/dist/cjs/tests/integration/locator-count.spec.js +0 -68
- package/dist/cjs/tests/integration/locator-count.spec.js.map +0 -1
- package/dist/cjs/tests/integration/locator-fill.spec.d.ts +0 -1
- package/dist/cjs/tests/integration/locator-fill.spec.js +0 -117
- package/dist/cjs/tests/integration/locator-fill.spec.js.map +0 -1
- package/dist/cjs/tests/integration/locator-input-methods.spec.d.ts +0 -1
- package/dist/cjs/tests/integration/locator-input-methods.spec.js +0 -127
- package/dist/cjs/tests/integration/locator-input-methods.spec.js.map +0 -1
- package/dist/cjs/tests/integration/locator-nth.spec.d.ts +0 -1
- package/dist/cjs/tests/integration/locator-nth.spec.js +0 -175
- package/dist/cjs/tests/integration/locator-nth.spec.js.map +0 -1
- package/dist/cjs/tests/integration/locator-select-option.spec.d.ts +0 -1
- package/dist/cjs/tests/integration/locator-select-option.spec.js +0 -216
- package/dist/cjs/tests/integration/locator-select-option.spec.js.map +0 -1
- package/dist/cjs/tests/integration/logger-initialization.spec.d.ts +0 -1
- package/dist/cjs/tests/integration/logger-initialization.spec.js +0 -597
- package/dist/cjs/tests/integration/logger-initialization.spec.js.map +0 -1
- package/dist/cjs/tests/integration/multi-instance-logger.spec.d.ts +0 -1
- package/dist/cjs/tests/integration/multi-instance-logger.spec.js +0 -293
- package/dist/cjs/tests/integration/multi-instance-logger.spec.js.map +0 -1
- package/dist/cjs/tests/integration/nested-div.spec.d.ts +0 -1
- package/dist/cjs/tests/integration/nested-div.spec.js +0 -22
- package/dist/cjs/tests/integration/nested-div.spec.js.map +0 -1
- package/dist/cjs/tests/integration/observe-element-id-format.spec.d.ts +0 -1
- package/dist/cjs/tests/integration/observe-element-id-format.spec.js +0 -130
- package/dist/cjs/tests/integration/observe-element-id-format.spec.js.map +0 -1
- package/dist/cjs/tests/integration/page-addInitScript.spec.d.ts +0 -1
- package/dist/cjs/tests/integration/page-addInitScript.spec.js +0 -94
- package/dist/cjs/tests/integration/page-addInitScript.spec.js.map +0 -1
- package/dist/cjs/tests/integration/page-console.spec.d.ts +0 -1
- package/dist/cjs/tests/integration/page-console.spec.js +0 -47
- package/dist/cjs/tests/integration/page-console.spec.js.map +0 -1
- package/dist/cjs/tests/integration/page-drag-and-drop.spec.d.ts +0 -1
- package/dist/cjs/tests/integration/page-drag-and-drop.spec.js +0 -437
- package/dist/cjs/tests/integration/page-drag-and-drop.spec.js.map +0 -1
- package/dist/cjs/tests/integration/page-extra-http-headers.spec.d.ts +0 -1
- package/dist/cjs/tests/integration/page-extra-http-headers.spec.js +0 -85
- package/dist/cjs/tests/integration/page-extra-http-headers.spec.js.map +0 -1
- package/dist/cjs/tests/integration/page-goto-response.spec.d.ts +0 -1
- package/dist/cjs/tests/integration/page-goto-response.spec.js +0 -34
- package/dist/cjs/tests/integration/page-goto-response.spec.js.map +0 -1
- package/dist/cjs/tests/integration/page-hover.spec.d.ts +0 -1
- package/dist/cjs/tests/integration/page-hover.spec.js +0 -165
- package/dist/cjs/tests/integration/page-hover.spec.js.map +0 -1
- package/dist/cjs/tests/integration/page-screenshot.spec.d.ts +0 -1
- package/dist/cjs/tests/integration/page-screenshot.spec.js +0 -292
- package/dist/cjs/tests/integration/page-screenshot.spec.js.map +0 -1
- package/dist/cjs/tests/integration/page-scroll.spec.d.ts +0 -1
- package/dist/cjs/tests/integration/page-scroll.spec.js +0 -183
- package/dist/cjs/tests/integration/page-scroll.spec.js.map +0 -1
- package/dist/cjs/tests/integration/page-send-cdp.spec.d.ts +0 -1
- package/dist/cjs/tests/integration/page-send-cdp.spec.js +0 -47
- package/dist/cjs/tests/integration/page-send-cdp.spec.js.map +0 -1
- package/dist/cjs/tests/integration/perform-understudy-method.spec.d.ts +0 -1
- package/dist/cjs/tests/integration/perform-understudy-method.spec.js +0 -63
- package/dist/cjs/tests/integration/perform-understudy-method.spec.js.map +0 -1
- package/dist/cjs/tests/integration/setinputfiles.spec.d.ts +0 -1
- package/dist/cjs/tests/integration/setinputfiles.spec.js +0 -133
- package/dist/cjs/tests/integration/setinputfiles.spec.js.map +0 -1
- package/dist/cjs/tests/integration/shadow-iframe-oopif.spec.d.ts +0 -1
- package/dist/cjs/tests/integration/shadow-iframe-oopif.spec.js +0 -161
- package/dist/cjs/tests/integration/shadow-iframe-oopif.spec.js.map +0 -1
- package/dist/cjs/tests/integration/shadow-iframe-spif.spec.d.ts +0 -1
- package/dist/cjs/tests/integration/shadow-iframe-spif.spec.js +0 -160
- package/dist/cjs/tests/integration/shadow-iframe-spif.spec.js.map +0 -1
- package/dist/cjs/tests/integration/testUtils.d.ts +0 -40
- package/dist/cjs/tests/integration/testUtils.js +0 -188
- package/dist/cjs/tests/integration/testUtils.js.map +0 -1
- package/dist/cjs/tests/integration/text-selector-innermost.spec.d.ts +0 -1
- package/dist/cjs/tests/integration/text-selector-innermost.spec.js +0 -105
- package/dist/cjs/tests/integration/text-selector-innermost.spec.js.map +0 -1
- package/dist/cjs/tests/integration/timeouts.spec.d.ts +0 -1
- package/dist/cjs/tests/integration/timeouts.spec.js +0 -309
- package/dist/cjs/tests/integration/timeouts.spec.js.map +0 -1
- package/dist/cjs/tests/integration/user-data-dir.spec.d.ts +0 -1
- package/dist/cjs/tests/integration/user-data-dir.spec.js +0 -77
- package/dist/cjs/tests/integration/user-data-dir.spec.js.map +0 -1
- package/dist/cjs/tests/integration/v3.config.d.ts +0 -4
- package/dist/cjs/tests/integration/v3.config.js +0 -11
- package/dist/cjs/tests/integration/v3.config.js.map +0 -1
- package/dist/cjs/tests/integration/v3.dynamic.config.d.ts +0 -4
- package/dist/cjs/tests/integration/v3.dynamic.config.js +0 -48
- package/dist/cjs/tests/integration/v3.dynamic.config.js.map +0 -1
- package/dist/cjs/tests/integration/v3.playwright.config.d.ts +0 -2
- package/dist/cjs/tests/integration/v3.playwright.config.js +0 -48
- package/dist/cjs/tests/integration/v3.playwright.config.js.map +0 -1
- package/dist/cjs/tests/integration/wait-for-selector.spec.d.ts +0 -1
- package/dist/cjs/tests/integration/wait-for-selector.spec.js +0 -683
- package/dist/cjs/tests/integration/wait-for-selector.spec.js.map +0 -1
- package/dist/cjs/tests/integration/wait-for-timeout.spec.d.ts +0 -1
- package/dist/cjs/tests/integration/wait-for-timeout.spec.js +0 -118
- package/dist/cjs/tests/integration/wait-for-timeout.spec.js.map +0 -1
- package/dist/cjs/tests/integration/xpath-for-location-deep.spec.d.ts +0 -1
- package/dist/cjs/tests/integration/xpath-for-location-deep.spec.js +0 -87
- package/dist/cjs/tests/integration/xpath-for-location-deep.spec.js.map +0 -1
- package/dist/cjs/tests/unit/agent-captcha-hooks.test.d.ts +0 -1
- package/dist/cjs/tests/unit/agent-captcha-hooks.test.js +0 -341
- package/dist/cjs/tests/unit/agent-captcha-hooks.test.js.map +0 -1
- package/dist/cjs/tests/unit/agent-execution-model.test.d.ts +0 -1
- package/dist/cjs/tests/unit/agent-execution-model.test.js +0 -150
- package/dist/cjs/tests/unit/agent-execution-model.test.js.map +0 -1
- package/dist/cjs/tests/unit/agent-metrics.test.d.ts +0 -1
- package/dist/cjs/tests/unit/agent-metrics.test.js +0 -112
- package/dist/cjs/tests/unit/agent-metrics.test.js.map +0 -1
- package/dist/cjs/tests/unit/agent-mode-routing.test.d.ts +0 -1
- package/dist/cjs/tests/unit/agent-mode-routing.test.js +0 -88
- package/dist/cjs/tests/unit/agent-mode-routing.test.js.map +0 -1
- package/dist/cjs/tests/unit/agent-system-prompt-variables.test.d.ts +0 -1
- package/dist/cjs/tests/unit/agent-system-prompt-variables.test.js +0 -23
- package/dist/cjs/tests/unit/agent-system-prompt-variables.test.js.map +0 -1
- package/dist/cjs/tests/unit/agent-temperature.test.d.ts +0 -1
- package/dist/cjs/tests/unit/agent-temperature.test.js +0 -191
- package/dist/cjs/tests/unit/agent-temperature.test.js.map +0 -1
- package/dist/cjs/tests/unit/agent-variables-validation.test.d.ts +0 -1
- package/dist/cjs/tests/unit/agent-variables-validation.test.js +0 -43
- package/dist/cjs/tests/unit/agent-variables-validation.test.js.map +0 -1
- package/dist/cjs/tests/unit/aisdk-clients.test.d.ts +0 -1
- package/dist/cjs/tests/unit/aisdk-clients.test.js +0 -86
- package/dist/cjs/tests/unit/aisdk-clients.test.js.map +0 -1
- package/dist/cjs/tests/unit/anthropic-cua-adaptive-thinking.test.d.ts +0 -1
- package/dist/cjs/tests/unit/anthropic-cua-adaptive-thinking.test.js +0 -250
- package/dist/cjs/tests/unit/anthropic-cua-adaptive-thinking.test.js.map +0 -1
- package/dist/cjs/tests/unit/api-client-observe-variables.test.d.ts +0 -1
- package/dist/cjs/tests/unit/api-client-observe-variables.test.js +0 -135
- package/dist/cjs/tests/unit/api-client-observe-variables.test.js.map +0 -1
- package/dist/cjs/tests/unit/api-multiregion.test.d.ts +0 -1
- package/dist/cjs/tests/unit/api-multiregion.test.js +0 -58
- package/dist/cjs/tests/unit/api-multiregion.test.js.map +0 -1
- package/dist/cjs/tests/unit/api-optional-model-api-key.test.d.ts +0 -1
- package/dist/cjs/tests/unit/api-optional-model-api-key.test.js +0 -155
- package/dist/cjs/tests/unit/api-optional-model-api-key.test.js.map +0 -1
- package/dist/cjs/tests/unit/api-variables-schema.test.d.ts +0 -1
- package/dist/cjs/tests/unit/api-variables-schema.test.js +0 -69
- package/dist/cjs/tests/unit/api-variables-schema.test.js.map +0 -1
- package/dist/cjs/tests/unit/browserbase-session-accessors.test.d.ts +0 -1
- package/dist/cjs/tests/unit/browserbase-session-accessors.test.js +0 -142
- package/dist/cjs/tests/unit/browserbase-session-accessors.test.js.map +0 -1
- package/dist/cjs/tests/unit/cache-llm-resolution.test.d.ts +0 -1
- package/dist/cjs/tests/unit/cache-llm-resolution.test.js +0 -186
- package/dist/cjs/tests/unit/cache-llm-resolution.test.js.map +0 -1
- package/dist/cjs/tests/unit/captcha-solver.test.d.ts +0 -1
- package/dist/cjs/tests/unit/captcha-solver.test.js +0 -154
- package/dist/cjs/tests/unit/captcha-solver.test.js.map +0 -1
- package/dist/cjs/tests/unit/cdp-connection-close.test.d.ts +0 -1
- package/dist/cjs/tests/unit/cdp-connection-close.test.js +0 -74
- package/dist/cjs/tests/unit/cdp-connection-close.test.js.map +0 -1
- package/dist/cjs/tests/unit/context-extra-http-headers.test.d.ts +0 -1
- package/dist/cjs/tests/unit/context-extra-http-headers.test.js +0 -58
- package/dist/cjs/tests/unit/context-extra-http-headers.test.js.map +0 -1
- package/dist/cjs/tests/unit/cookies.test.d.ts +0 -1
- package/dist/cjs/tests/unit/cookies.test.js +0 -944
- package/dist/cjs/tests/unit/cookies.test.js.map +0 -1
- package/dist/cjs/tests/unit/flowlogger-capturing-cdp.test.d.ts +0 -1
- package/dist/cjs/tests/unit/flowlogger-capturing-cdp.test.js +0 -95
- package/dist/cjs/tests/unit/flowlogger-capturing-cdp.test.js.map +0 -1
- package/dist/cjs/tests/unit/flowlogger-capturing-llm.test.d.ts +0 -1
- package/dist/cjs/tests/unit/flowlogger-capturing-llm.test.js +0 -43
- package/dist/cjs/tests/unit/flowlogger-capturing-llm.test.js.map +0 -1
- package/dist/cjs/tests/unit/flowlogger-eventstore.test.d.ts +0 -1
- package/dist/cjs/tests/unit/flowlogger-eventstore.test.js +0 -250
- package/dist/cjs/tests/unit/flowlogger-eventstore.test.js.map +0 -1
- package/dist/cjs/tests/unit/frame-registry-oopif-adoption.test.d.ts +0 -1
- package/dist/cjs/tests/unit/frame-registry-oopif-adoption.test.js +0 -60
- package/dist/cjs/tests/unit/frame-registry-oopif-adoption.test.js.map +0 -1
- package/dist/cjs/tests/unit/helpers/mockCDPSession.d.ts +0 -19
- package/dist/cjs/tests/unit/helpers/mockCDPSession.js +0 -29
- package/dist/cjs/tests/unit/helpers/mockCDPSession.js.map +0 -1
- package/dist/cjs/tests/unit/inference-temperature.test.d.ts +0 -1
- package/dist/cjs/tests/unit/inference-temperature.test.js +0 -65
- package/dist/cjs/tests/unit/inference-temperature.test.js.map +0 -1
- package/dist/cjs/tests/unit/llm-middleware.test.d.ts +0 -1
- package/dist/cjs/tests/unit/llm-middleware.test.js +0 -495
- package/dist/cjs/tests/unit/llm-middleware.test.js.map +0 -1
- package/dist/cjs/tests/unit/llm-provider.test.d.ts +0 -1
- package/dist/cjs/tests/unit/llm-provider.test.js +0 -64
- package/dist/cjs/tests/unit/llm-provider.test.js.map +0 -1
- package/dist/cjs/tests/unit/microsoft-cua-client.test.d.ts +0 -1
- package/dist/cjs/tests/unit/microsoft-cua-client.test.js +0 -86
- package/dist/cjs/tests/unit/microsoft-cua-client.test.js.map +0 -1
- package/dist/cjs/tests/unit/model-deprecation.test.d.ts +0 -1
- package/dist/cjs/tests/unit/model-deprecation.test.js +0 -142
- package/dist/cjs/tests/unit/model-deprecation.test.js.map +0 -1
- package/dist/cjs/tests/unit/model-utils.test.d.ts +0 -1
- package/dist/cjs/tests/unit/model-utils.test.js +0 -42
- package/dist/cjs/tests/unit/model-utils.test.js.map +0 -1
- package/dist/cjs/tests/unit/openai-compatible-temperature.test.d.ts +0 -1
- package/dist/cjs/tests/unit/openai-compatible-temperature.test.js +0 -84
- package/dist/cjs/tests/unit/openai-compatible-temperature.test.js.map +0 -1
- package/dist/cjs/tests/unit/openai-cua-client.test.d.ts +0 -1
- package/dist/cjs/tests/unit/openai-cua-client.test.js +0 -71
- package/dist/cjs/tests/unit/openai-cua-client.test.js.map +0 -1
- package/dist/cjs/tests/unit/page-extra-http-headers.test.d.ts +0 -1
- package/dist/cjs/tests/unit/page-extra-http-headers.test.js +0 -92
- package/dist/cjs/tests/unit/page-extra-http-headers.test.js.map +0 -1
- package/dist/cjs/tests/unit/page-snapshot.test.d.ts +0 -1
- package/dist/cjs/tests/unit/page-snapshot.test.js +0 -75
- package/dist/cjs/tests/unit/page-snapshot.test.js.map +0 -1
- package/dist/cjs/tests/unit/prompt-observe-variables.test.d.ts +0 -1
- package/dist/cjs/tests/unit/prompt-observe-variables.test.js +0 -25
- package/dist/cjs/tests/unit/prompt-observe-variables.test.js.map +0 -1
- package/dist/cjs/tests/unit/public-api/export-surface.test.d.ts +0 -1
- package/dist/cjs/tests/unit/public-api/export-surface.test.js +0 -107
- package/dist/cjs/tests/unit/public-api/export-surface.test.js.map +0 -1
- package/dist/cjs/tests/unit/public-api/llm-and-agents.test.d.ts +0 -1
- package/dist/cjs/tests/unit/public-api/llm-and-agents.test.js +0 -179
- package/dist/cjs/tests/unit/public-api/llm-and-agents.test.js.map +0 -1
- package/dist/cjs/tests/unit/public-api/public-error-types.test.d.ts +0 -62
- package/dist/cjs/tests/unit/public-api/public-error-types.test.js +0 -110
- package/dist/cjs/tests/unit/public-api/public-error-types.test.js.map +0 -1
- package/dist/cjs/tests/unit/public-api/public-types.test.d.ts +0 -1
- package/dist/cjs/tests/unit/public-api/public-types.test.js +0 -99
- package/dist/cjs/tests/unit/public-api/public-types.test.js.map +0 -1
- package/dist/cjs/tests/unit/public-api/runtime-utils.test.d.ts +0 -1
- package/dist/cjs/tests/unit/public-api/runtime-utils.test.js +0 -60
- package/dist/cjs/tests/unit/public-api/runtime-utils.test.js.map +0 -1
- package/dist/cjs/tests/unit/public-api/schema-utils.test.d.ts +0 -1
- package/dist/cjs/tests/unit/public-api/schema-utils.test.js +0 -95
- package/dist/cjs/tests/unit/public-api/schema-utils.test.js.map +0 -1
- package/dist/cjs/tests/unit/public-api/timeout-error-types.test.d.ts +0 -1
- package/dist/cjs/tests/unit/public-api/timeout-error-types.test.js +0 -121
- package/dist/cjs/tests/unit/public-api/timeout-error-types.test.js.map +0 -1
- package/dist/cjs/tests/unit/public-api/tool-type-export.test.d.ts +0 -1
- package/dist/cjs/tests/unit/public-api/tool-type-export.test.js +0 -65
- package/dist/cjs/tests/unit/public-api/tool-type-export.test.js.map +0 -1
- package/dist/cjs/tests/unit/public-api/v3-core.test.d.ts +0 -1
- package/dist/cjs/tests/unit/public-api/v3-core.test.js +0 -108
- package/dist/cjs/tests/unit/public-api/v3-core.test.js.map +0 -1
- package/dist/cjs/tests/unit/safety-confirmation.test.d.ts +0 -1
- package/dist/cjs/tests/unit/safety-confirmation.test.js +0 -110
- package/dist/cjs/tests/unit/safety-confirmation.test.js.map +0 -1
- package/dist/cjs/tests/unit/snapshot-a11y-resolvers.test.d.ts +0 -1
- package/dist/cjs/tests/unit/snapshot-a11y-resolvers.test.js +0 -431
- package/dist/cjs/tests/unit/snapshot-a11y-resolvers.test.js.map +0 -1
- package/dist/cjs/tests/unit/snapshot-a11y-tree-utils.test.d.ts +0 -1
- package/dist/cjs/tests/unit/snapshot-a11y-tree-utils.test.js +0 -306
- package/dist/cjs/tests/unit/snapshot-a11y-tree-utils.test.js.map +0 -1
- package/dist/cjs/tests/unit/snapshot-capture-orchestration.test.d.ts +0 -1
- package/dist/cjs/tests/unit/snapshot-capture-orchestration.test.js +0 -504
- package/dist/cjs/tests/unit/snapshot-capture-orchestration.test.js.map +0 -1
- package/dist/cjs/tests/unit/snapshot-cbor.test.d.ts +0 -1
- package/dist/cjs/tests/unit/snapshot-cbor.test.js +0 -204
- package/dist/cjs/tests/unit/snapshot-cbor.test.js.map +0 -1
- package/dist/cjs/tests/unit/snapshot-dom-session-builders.test.d.ts +0 -1
- package/dist/cjs/tests/unit/snapshot-dom-session-builders.test.js +0 -220
- package/dist/cjs/tests/unit/snapshot-dom-session-builders.test.js.map +0 -1
- package/dist/cjs/tests/unit/snapshot-dom-tree-utils.test.d.ts +0 -1
- package/dist/cjs/tests/unit/snapshot-dom-tree-utils.test.js +0 -107
- package/dist/cjs/tests/unit/snapshot-dom-tree-utils.test.js.map +0 -1
- package/dist/cjs/tests/unit/snapshot-focus-selectors-utils.test.d.ts +0 -1
- package/dist/cjs/tests/unit/snapshot-focus-selectors-utils.test.js +0 -89
- package/dist/cjs/tests/unit/snapshot-focus-selectors-utils.test.js.map +0 -1
- package/dist/cjs/tests/unit/snapshot-frame-merge.test.d.ts +0 -1
- package/dist/cjs/tests/unit/snapshot-frame-merge.test.js +0 -335
- package/dist/cjs/tests/unit/snapshot-frame-merge.test.js.map +0 -1
- package/dist/cjs/tests/unit/snapshot-tree-format-utils.test.d.ts +0 -1
- package/dist/cjs/tests/unit/snapshot-tree-format-utils.test.js +0 -84
- package/dist/cjs/tests/unit/snapshot-tree-format-utils.test.js.map +0 -1
- package/dist/cjs/tests/unit/snapshot-xpath-utils.test.d.ts +0 -1
- package/dist/cjs/tests/unit/snapshot-xpath-utils.test.js +0 -74
- package/dist/cjs/tests/unit/snapshot-xpath-utils.test.js.map +0 -1
- package/dist/cjs/tests/unit/timeout-handlers.test.d.ts +0 -1
- package/dist/cjs/tests/unit/timeout-handlers.test.js +0 -933
- package/dist/cjs/tests/unit/timeout-handlers.test.js.map +0 -1
- package/dist/cjs/tests/unit/understudy-command-exception.test.d.ts +0 -1
- package/dist/cjs/tests/unit/understudy-command-exception.test.js +0 -57
- package/dist/cjs/tests/unit/understudy-command-exception.test.js.map +0 -1
- package/dist/cjs/tests/unit/xpath-parser.test.d.ts +0 -1
- package/dist/cjs/tests/unit/xpath-parser.test.js +0 -311
- package/dist/cjs/tests/unit/xpath-parser.test.js.map +0 -1
- package/dist/cjs/tests/unit/xpath-resolver.test.d.ts +0 -1
- package/dist/cjs/tests/unit/xpath-resolver.test.js +0 -80
- package/dist/cjs/tests/unit/xpath-resolver.test.js.map +0 -1
- package/dist/cjs/tests/unit/zod-enum-compatibility.test.d.ts +0 -1
- package/dist/cjs/tests/unit/zod-enum-compatibility.test.js +0 -149
- package/dist/cjs/tests/unit/zod-enum-compatibility.test.js.map +0 -1
- package/dist/esm/tests/cache-variables.test.d.ts +0 -1
- package/dist/esm/tests/cache-variables.test.js +0 -219
- package/dist/esm/tests/cache-variables.test.js.map +0 -1
- package/dist/esm/tests/integration/agent-abort-signal.spec.d.ts +0 -1
- package/dist/esm/tests/integration/agent-abort-signal.spec.js +0 -121
- package/dist/esm/tests/integration/agent-abort-signal.spec.js.map +0 -1
- package/dist/esm/tests/integration/agent-cache-self-heal.spec.d.ts +0 -1
- package/dist/esm/tests/integration/agent-cache-self-heal.spec.js +0 -78
- package/dist/esm/tests/integration/agent-cache-self-heal.spec.js.map +0 -1
- package/dist/esm/tests/integration/agent-callbacks.spec.d.ts +0 -1
- package/dist/esm/tests/integration/agent-callbacks.spec.js +0 -383
- package/dist/esm/tests/integration/agent-callbacks.spec.js.map +0 -1
- package/dist/esm/tests/integration/agent-experimental-validation.spec.d.ts +0 -1
- package/dist/esm/tests/integration/agent-experimental-validation.spec.js +0 -360
- package/dist/esm/tests/integration/agent-experimental-validation.spec.js.map +0 -1
- package/dist/esm/tests/integration/agent-hybrid-mode.spec.d.ts +0 -1
- package/dist/esm/tests/integration/agent-hybrid-mode.spec.js +0 -260
- package/dist/esm/tests/integration/agent-hybrid-mode.spec.js.map +0 -1
- package/dist/esm/tests/integration/agent-message-continuation.spec.d.ts +0 -1
- package/dist/esm/tests/integration/agent-message-continuation.spec.js +0 -110
- package/dist/esm/tests/integration/agent-message-continuation.spec.js.map +0 -1
- package/dist/esm/tests/integration/agent-streaming.spec.d.ts +0 -1
- package/dist/esm/tests/integration/agent-streaming.spec.js +0 -138
- package/dist/esm/tests/integration/agent-streaming.spec.js.map +0 -1
- package/dist/esm/tests/integration/cdp-close-api-region.spec.d.ts +0 -1
- package/dist/esm/tests/integration/cdp-close-api-region.spec.js +0 -39
- package/dist/esm/tests/integration/cdp-close-api-region.spec.js.map +0 -1
- package/dist/esm/tests/integration/cdp-connection-close.spec.d.ts +0 -1
- package/dist/esm/tests/integration/cdp-connection-close.spec.js +0 -74
- package/dist/esm/tests/integration/cdp-connection-close.spec.js.map +0 -1
- package/dist/esm/tests/integration/cdp-session-detached.spec.d.ts +0 -1
- package/dist/esm/tests/integration/cdp-session-detached.spec.js +0 -43
- package/dist/esm/tests/integration/cdp-session-detached.spec.js.map +0 -1
- package/dist/esm/tests/integration/chrome-newtab-page-tracking.spec.d.ts +0 -1
- package/dist/esm/tests/integration/chrome-newtab-page-tracking.spec.js +0 -54
- package/dist/esm/tests/integration/chrome-newtab-page-tracking.spec.js.map +0 -1
- package/dist/esm/tests/integration/click-count.spec.d.ts +0 -1
- package/dist/esm/tests/integration/click-count.spec.js +0 -161
- package/dist/esm/tests/integration/click-count.spec.js.map +0 -1
- package/dist/esm/tests/integration/connect-to-existing-browser.spec.d.ts +0 -1
- package/dist/esm/tests/integration/connect-to-existing-browser.spec.js +0 -97
- package/dist/esm/tests/integration/connect-to-existing-browser.spec.js.map +0 -1
- package/dist/esm/tests/integration/context-addInitScript.spec.d.ts +0 -1
- package/dist/esm/tests/integration/context-addInitScript.spec.js +0 -283
- package/dist/esm/tests/integration/context-addInitScript.spec.js.map +0 -1
- package/dist/esm/tests/integration/context-extra-http-headers.spec.d.ts +0 -1
- package/dist/esm/tests/integration/context-extra-http-headers.spec.js +0 -47
- package/dist/esm/tests/integration/context-extra-http-headers.spec.js.map +0 -1
- package/dist/esm/tests/integration/cookies.spec.d.ts +0 -1
- package/dist/esm/tests/integration/cookies.spec.js +0 -185
- package/dist/esm/tests/integration/cookies.spec.js.map +0 -1
- package/dist/esm/tests/integration/default-page-tracking.spec.d.ts +0 -1
- package/dist/esm/tests/integration/default-page-tracking.spec.js +0 -50
- package/dist/esm/tests/integration/default-page-tracking.spec.js.map +0 -1
- package/dist/esm/tests/integration/downloads.spec.d.ts +0 -1
- package/dist/esm/tests/integration/downloads.spec.js +0 -47
- package/dist/esm/tests/integration/downloads.spec.js.map +0 -1
- package/dist/esm/tests/integration/flowLogger.spec.d.ts +0 -1
- package/dist/esm/tests/integration/flowLogger.spec.js +0 -716
- package/dist/esm/tests/integration/flowLogger.spec.js.map +0 -1
- package/dist/esm/tests/integration/frame-get-location-and-click.spec.d.ts +0 -1
- package/dist/esm/tests/integration/frame-get-location-and-click.spec.js +0 -55
- package/dist/esm/tests/integration/frame-get-location-and-click.spec.js.map +0 -1
- package/dist/esm/tests/integration/iframe-ctx-addInitScript-race.spec.d.ts +0 -1
- package/dist/esm/tests/integration/iframe-ctx-addInitScript-race.spec.js +0 -217
- package/dist/esm/tests/integration/iframe-ctx-addInitScript-race.spec.js.map +0 -1
- package/dist/esm/tests/integration/iframe-ctx-addInitScript.spec.d.ts +0 -1
- package/dist/esm/tests/integration/iframe-ctx-addInitScript.spec.js +0 -472
- package/dist/esm/tests/integration/iframe-ctx-addInitScript.spec.js.map +0 -1
- package/dist/esm/tests/integration/keep-alive.child.d.ts +0 -1
- package/dist/esm/tests/integration/keep-alive.child.js +0 -83
- package/dist/esm/tests/integration/keep-alive.child.js.map +0 -1
- package/dist/esm/tests/integration/keep-alive.spec.d.ts +0 -22
- package/dist/esm/tests/integration/keep-alive.spec.js +0 -482
- package/dist/esm/tests/integration/keep-alive.spec.js.map +0 -1
- package/dist/esm/tests/integration/keyboard.spec.d.ts +0 -1
- package/dist/esm/tests/integration/keyboard.spec.js +0 -257
- package/dist/esm/tests/integration/keyboard.spec.js.map +0 -1
- package/dist/esm/tests/integration/locator-backend-node-id.spec.d.ts +0 -1
- package/dist/esm/tests/integration/locator-backend-node-id.spec.js +0 -148
- package/dist/esm/tests/integration/locator-backend-node-id.spec.js.map +0 -1
- package/dist/esm/tests/integration/locator-content-methods.spec.d.ts +0 -1
- package/dist/esm/tests/integration/locator-content-methods.spec.js +0 -178
- package/dist/esm/tests/integration/locator-content-methods.spec.js.map +0 -1
- package/dist/esm/tests/integration/locator-count-iframe.spec.d.ts +0 -1
- package/dist/esm/tests/integration/locator-count-iframe.spec.js +0 -127
- package/dist/esm/tests/integration/locator-count-iframe.spec.js.map +0 -1
- package/dist/esm/tests/integration/locator-count.spec.d.ts +0 -1
- package/dist/esm/tests/integration/locator-count.spec.js +0 -66
- package/dist/esm/tests/integration/locator-count.spec.js.map +0 -1
- package/dist/esm/tests/integration/locator-fill.spec.d.ts +0 -1
- package/dist/esm/tests/integration/locator-fill.spec.js +0 -115
- package/dist/esm/tests/integration/locator-fill.spec.js.map +0 -1
- package/dist/esm/tests/integration/locator-input-methods.spec.d.ts +0 -1
- package/dist/esm/tests/integration/locator-input-methods.spec.js +0 -125
- package/dist/esm/tests/integration/locator-input-methods.spec.js.map +0 -1
- package/dist/esm/tests/integration/locator-nth.spec.d.ts +0 -1
- package/dist/esm/tests/integration/locator-nth.spec.js +0 -173
- package/dist/esm/tests/integration/locator-nth.spec.js.map +0 -1
- package/dist/esm/tests/integration/locator-select-option.spec.d.ts +0 -1
- package/dist/esm/tests/integration/locator-select-option.spec.js +0 -214
- package/dist/esm/tests/integration/locator-select-option.spec.js.map +0 -1
- package/dist/esm/tests/integration/logger-initialization.spec.d.ts +0 -1
- package/dist/esm/tests/integration/logger-initialization.spec.js +0 -595
- package/dist/esm/tests/integration/logger-initialization.spec.js.map +0 -1
- package/dist/esm/tests/integration/multi-instance-logger.spec.d.ts +0 -1
- package/dist/esm/tests/integration/multi-instance-logger.spec.js +0 -291
- package/dist/esm/tests/integration/multi-instance-logger.spec.js.map +0 -1
- package/dist/esm/tests/integration/nested-div.spec.d.ts +0 -1
- package/dist/esm/tests/integration/nested-div.spec.js +0 -20
- package/dist/esm/tests/integration/nested-div.spec.js.map +0 -1
- package/dist/esm/tests/integration/observe-element-id-format.spec.d.ts +0 -1
- package/dist/esm/tests/integration/observe-element-id-format.spec.js +0 -128
- package/dist/esm/tests/integration/observe-element-id-format.spec.js.map +0 -1
- package/dist/esm/tests/integration/page-addInitScript.spec.d.ts +0 -1
- package/dist/esm/tests/integration/page-addInitScript.spec.js +0 -92
- package/dist/esm/tests/integration/page-addInitScript.spec.js.map +0 -1
- package/dist/esm/tests/integration/page-console.spec.d.ts +0 -1
- package/dist/esm/tests/integration/page-console.spec.js +0 -45
- package/dist/esm/tests/integration/page-console.spec.js.map +0 -1
- package/dist/esm/tests/integration/page-drag-and-drop.spec.d.ts +0 -1
- package/dist/esm/tests/integration/page-drag-and-drop.spec.js +0 -435
- package/dist/esm/tests/integration/page-drag-and-drop.spec.js.map +0 -1
- package/dist/esm/tests/integration/page-extra-http-headers.spec.d.ts +0 -1
- package/dist/esm/tests/integration/page-extra-http-headers.spec.js +0 -83
- package/dist/esm/tests/integration/page-extra-http-headers.spec.js.map +0 -1
- package/dist/esm/tests/integration/page-goto-response.spec.d.ts +0 -1
- package/dist/esm/tests/integration/page-goto-response.spec.js +0 -32
- package/dist/esm/tests/integration/page-goto-response.spec.js.map +0 -1
- package/dist/esm/tests/integration/page-hover.spec.d.ts +0 -1
- package/dist/esm/tests/integration/page-hover.spec.js +0 -163
- package/dist/esm/tests/integration/page-hover.spec.js.map +0 -1
- package/dist/esm/tests/integration/page-screenshot.spec.d.ts +0 -1
- package/dist/esm/tests/integration/page-screenshot.spec.js +0 -257
- package/dist/esm/tests/integration/page-screenshot.spec.js.map +0 -1
- package/dist/esm/tests/integration/page-scroll.spec.d.ts +0 -1
- package/dist/esm/tests/integration/page-scroll.spec.js +0 -181
- package/dist/esm/tests/integration/page-scroll.spec.js.map +0 -1
- package/dist/esm/tests/integration/page-send-cdp.spec.d.ts +0 -1
- package/dist/esm/tests/integration/page-send-cdp.spec.js +0 -45
- package/dist/esm/tests/integration/page-send-cdp.spec.js.map +0 -1
- package/dist/esm/tests/integration/perform-understudy-method.spec.d.ts +0 -1
- package/dist/esm/tests/integration/perform-understudy-method.spec.js +0 -61
- package/dist/esm/tests/integration/perform-understudy-method.spec.js.map +0 -1
- package/dist/esm/tests/integration/setinputfiles.spec.d.ts +0 -1
- package/dist/esm/tests/integration/setinputfiles.spec.js +0 -128
- package/dist/esm/tests/integration/setinputfiles.spec.js.map +0 -1
- package/dist/esm/tests/integration/shadow-iframe-oopif.spec.d.ts +0 -1
- package/dist/esm/tests/integration/shadow-iframe-oopif.spec.js +0 -156
- package/dist/esm/tests/integration/shadow-iframe-oopif.spec.js.map +0 -1
- package/dist/esm/tests/integration/shadow-iframe-spif.spec.d.ts +0 -1
- package/dist/esm/tests/integration/shadow-iframe-spif.spec.js +0 -155
- package/dist/esm/tests/integration/shadow-iframe-spif.spec.js.map +0 -1
- package/dist/esm/tests/integration/testUtils.d.ts +0 -40
- package/dist/esm/tests/integration/testUtils.js +0 -178
- package/dist/esm/tests/integration/testUtils.js.map +0 -1
- package/dist/esm/tests/integration/text-selector-innermost.spec.d.ts +0 -1
- package/dist/esm/tests/integration/text-selector-innermost.spec.js +0 -103
- package/dist/esm/tests/integration/text-selector-innermost.spec.js.map +0 -1
- package/dist/esm/tests/integration/timeouts.spec.d.ts +0 -1
- package/dist/esm/tests/integration/timeouts.spec.js +0 -307
- package/dist/esm/tests/integration/timeouts.spec.js.map +0 -1
- package/dist/esm/tests/integration/user-data-dir.spec.d.ts +0 -1
- package/dist/esm/tests/integration/user-data-dir.spec.js +0 -42
- package/dist/esm/tests/integration/user-data-dir.spec.js.map +0 -1
- package/dist/esm/tests/integration/v3.config.d.ts +0 -4
- package/dist/esm/tests/integration/v3.config.js +0 -7
- package/dist/esm/tests/integration/v3.config.js.map +0 -1
- package/dist/esm/tests/integration/v3.dynamic.config.d.ts +0 -4
- package/dist/esm/tests/integration/v3.dynamic.config.js +0 -44
- package/dist/esm/tests/integration/v3.dynamic.config.js.map +0 -1
- package/dist/esm/tests/integration/v3.playwright.config.d.ts +0 -2
- package/dist/esm/tests/integration/v3.playwright.config.js +0 -46
- package/dist/esm/tests/integration/v3.playwright.config.js.map +0 -1
- package/dist/esm/tests/integration/wait-for-selector.spec.d.ts +0 -1
- package/dist/esm/tests/integration/wait-for-selector.spec.js +0 -681
- package/dist/esm/tests/integration/wait-for-selector.spec.js.map +0 -1
- package/dist/esm/tests/integration/wait-for-timeout.spec.d.ts +0 -1
- package/dist/esm/tests/integration/wait-for-timeout.spec.js +0 -116
- package/dist/esm/tests/integration/wait-for-timeout.spec.js.map +0 -1
- package/dist/esm/tests/integration/xpath-for-location-deep.spec.d.ts +0 -1
- package/dist/esm/tests/integration/xpath-for-location-deep.spec.js +0 -85
- package/dist/esm/tests/integration/xpath-for-location-deep.spec.js.map +0 -1
- package/dist/esm/tests/unit/agent-captcha-hooks.test.d.ts +0 -1
- package/dist/esm/tests/unit/agent-captcha-hooks.test.js +0 -339
- package/dist/esm/tests/unit/agent-captcha-hooks.test.js.map +0 -1
- package/dist/esm/tests/unit/agent-execution-model.test.d.ts +0 -1
- package/dist/esm/tests/unit/agent-execution-model.test.js +0 -148
- package/dist/esm/tests/unit/agent-execution-model.test.js.map +0 -1
- package/dist/esm/tests/unit/agent-metrics.test.d.ts +0 -1
- package/dist/esm/tests/unit/agent-metrics.test.js +0 -110
- package/dist/esm/tests/unit/agent-metrics.test.js.map +0 -1
- package/dist/esm/tests/unit/agent-mode-routing.test.d.ts +0 -1
- package/dist/esm/tests/unit/agent-mode-routing.test.js +0 -86
- package/dist/esm/tests/unit/agent-mode-routing.test.js.map +0 -1
- package/dist/esm/tests/unit/agent-system-prompt-variables.test.d.ts +0 -1
- package/dist/esm/tests/unit/agent-system-prompt-variables.test.js +0 -21
- package/dist/esm/tests/unit/agent-system-prompt-variables.test.js.map +0 -1
- package/dist/esm/tests/unit/agent-temperature.test.d.ts +0 -1
- package/dist/esm/tests/unit/agent-temperature.test.js +0 -189
- package/dist/esm/tests/unit/agent-temperature.test.js.map +0 -1
- package/dist/esm/tests/unit/agent-variables-validation.test.d.ts +0 -1
- package/dist/esm/tests/unit/agent-variables-validation.test.js +0 -41
- package/dist/esm/tests/unit/agent-variables-validation.test.js.map +0 -1
- package/dist/esm/tests/unit/aisdk-clients.test.d.ts +0 -1
- package/dist/esm/tests/unit/aisdk-clients.test.js +0 -84
- package/dist/esm/tests/unit/aisdk-clients.test.js.map +0 -1
- package/dist/esm/tests/unit/anthropic-cua-adaptive-thinking.test.d.ts +0 -1
- package/dist/esm/tests/unit/anthropic-cua-adaptive-thinking.test.js +0 -245
- package/dist/esm/tests/unit/anthropic-cua-adaptive-thinking.test.js.map +0 -1
- package/dist/esm/tests/unit/api-client-observe-variables.test.d.ts +0 -1
- package/dist/esm/tests/unit/api-client-observe-variables.test.js +0 -133
- package/dist/esm/tests/unit/api-client-observe-variables.test.js.map +0 -1
- package/dist/esm/tests/unit/api-multiregion.test.d.ts +0 -1
- package/dist/esm/tests/unit/api-multiregion.test.js +0 -56
- package/dist/esm/tests/unit/api-multiregion.test.js.map +0 -1
- package/dist/esm/tests/unit/api-optional-model-api-key.test.d.ts +0 -1
- package/dist/esm/tests/unit/api-optional-model-api-key.test.js +0 -153
- package/dist/esm/tests/unit/api-optional-model-api-key.test.js.map +0 -1
- package/dist/esm/tests/unit/api-variables-schema.test.d.ts +0 -1
- package/dist/esm/tests/unit/api-variables-schema.test.js +0 -67
- package/dist/esm/tests/unit/api-variables-schema.test.js.map +0 -1
- package/dist/esm/tests/unit/browserbase-session-accessors.test.d.ts +0 -1
- package/dist/esm/tests/unit/browserbase-session-accessors.test.js +0 -140
- package/dist/esm/tests/unit/browserbase-session-accessors.test.js.map +0 -1
- package/dist/esm/tests/unit/cache-llm-resolution.test.d.ts +0 -1
- package/dist/esm/tests/unit/cache-llm-resolution.test.js +0 -184
- package/dist/esm/tests/unit/cache-llm-resolution.test.js.map +0 -1
- package/dist/esm/tests/unit/captcha-solver.test.d.ts +0 -1
- package/dist/esm/tests/unit/captcha-solver.test.js +0 -152
- package/dist/esm/tests/unit/captcha-solver.test.js.map +0 -1
- package/dist/esm/tests/unit/cdp-connection-close.test.d.ts +0 -1
- package/dist/esm/tests/unit/cdp-connection-close.test.js +0 -72
- package/dist/esm/tests/unit/cdp-connection-close.test.js.map +0 -1
- package/dist/esm/tests/unit/context-extra-http-headers.test.d.ts +0 -1
- package/dist/esm/tests/unit/context-extra-http-headers.test.js +0 -56
- package/dist/esm/tests/unit/context-extra-http-headers.test.js.map +0 -1
- package/dist/esm/tests/unit/cookies.test.d.ts +0 -1
- package/dist/esm/tests/unit/cookies.test.js +0 -909
- package/dist/esm/tests/unit/cookies.test.js.map +0 -1
- package/dist/esm/tests/unit/flowlogger-capturing-cdp.test.d.ts +0 -1
- package/dist/esm/tests/unit/flowlogger-capturing-cdp.test.js +0 -93
- package/dist/esm/tests/unit/flowlogger-capturing-cdp.test.js.map +0 -1
- package/dist/esm/tests/unit/flowlogger-capturing-llm.test.d.ts +0 -1
- package/dist/esm/tests/unit/flowlogger-capturing-llm.test.js +0 -41
- package/dist/esm/tests/unit/flowlogger-capturing-llm.test.js.map +0 -1
- package/dist/esm/tests/unit/flowlogger-eventstore.test.d.ts +0 -1
- package/dist/esm/tests/unit/flowlogger-eventstore.test.js +0 -248
- package/dist/esm/tests/unit/flowlogger-eventstore.test.js.map +0 -1
- package/dist/esm/tests/unit/frame-registry-oopif-adoption.test.d.ts +0 -1
- package/dist/esm/tests/unit/frame-registry-oopif-adoption.test.js +0 -58
- package/dist/esm/tests/unit/frame-registry-oopif-adoption.test.js.map +0 -1
- package/dist/esm/tests/unit/helpers/mockCDPSession.d.ts +0 -19
- package/dist/esm/tests/unit/helpers/mockCDPSession.js +0 -25
- package/dist/esm/tests/unit/helpers/mockCDPSession.js.map +0 -1
- package/dist/esm/tests/unit/inference-temperature.test.d.ts +0 -1
- package/dist/esm/tests/unit/inference-temperature.test.js +0 -63
- package/dist/esm/tests/unit/inference-temperature.test.js.map +0 -1
- package/dist/esm/tests/unit/llm-middleware.test.d.ts +0 -1
- package/dist/esm/tests/unit/llm-middleware.test.js +0 -460
- package/dist/esm/tests/unit/llm-middleware.test.js.map +0 -1
- package/dist/esm/tests/unit/llm-provider.test.d.ts +0 -1
- package/dist/esm/tests/unit/llm-provider.test.js +0 -62
- package/dist/esm/tests/unit/llm-provider.test.js.map +0 -1
- package/dist/esm/tests/unit/microsoft-cua-client.test.d.ts +0 -1
- package/dist/esm/tests/unit/microsoft-cua-client.test.js +0 -84
- package/dist/esm/tests/unit/microsoft-cua-client.test.js.map +0 -1
- package/dist/esm/tests/unit/model-deprecation.test.d.ts +0 -1
- package/dist/esm/tests/unit/model-deprecation.test.js +0 -140
- package/dist/esm/tests/unit/model-deprecation.test.js.map +0 -1
- package/dist/esm/tests/unit/model-utils.test.d.ts +0 -1
- package/dist/esm/tests/unit/model-utils.test.js +0 -40
- package/dist/esm/tests/unit/model-utils.test.js.map +0 -1
- package/dist/esm/tests/unit/openai-compatible-temperature.test.d.ts +0 -1
- package/dist/esm/tests/unit/openai-compatible-temperature.test.js +0 -82
- package/dist/esm/tests/unit/openai-compatible-temperature.test.js.map +0 -1
- package/dist/esm/tests/unit/openai-cua-client.test.d.ts +0 -1
- package/dist/esm/tests/unit/openai-cua-client.test.js +0 -69
- package/dist/esm/tests/unit/openai-cua-client.test.js.map +0 -1
- package/dist/esm/tests/unit/page-extra-http-headers.test.d.ts +0 -1
- package/dist/esm/tests/unit/page-extra-http-headers.test.js +0 -90
- package/dist/esm/tests/unit/page-extra-http-headers.test.js.map +0 -1
- package/dist/esm/tests/unit/page-snapshot.test.d.ts +0 -1
- package/dist/esm/tests/unit/page-snapshot.test.js +0 -40
- package/dist/esm/tests/unit/page-snapshot.test.js.map +0 -1
- package/dist/esm/tests/unit/prompt-observe-variables.test.d.ts +0 -1
- package/dist/esm/tests/unit/prompt-observe-variables.test.js +0 -23
- package/dist/esm/tests/unit/prompt-observe-variables.test.js.map +0 -1
- package/dist/esm/tests/unit/public-api/export-surface.test.d.ts +0 -1
- package/dist/esm/tests/unit/public-api/export-surface.test.js +0 -72
- package/dist/esm/tests/unit/public-api/export-surface.test.js.map +0 -1
- package/dist/esm/tests/unit/public-api/llm-and-agents.test.d.ts +0 -1
- package/dist/esm/tests/unit/public-api/llm-and-agents.test.js +0 -144
- package/dist/esm/tests/unit/public-api/llm-and-agents.test.js.map +0 -1
- package/dist/esm/tests/unit/public-api/public-error-types.test.d.ts +0 -62
- package/dist/esm/tests/unit/public-api/public-error-types.test.js +0 -74
- package/dist/esm/tests/unit/public-api/public-error-types.test.js.map +0 -1
- package/dist/esm/tests/unit/public-api/public-types.test.d.ts +0 -1
- package/dist/esm/tests/unit/public-api/public-types.test.js +0 -97
- package/dist/esm/tests/unit/public-api/public-types.test.js.map +0 -1
- package/dist/esm/tests/unit/public-api/runtime-utils.test.d.ts +0 -1
- package/dist/esm/tests/unit/public-api/runtime-utils.test.js +0 -25
- package/dist/esm/tests/unit/public-api/runtime-utils.test.js.map +0 -1
- package/dist/esm/tests/unit/public-api/schema-utils.test.d.ts +0 -1
- package/dist/esm/tests/unit/public-api/schema-utils.test.js +0 -60
- package/dist/esm/tests/unit/public-api/schema-utils.test.js.map +0 -1
- package/dist/esm/tests/unit/public-api/timeout-error-types.test.d.ts +0 -1
- package/dist/esm/tests/unit/public-api/timeout-error-types.test.js +0 -86
- package/dist/esm/tests/unit/public-api/timeout-error-types.test.js.map +0 -1
- package/dist/esm/tests/unit/public-api/tool-type-export.test.d.ts +0 -1
- package/dist/esm/tests/unit/public-api/tool-type-export.test.js +0 -30
- package/dist/esm/tests/unit/public-api/tool-type-export.test.js.map +0 -1
- package/dist/esm/tests/unit/public-api/v3-core.test.d.ts +0 -1
- package/dist/esm/tests/unit/public-api/v3-core.test.js +0 -73
- package/dist/esm/tests/unit/public-api/v3-core.test.js.map +0 -1
- package/dist/esm/tests/unit/safety-confirmation.test.d.ts +0 -1
- package/dist/esm/tests/unit/safety-confirmation.test.js +0 -108
- package/dist/esm/tests/unit/safety-confirmation.test.js.map +0 -1
- package/dist/esm/tests/unit/snapshot-a11y-resolvers.test.d.ts +0 -1
- package/dist/esm/tests/unit/snapshot-a11y-resolvers.test.js +0 -396
- package/dist/esm/tests/unit/snapshot-a11y-resolvers.test.js.map +0 -1
- package/dist/esm/tests/unit/snapshot-a11y-tree-utils.test.d.ts +0 -1
- package/dist/esm/tests/unit/snapshot-a11y-tree-utils.test.js +0 -304
- package/dist/esm/tests/unit/snapshot-a11y-tree-utils.test.js.map +0 -1
- package/dist/esm/tests/unit/snapshot-capture-orchestration.test.d.ts +0 -1
- package/dist/esm/tests/unit/snapshot-capture-orchestration.test.js +0 -469
- package/dist/esm/tests/unit/snapshot-capture-orchestration.test.js.map +0 -1
- package/dist/esm/tests/unit/snapshot-cbor.test.d.ts +0 -1
- package/dist/esm/tests/unit/snapshot-cbor.test.js +0 -202
- package/dist/esm/tests/unit/snapshot-cbor.test.js.map +0 -1
- package/dist/esm/tests/unit/snapshot-dom-session-builders.test.d.ts +0 -1
- package/dist/esm/tests/unit/snapshot-dom-session-builders.test.js +0 -218
- package/dist/esm/tests/unit/snapshot-dom-session-builders.test.js.map +0 -1
- package/dist/esm/tests/unit/snapshot-dom-tree-utils.test.d.ts +0 -1
- package/dist/esm/tests/unit/snapshot-dom-tree-utils.test.js +0 -105
- package/dist/esm/tests/unit/snapshot-dom-tree-utils.test.js.map +0 -1
- package/dist/esm/tests/unit/snapshot-focus-selectors-utils.test.d.ts +0 -1
- package/dist/esm/tests/unit/snapshot-focus-selectors-utils.test.js +0 -87
- package/dist/esm/tests/unit/snapshot-focus-selectors-utils.test.js.map +0 -1
- package/dist/esm/tests/unit/snapshot-frame-merge.test.d.ts +0 -1
- package/dist/esm/tests/unit/snapshot-frame-merge.test.js +0 -333
- package/dist/esm/tests/unit/snapshot-frame-merge.test.js.map +0 -1
- package/dist/esm/tests/unit/snapshot-tree-format-utils.test.d.ts +0 -1
- package/dist/esm/tests/unit/snapshot-tree-format-utils.test.js +0 -82
- package/dist/esm/tests/unit/snapshot-tree-format-utils.test.js.map +0 -1
- package/dist/esm/tests/unit/snapshot-xpath-utils.test.d.ts +0 -1
- package/dist/esm/tests/unit/snapshot-xpath-utils.test.js +0 -72
- package/dist/esm/tests/unit/snapshot-xpath-utils.test.js.map +0 -1
- package/dist/esm/tests/unit/timeout-handlers.test.d.ts +0 -1
- package/dist/esm/tests/unit/timeout-handlers.test.js +0 -898
- package/dist/esm/tests/unit/timeout-handlers.test.js.map +0 -1
- package/dist/esm/tests/unit/understudy-command-exception.test.d.ts +0 -1
- package/dist/esm/tests/unit/understudy-command-exception.test.js +0 -55
- package/dist/esm/tests/unit/understudy-command-exception.test.js.map +0 -1
- package/dist/esm/tests/unit/xpath-parser.test.d.ts +0 -1
- package/dist/esm/tests/unit/xpath-parser.test.js +0 -309
- package/dist/esm/tests/unit/xpath-parser.test.js.map +0 -1
- package/dist/esm/tests/unit/xpath-resolver.test.d.ts +0 -1
- package/dist/esm/tests/unit/xpath-resolver.test.js +0 -78
- package/dist/esm/tests/unit/xpath-resolver.test.js.map +0 -1
- package/dist/esm/tests/unit/zod-enum-compatibility.test.d.ts +0 -1
- package/dist/esm/tests/unit/zod-enum-compatibility.test.js +0 -114
- package/dist/esm/tests/unit/zod-enum-compatibility.test.js.map +0 -1
|
@@ -1,944 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
const vitest_1 = require("vitest");
|
|
37
|
-
const cookies_js_1 = require("../../lib/v3/understudy/cookies.js");
|
|
38
|
-
const mockCDPSession_js_1 = require("./helpers/mockCDPSession.js");
|
|
39
|
-
function makeCookie(overrides = {}) {
|
|
40
|
-
return {
|
|
41
|
-
name: "sid",
|
|
42
|
-
value: "abc123",
|
|
43
|
-
domain: "example.com",
|
|
44
|
-
path: "/",
|
|
45
|
-
expires: -1,
|
|
46
|
-
httpOnly: false,
|
|
47
|
-
secure: false,
|
|
48
|
-
sameSite: "Lax",
|
|
49
|
-
...overrides,
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
/** Convert our Cookie type into the shape CDP's Storage.getCookies returns. */
|
|
53
|
-
function toCdpCookie(c) {
|
|
54
|
-
return {
|
|
55
|
-
name: c.name,
|
|
56
|
-
value: c.value,
|
|
57
|
-
domain: c.domain,
|
|
58
|
-
path: c.path,
|
|
59
|
-
expires: c.expires,
|
|
60
|
-
httpOnly: c.httpOnly,
|
|
61
|
-
secure: c.secure,
|
|
62
|
-
sameSite: c.sameSite,
|
|
63
|
-
size: c.name.length + c.value.length,
|
|
64
|
-
session: c.expires === -1,
|
|
65
|
-
priority: "Medium",
|
|
66
|
-
sameParty: false,
|
|
67
|
-
sourceScheme: "Secure",
|
|
68
|
-
sourcePort: 443,
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
(0, vitest_1.describe)("filterCookies", () => {
|
|
72
|
-
const cookies = [
|
|
73
|
-
makeCookie({ name: "a", domain: "example.com", path: "/", secure: false }),
|
|
74
|
-
makeCookie({
|
|
75
|
-
name: "b",
|
|
76
|
-
domain: ".example.com",
|
|
77
|
-
path: "/app",
|
|
78
|
-
secure: true,
|
|
79
|
-
}),
|
|
80
|
-
makeCookie({ name: "c", domain: "other.com", path: "/", secure: false }),
|
|
81
|
-
makeCookie({
|
|
82
|
-
name: "d",
|
|
83
|
-
domain: "sub.example.com",
|
|
84
|
-
path: "/",
|
|
85
|
-
secure: false,
|
|
86
|
-
}),
|
|
87
|
-
];
|
|
88
|
-
(0, vitest_1.it)("returns all cookies when urls is empty", () => {
|
|
89
|
-
(0, vitest_1.expect)((0, cookies_js_1.filterCookies)(cookies, [])).toEqual(cookies);
|
|
90
|
-
});
|
|
91
|
-
(0, vitest_1.it)("filters by domain (exact host match)", () => {
|
|
92
|
-
const result = (0, cookies_js_1.filterCookies)(cookies, ["http://example.com/"]);
|
|
93
|
-
const names = result.map((c) => c.name);
|
|
94
|
-
(0, vitest_1.expect)(names).toContain("a");
|
|
95
|
-
// "b" (.example.com) domain-matches but is secure — excluded on http://
|
|
96
|
-
(0, vitest_1.expect)(names).not.toContain("b");
|
|
97
|
-
(0, vitest_1.expect)(names).not.toContain("c");
|
|
98
|
-
(0, vitest_1.expect)(names).not.toContain("d");
|
|
99
|
-
});
|
|
100
|
-
(0, vitest_1.it)("filters by domain (dot-prefixed domain matches on https)", () => {
|
|
101
|
-
const result = (0, cookies_js_1.filterCookies)(cookies, ["https://example.com/app/settings"]);
|
|
102
|
-
const names = result.map((c) => c.name);
|
|
103
|
-
(0, vitest_1.expect)(names).toContain("a"); // example.com domain match, path "/" prefix
|
|
104
|
-
(0, vitest_1.expect)(names).toContain("b"); // .example.com domain match + secure + https
|
|
105
|
-
});
|
|
106
|
-
(0, vitest_1.it)("filters by domain (subdomain matches dot-prefixed domain)", () => {
|
|
107
|
-
const result = (0, cookies_js_1.filterCookies)(cookies, ["http://sub.example.com/"]);
|
|
108
|
-
const names = result.map((c) => c.name);
|
|
109
|
-
// "a" (example.com) → prepend dot → .example.com → matches .sub.example.com
|
|
110
|
-
(0, vitest_1.expect)(names).toContain("a");
|
|
111
|
-
// "b" (.example.com) domain-matches sub.example.com but is secure — excluded on http://
|
|
112
|
-
(0, vitest_1.expect)(names).not.toContain("b");
|
|
113
|
-
(0, vitest_1.expect)(names).toContain("d"); // sub.example.com matches exactly
|
|
114
|
-
(0, vitest_1.expect)(names).not.toContain("c");
|
|
115
|
-
});
|
|
116
|
-
(0, vitest_1.it)("filters by path prefix", () => {
|
|
117
|
-
const result = (0, cookies_js_1.filterCookies)(cookies, ["https://example.com/app/settings"]);
|
|
118
|
-
const names = result.map((c) => c.name);
|
|
119
|
-
(0, vitest_1.expect)(names).toContain("a"); // path "/" is a prefix of "/app/settings"
|
|
120
|
-
(0, vitest_1.expect)(names).toContain("b"); // path "/app" is a prefix of "/app/settings"
|
|
121
|
-
});
|
|
122
|
-
(0, vitest_1.it)("excludes secure cookies for non-https URLs", () => {
|
|
123
|
-
const result = (0, cookies_js_1.filterCookies)(cookies, ["http://example.com/app/page"]);
|
|
124
|
-
const names = result.map((c) => c.name);
|
|
125
|
-
(0, vitest_1.expect)(names).toContain("a");
|
|
126
|
-
(0, vitest_1.expect)(names).not.toContain("b"); // secure cookie, http URL
|
|
127
|
-
});
|
|
128
|
-
(0, vitest_1.it)("allows secure cookies on loopback addresses regardless of protocol", () => {
|
|
129
|
-
const cases = [
|
|
130
|
-
{ domain: "localhost", url: "http://localhost/" },
|
|
131
|
-
{ domain: "127.0.0.1", url: "http://127.0.0.1/" },
|
|
132
|
-
{ domain: "[::1]", url: "http://[::1]/" },
|
|
133
|
-
];
|
|
134
|
-
for (const { domain, url } of cases) {
|
|
135
|
-
const cookie = makeCookie({ name: "loop", domain, secure: true });
|
|
136
|
-
const result = (0, cookies_js_1.filterCookies)([cookie], [url]);
|
|
137
|
-
(0, vitest_1.expect)(result).toHaveLength(1);
|
|
138
|
-
(0, vitest_1.expect)(result[0].name).toBe("loop");
|
|
139
|
-
}
|
|
140
|
-
});
|
|
141
|
-
(0, vitest_1.it)("matches against multiple URLs (union)", () => {
|
|
142
|
-
const result = (0, cookies_js_1.filterCookies)(cookies, [
|
|
143
|
-
"http://example.com/",
|
|
144
|
-
"http://other.com/",
|
|
145
|
-
]);
|
|
146
|
-
const names = result.map((c) => c.name);
|
|
147
|
-
(0, vitest_1.expect)(names).toContain("a");
|
|
148
|
-
(0, vitest_1.expect)(names).toContain("c");
|
|
149
|
-
});
|
|
150
|
-
(0, vitest_1.it)("returns empty array when no cookies match any URL", () => {
|
|
151
|
-
const result = (0, cookies_js_1.filterCookies)(cookies, ["http://nomatch.dev/"]);
|
|
152
|
-
(0, vitest_1.expect)(result).toHaveLength(0);
|
|
153
|
-
});
|
|
154
|
-
(0, vitest_1.it)("returns empty array when cookie list is empty", () => {
|
|
155
|
-
const result = (0, cookies_js_1.filterCookies)([], ["http://example.com/"]);
|
|
156
|
-
(0, vitest_1.expect)(result).toHaveLength(0);
|
|
157
|
-
});
|
|
158
|
-
(0, vitest_1.it)("does not match a sibling subdomain against a host-only domain", () => {
|
|
159
|
-
// Cookie for "api.example.com" should NOT match "www.example.com"
|
|
160
|
-
const apiCookie = makeCookie({ name: "api", domain: "api.example.com" });
|
|
161
|
-
const result = (0, cookies_js_1.filterCookies)([apiCookie], ["http://www.example.com/"]);
|
|
162
|
-
(0, vitest_1.expect)(result).toHaveLength(0);
|
|
163
|
-
});
|
|
164
|
-
(0, vitest_1.it)("does not match a parent domain against a more specific cookie", () => {
|
|
165
|
-
// Cookie for "sub.example.com" should NOT match "example.com"
|
|
166
|
-
const subCookie = makeCookie({ name: "sub", domain: "sub.example.com" });
|
|
167
|
-
const result = (0, cookies_js_1.filterCookies)([subCookie], ["http://example.com/"]);
|
|
168
|
-
(0, vitest_1.expect)(result).toHaveLength(0);
|
|
169
|
-
});
|
|
170
|
-
(0, vitest_1.it)("does not match when path does not prefix the URL path", () => {
|
|
171
|
-
const deepCookie = makeCookie({
|
|
172
|
-
name: "deep",
|
|
173
|
-
domain: "example.com",
|
|
174
|
-
path: "/admin",
|
|
175
|
-
});
|
|
176
|
-
const result = (0, cookies_js_1.filterCookies)([deepCookie], ["http://example.com/public"]);
|
|
177
|
-
(0, vitest_1.expect)(result).toHaveLength(0);
|
|
178
|
-
});
|
|
179
|
-
(0, vitest_1.it)("does not match when cookie path is a string prefix but not a path boundary", () => {
|
|
180
|
-
// "/foo" should NOT match "/foobar" — only "/foo", "/foo/", "/foo/bar"
|
|
181
|
-
const cookie = makeCookie({
|
|
182
|
-
name: "boundary",
|
|
183
|
-
domain: "example.com",
|
|
184
|
-
path: "/foo",
|
|
185
|
-
});
|
|
186
|
-
(0, vitest_1.expect)((0, cookies_js_1.filterCookies)([cookie], ["http://example.com/foobar"])).toHaveLength(0);
|
|
187
|
-
(0, vitest_1.expect)((0, cookies_js_1.filterCookies)([cookie], ["http://example.com/foo"])).toHaveLength(1);
|
|
188
|
-
(0, vitest_1.expect)((0, cookies_js_1.filterCookies)([cookie], ["http://example.com/foo/bar"])).toHaveLength(1);
|
|
189
|
-
});
|
|
190
|
-
(0, vitest_1.it)("matches root path against any URL path", () => {
|
|
191
|
-
const rootCookie = makeCookie({
|
|
192
|
-
name: "root",
|
|
193
|
-
domain: "example.com",
|
|
194
|
-
path: "/",
|
|
195
|
-
});
|
|
196
|
-
const result = (0, cookies_js_1.filterCookies)([rootCookie], ["http://example.com/deeply/nested/page"]);
|
|
197
|
-
(0, vitest_1.expect)(result).toHaveLength(1);
|
|
198
|
-
});
|
|
199
|
-
(0, vitest_1.it)("handles URL with port numbers", () => {
|
|
200
|
-
const c = makeCookie({ name: "port", domain: "localhost", path: "/" });
|
|
201
|
-
const result = (0, cookies_js_1.filterCookies)([c], ["http://localhost:3000/api"]);
|
|
202
|
-
(0, vitest_1.expect)(result).toHaveLength(1);
|
|
203
|
-
});
|
|
204
|
-
(0, vitest_1.it)("handles URL with query string and fragment", () => {
|
|
205
|
-
const c = makeCookie({ name: "q", domain: "example.com", path: "/" });
|
|
206
|
-
const result = (0, cookies_js_1.filterCookies)([c], ["http://example.com/page?q=1&r=2#section"]);
|
|
207
|
-
(0, vitest_1.expect)(result).toHaveLength(1);
|
|
208
|
-
});
|
|
209
|
-
(0, vitest_1.it)("throws CookieValidationError for malformed URL", () => {
|
|
210
|
-
const c = makeCookie({ name: "a", domain: "example.com" });
|
|
211
|
-
(0, vitest_1.expect)(() => (0, cookies_js_1.filterCookies)([c], ["not-a-valid-url"])).toThrow(/Invalid URL passed to cookies\(\)/);
|
|
212
|
-
});
|
|
213
|
-
});
|
|
214
|
-
(0, vitest_1.describe)("normalizeCookieParams", () => {
|
|
215
|
-
(0, vitest_1.it)("passes through cookies with domain+path", () => {
|
|
216
|
-
const input = [
|
|
217
|
-
{ name: "a", value: "1", domain: "example.com", path: "/" },
|
|
218
|
-
];
|
|
219
|
-
const result = (0, cookies_js_1.normalizeCookieParams)(input);
|
|
220
|
-
(0, vitest_1.expect)(result[0].domain).toBe("example.com");
|
|
221
|
-
(0, vitest_1.expect)(result[0].path).toBe("/");
|
|
222
|
-
(0, vitest_1.expect)(result[0].url).toBeUndefined();
|
|
223
|
-
});
|
|
224
|
-
(0, vitest_1.it)("derives domain, path, and secure from url", () => {
|
|
225
|
-
const input = [
|
|
226
|
-
{ name: "a", value: "1", url: "https://example.com/app/page" },
|
|
227
|
-
];
|
|
228
|
-
const result = (0, cookies_js_1.normalizeCookieParams)(input);
|
|
229
|
-
(0, vitest_1.expect)(result[0].domain).toBe("example.com");
|
|
230
|
-
(0, vitest_1.expect)(result[0].path).toBe("/app/");
|
|
231
|
-
(0, vitest_1.expect)(result[0].secure).toBe(true);
|
|
232
|
-
(0, vitest_1.expect)(result[0].url).toBeUndefined();
|
|
233
|
-
});
|
|
234
|
-
(0, vitest_1.it)("sets secure to false for http urls", () => {
|
|
235
|
-
const input = [
|
|
236
|
-
{ name: "a", value: "1", url: "http://example.com/" },
|
|
237
|
-
];
|
|
238
|
-
const result = (0, cookies_js_1.normalizeCookieParams)(input);
|
|
239
|
-
(0, vitest_1.expect)(result[0].secure).toBe(false);
|
|
240
|
-
});
|
|
241
|
-
(0, vitest_1.it)("throws when neither url nor domain+path is provided", () => {
|
|
242
|
-
(0, vitest_1.expect)(() => (0, cookies_js_1.normalizeCookieParams)([{ name: "a", value: "1" }])).toThrow(/must have a url or a domain\/path pair/);
|
|
243
|
-
});
|
|
244
|
-
(0, vitest_1.it)("throws when both url and domain are provided", () => {
|
|
245
|
-
(0, vitest_1.expect)(() => (0, cookies_js_1.normalizeCookieParams)([
|
|
246
|
-
{ name: "a", value: "1", url: "https://x.com/", domain: "x.com" },
|
|
247
|
-
])).toThrow(/should have either url or domain/);
|
|
248
|
-
});
|
|
249
|
-
(0, vitest_1.it)("throws when both url and path are provided", () => {
|
|
250
|
-
(0, vitest_1.expect)(() => (0, cookies_js_1.normalizeCookieParams)([
|
|
251
|
-
{ name: "a", value: "1", url: "https://x.com/", path: "/" },
|
|
252
|
-
])).toThrow(/should have either url or path/);
|
|
253
|
-
});
|
|
254
|
-
(0, vitest_1.it)("throws for invalid expires (negative, not -1)", () => {
|
|
255
|
-
(0, vitest_1.expect)(() => (0, cookies_js_1.normalizeCookieParams)([
|
|
256
|
-
{ name: "a", value: "1", domain: "x.com", path: "/", expires: -5 },
|
|
257
|
-
])).toThrow(/invalid expires/);
|
|
258
|
-
});
|
|
259
|
-
(0, vitest_1.it)("allows expires of -1 (session cookie)", () => {
|
|
260
|
-
const result = (0, cookies_js_1.normalizeCookieParams)([
|
|
261
|
-
{ name: "a", value: "1", domain: "x.com", path: "/", expires: -1 },
|
|
262
|
-
]);
|
|
263
|
-
(0, vitest_1.expect)(result[0].expires).toBe(-1);
|
|
264
|
-
});
|
|
265
|
-
(0, vitest_1.it)("allows a positive expires timestamp", () => {
|
|
266
|
-
const future = Math.floor(Date.now() / 1000) + 3600;
|
|
267
|
-
const result = (0, cookies_js_1.normalizeCookieParams)([
|
|
268
|
-
{ name: "a", value: "1", domain: "x.com", path: "/", expires: future },
|
|
269
|
-
]);
|
|
270
|
-
(0, vitest_1.expect)(result[0].expires).toBe(future);
|
|
271
|
-
});
|
|
272
|
-
(0, vitest_1.it)("throws for about:blank url", () => {
|
|
273
|
-
(0, vitest_1.expect)(() => (0, cookies_js_1.normalizeCookieParams)([{ name: "a", value: "1", url: "about:blank" }])).toThrow(/Blank page/);
|
|
274
|
-
});
|
|
275
|
-
(0, vitest_1.it)("throws for data: url", () => {
|
|
276
|
-
(0, vitest_1.expect)(() => (0, cookies_js_1.normalizeCookieParams)([
|
|
277
|
-
{ name: "a", value: "1", url: "data:text/html,hi" },
|
|
278
|
-
])).toThrow(/Data URL/);
|
|
279
|
-
});
|
|
280
|
-
(0, vitest_1.it)("throws CookieValidationError for malformed url", () => {
|
|
281
|
-
(0, vitest_1.expect)(() => (0, cookies_js_1.normalizeCookieParams)([{ name: "a", value: "1", url: "not-a-url" }])).toThrow(/Cookie "a" has an invalid url/);
|
|
282
|
-
});
|
|
283
|
-
(0, vitest_1.it)("throws when sameSite is None but secure is false", () => {
|
|
284
|
-
(0, vitest_1.expect)(() => (0, cookies_js_1.normalizeCookieParams)([
|
|
285
|
-
{
|
|
286
|
-
name: "a",
|
|
287
|
-
value: "1",
|
|
288
|
-
domain: "x.com",
|
|
289
|
-
path: "/",
|
|
290
|
-
sameSite: "None",
|
|
291
|
-
secure: false,
|
|
292
|
-
},
|
|
293
|
-
])).toThrow(/sameSite: "None" without secure: true/);
|
|
294
|
-
});
|
|
295
|
-
(0, vitest_1.it)("throws when sameSite is None and secure is omitted (undefined)", () => {
|
|
296
|
-
// CDP defaults secure to false when omitted, so the browser will reject it.
|
|
297
|
-
(0, vitest_1.expect)(() => (0, cookies_js_1.normalizeCookieParams)([
|
|
298
|
-
{ name: "a", value: "1", domain: "x.com", path: "/", sameSite: "None" },
|
|
299
|
-
])).toThrow(/sameSite: "None" without secure: true/);
|
|
300
|
-
});
|
|
301
|
-
(0, vitest_1.it)("does NOT throw when sameSite is None and secure is true", () => {
|
|
302
|
-
const result = (0, cookies_js_1.normalizeCookieParams)([
|
|
303
|
-
{
|
|
304
|
-
name: "a",
|
|
305
|
-
value: "1",
|
|
306
|
-
domain: "x.com",
|
|
307
|
-
path: "/",
|
|
308
|
-
sameSite: "None",
|
|
309
|
-
secure: true,
|
|
310
|
-
},
|
|
311
|
-
]);
|
|
312
|
-
(0, vitest_1.expect)(result[0].sameSite).toBe("None");
|
|
313
|
-
(0, vitest_1.expect)(result[0].secure).toBe(true);
|
|
314
|
-
});
|
|
315
|
-
(0, vitest_1.it)("derives root path from URL with no trailing path segments", () => {
|
|
316
|
-
const result = (0, cookies_js_1.normalizeCookieParams)([
|
|
317
|
-
{ name: "a", value: "1", url: "https://example.com" },
|
|
318
|
-
]);
|
|
319
|
-
// URL("https://example.com").pathname is "/", lastIndexOf("/") + 1 = 1 → "/"
|
|
320
|
-
(0, vitest_1.expect)(result[0].path).toBe("/");
|
|
321
|
-
});
|
|
322
|
-
(0, vitest_1.it)("handles URL with port number", () => {
|
|
323
|
-
const result = (0, cookies_js_1.normalizeCookieParams)([
|
|
324
|
-
{ name: "a", value: "1", url: "https://localhost:3000/api/v1" },
|
|
325
|
-
]);
|
|
326
|
-
(0, vitest_1.expect)(result[0].domain).toBe("localhost");
|
|
327
|
-
(0, vitest_1.expect)(result[0].path).toBe("/api/");
|
|
328
|
-
(0, vitest_1.expect)(result[0].secure).toBe(true);
|
|
329
|
-
});
|
|
330
|
-
(0, vitest_1.it)("handles URL with query string (ignores query)", () => {
|
|
331
|
-
const result = (0, cookies_js_1.normalizeCookieParams)([
|
|
332
|
-
{ name: "a", value: "1", url: "https://example.com/page?q=1" },
|
|
333
|
-
]);
|
|
334
|
-
(0, vitest_1.expect)(result[0].domain).toBe("example.com");
|
|
335
|
-
(0, vitest_1.expect)(result[0].path).toBe("/");
|
|
336
|
-
});
|
|
337
|
-
(0, vitest_1.it)("normalises multiple cookies in a single call", () => {
|
|
338
|
-
const result = (0, cookies_js_1.normalizeCookieParams)([
|
|
339
|
-
{ name: "a", value: "1", url: "https://one.com/x" },
|
|
340
|
-
{ name: "b", value: "2", domain: "two.com", path: "/" },
|
|
341
|
-
{ name: "c", value: "3", url: "http://three.com/y/z" },
|
|
342
|
-
]);
|
|
343
|
-
(0, vitest_1.expect)(result).toHaveLength(3);
|
|
344
|
-
(0, vitest_1.expect)(result[0].domain).toBe("one.com");
|
|
345
|
-
(0, vitest_1.expect)(result[1].domain).toBe("two.com");
|
|
346
|
-
(0, vitest_1.expect)(result[2].domain).toBe("three.com");
|
|
347
|
-
(0, vitest_1.expect)(result[2].secure).toBe(false);
|
|
348
|
-
});
|
|
349
|
-
(0, vitest_1.it)("does not mutate the original input array", () => {
|
|
350
|
-
const input = [
|
|
351
|
-
{ name: "a", value: "1", url: "https://example.com/app" },
|
|
352
|
-
];
|
|
353
|
-
const frozen = { ...input[0] };
|
|
354
|
-
(0, cookies_js_1.normalizeCookieParams)(input);
|
|
355
|
-
(0, vitest_1.expect)(input[0]).toEqual(frozen);
|
|
356
|
-
});
|
|
357
|
-
(0, vitest_1.it)("preserves optional fields that are explicitly set", () => {
|
|
358
|
-
const result = (0, cookies_js_1.normalizeCookieParams)([
|
|
359
|
-
{
|
|
360
|
-
name: "full",
|
|
361
|
-
value: "val",
|
|
362
|
-
domain: "x.com",
|
|
363
|
-
path: "/p",
|
|
364
|
-
expires: 9999999999,
|
|
365
|
-
httpOnly: true,
|
|
366
|
-
secure: true,
|
|
367
|
-
sameSite: "Strict",
|
|
368
|
-
},
|
|
369
|
-
]);
|
|
370
|
-
const c = result[0];
|
|
371
|
-
(0, vitest_1.expect)(c.httpOnly).toBe(true);
|
|
372
|
-
(0, vitest_1.expect)(c.secure).toBe(true);
|
|
373
|
-
(0, vitest_1.expect)(c.sameSite).toBe("Strict");
|
|
374
|
-
(0, vitest_1.expect)(c.expires).toBe(9999999999);
|
|
375
|
-
});
|
|
376
|
-
(0, vitest_1.it)("allows expires of 0 (epoch — effectively expired)", () => {
|
|
377
|
-
// 0 is a positive-ish edge case; browsers treat it as already expired
|
|
378
|
-
const result = (0, cookies_js_1.normalizeCookieParams)([
|
|
379
|
-
{ name: "a", value: "1", domain: "x.com", path: "/", expires: 0 },
|
|
380
|
-
]);
|
|
381
|
-
(0, vitest_1.expect)(result[0].expires).toBe(0);
|
|
382
|
-
});
|
|
383
|
-
(0, vitest_1.it)("throws on the first invalid cookie in a batch", () => {
|
|
384
|
-
(0, vitest_1.expect)(() => (0, cookies_js_1.normalizeCookieParams)([
|
|
385
|
-
{ name: "ok", value: "1", domain: "x.com", path: "/" },
|
|
386
|
-
{ name: "bad", value: "2" }, // missing url/domain+path
|
|
387
|
-
])).toThrow(/Cookie "bad"/);
|
|
388
|
-
});
|
|
389
|
-
(0, vitest_1.it)("includes cookie name in every error message", () => {
|
|
390
|
-
const cases = [
|
|
391
|
-
() => (0, cookies_js_1.normalizeCookieParams)([{ name: "NAMED", value: "1" }]),
|
|
392
|
-
() => (0, cookies_js_1.normalizeCookieParams)([
|
|
393
|
-
{ name: "NAMED", value: "1", url: "https://x.com/", domain: "x" },
|
|
394
|
-
]),
|
|
395
|
-
() => (0, cookies_js_1.normalizeCookieParams)([
|
|
396
|
-
{ name: "NAMED", value: "1", url: "about:blank" },
|
|
397
|
-
]),
|
|
398
|
-
() => (0, cookies_js_1.normalizeCookieParams)([
|
|
399
|
-
{
|
|
400
|
-
name: "NAMED",
|
|
401
|
-
value: "1",
|
|
402
|
-
domain: "x.com",
|
|
403
|
-
path: "/",
|
|
404
|
-
sameSite: "None",
|
|
405
|
-
secure: false,
|
|
406
|
-
},
|
|
407
|
-
]),
|
|
408
|
-
];
|
|
409
|
-
for (const fn of cases) {
|
|
410
|
-
(0, vitest_1.expect)(fn).toThrow(/NAMED/);
|
|
411
|
-
}
|
|
412
|
-
});
|
|
413
|
-
});
|
|
414
|
-
(0, vitest_1.describe)("cookieMatchesFilter", () => {
|
|
415
|
-
const cookie = makeCookie({
|
|
416
|
-
name: "session",
|
|
417
|
-
domain: ".example.com",
|
|
418
|
-
path: "/app",
|
|
419
|
-
});
|
|
420
|
-
(0, vitest_1.it)("matches when all filters match (exact strings)", () => {
|
|
421
|
-
(0, vitest_1.expect)((0, cookies_js_1.cookieMatchesFilter)(cookie, {
|
|
422
|
-
name: "session",
|
|
423
|
-
domain: ".example.com",
|
|
424
|
-
path: "/app",
|
|
425
|
-
})).toBe(true);
|
|
426
|
-
});
|
|
427
|
-
(0, vitest_1.it)("does not match when name differs", () => {
|
|
428
|
-
(0, vitest_1.expect)((0, cookies_js_1.cookieMatchesFilter)(cookie, { name: "other" })).toBe(false);
|
|
429
|
-
});
|
|
430
|
-
(0, vitest_1.it)("does not match when domain differs", () => {
|
|
431
|
-
(0, vitest_1.expect)((0, cookies_js_1.cookieMatchesFilter)(cookie, { domain: "other.com" })).toBe(false);
|
|
432
|
-
});
|
|
433
|
-
(0, vitest_1.it)("does not match when path differs", () => {
|
|
434
|
-
(0, vitest_1.expect)((0, cookies_js_1.cookieMatchesFilter)(cookie, { path: "/other" })).toBe(false);
|
|
435
|
-
});
|
|
436
|
-
(0, vitest_1.it)("matches with regex name", () => {
|
|
437
|
-
(0, vitest_1.expect)((0, cookies_js_1.cookieMatchesFilter)(cookie, { name: /^sess/ })).toBe(true);
|
|
438
|
-
(0, vitest_1.expect)((0, cookies_js_1.cookieMatchesFilter)(cookie, { name: /^nope/ })).toBe(false);
|
|
439
|
-
});
|
|
440
|
-
(0, vitest_1.it)("matches with regex domain", () => {
|
|
441
|
-
(0, vitest_1.expect)((0, cookies_js_1.cookieMatchesFilter)(cookie, { domain: /example\.com$/ })).toBe(true);
|
|
442
|
-
(0, vitest_1.expect)((0, cookies_js_1.cookieMatchesFilter)(cookie, { domain: /^other/ })).toBe(false);
|
|
443
|
-
});
|
|
444
|
-
(0, vitest_1.it)("matches with regex path", () => {
|
|
445
|
-
(0, vitest_1.expect)((0, cookies_js_1.cookieMatchesFilter)(cookie, { path: /^\/app/ })).toBe(true);
|
|
446
|
-
});
|
|
447
|
-
(0, vitest_1.it)("undefined filters match everything", () => {
|
|
448
|
-
(0, vitest_1.expect)((0, cookies_js_1.cookieMatchesFilter)(cookie, {})).toBe(true);
|
|
449
|
-
(0, vitest_1.expect)((0, cookies_js_1.cookieMatchesFilter)(cookie, { name: undefined })).toBe(true);
|
|
450
|
-
});
|
|
451
|
-
(0, vitest_1.it)("requires ALL filters to match (AND logic)", () => {
|
|
452
|
-
// name matches but domain does not
|
|
453
|
-
(0, vitest_1.expect)((0, cookies_js_1.cookieMatchesFilter)(cookie, { name: "session", domain: "wrong.com" })).toBe(false);
|
|
454
|
-
});
|
|
455
|
-
(0, vitest_1.it)("handles global regex lastIndex correctly", () => {
|
|
456
|
-
const re = /sess/g;
|
|
457
|
-
re.lastIndex = 999;
|
|
458
|
-
(0, vitest_1.expect)((0, cookies_js_1.cookieMatchesFilter)(cookie, { name: re })).toBe(true);
|
|
459
|
-
});
|
|
460
|
-
(0, vitest_1.it)("exact string does not do substring matching", () => {
|
|
461
|
-
// filter name "sess" should NOT match cookie name "session"
|
|
462
|
-
(0, vitest_1.expect)((0, cookies_js_1.cookieMatchesFilter)(cookie, { name: "sess" })).toBe(false);
|
|
463
|
-
});
|
|
464
|
-
(0, vitest_1.it)("regex can do substring matching", () => {
|
|
465
|
-
// regex /sess/ SHOULD match cookie name "session" (substring)
|
|
466
|
-
(0, vitest_1.expect)((0, cookies_js_1.cookieMatchesFilter)(cookie, { name: /sess/ })).toBe(true);
|
|
467
|
-
});
|
|
468
|
-
(0, vitest_1.it)("works with all three regex filters combined", () => {
|
|
469
|
-
(0, vitest_1.expect)((0, cookies_js_1.cookieMatchesFilter)(cookie, {
|
|
470
|
-
name: /^session$/,
|
|
471
|
-
domain: /example/,
|
|
472
|
-
path: /^\/app$/,
|
|
473
|
-
})).toBe(true);
|
|
474
|
-
// One of three fails
|
|
475
|
-
(0, vitest_1.expect)((0, cookies_js_1.cookieMatchesFilter)(cookie, {
|
|
476
|
-
name: /^session$/,
|
|
477
|
-
domain: /example/,
|
|
478
|
-
path: /^\/wrong$/,
|
|
479
|
-
})).toBe(false);
|
|
480
|
-
});
|
|
481
|
-
(0, vitest_1.it)("empty string filter only matches empty cookie property", () => {
|
|
482
|
-
const emptyPathCookie = makeCookie({
|
|
483
|
-
name: "x",
|
|
484
|
-
domain: "a.com",
|
|
485
|
-
path: "",
|
|
486
|
-
});
|
|
487
|
-
(0, vitest_1.expect)((0, cookies_js_1.cookieMatchesFilter)(emptyPathCookie, { path: "" })).toBe(true);
|
|
488
|
-
(0, vitest_1.expect)((0, cookies_js_1.cookieMatchesFilter)(cookie, { path: "" })).toBe(false);
|
|
489
|
-
});
|
|
490
|
-
(0, vitest_1.it)("is called once per cookie (no cross-contamination between calls)", () => {
|
|
491
|
-
const c1 = makeCookie({ name: "alpha", domain: "a.com", path: "/" });
|
|
492
|
-
const c2 = makeCookie({ name: "beta", domain: "b.com", path: "/x" });
|
|
493
|
-
const filter = { name: "alpha", domain: "a.com" };
|
|
494
|
-
(0, vitest_1.expect)((0, cookies_js_1.cookieMatchesFilter)(c1, filter)).toBe(true);
|
|
495
|
-
(0, vitest_1.expect)((0, cookies_js_1.cookieMatchesFilter)(c2, filter)).toBe(false);
|
|
496
|
-
});
|
|
497
|
-
});
|
|
498
|
-
(0, vitest_1.describe)("V3Context cookie methods", () => {
|
|
499
|
-
// We test V3Context methods by constructing a minimal instance with a mock
|
|
500
|
-
// CDP connection. V3Context.create() requires a real WebSocket, so we build
|
|
501
|
-
// one via type-casting a MockCDPSession into the `conn` slot.
|
|
502
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
503
|
-
let V3ContextClass;
|
|
504
|
-
(0, vitest_1.beforeEach)(async () => {
|
|
505
|
-
const mod = await Promise.resolve().then(() => __importStar(require("../../lib/v3/understudy/context.js")));
|
|
506
|
-
V3ContextClass = mod.V3Context;
|
|
507
|
-
});
|
|
508
|
-
function makeContext(cdpHandlers) {
|
|
509
|
-
const mockConn = new mockCDPSession_js_1.MockCDPSession(cdpHandlers, "root");
|
|
510
|
-
// V3Context stores the connection as `conn` (readonly). We create an
|
|
511
|
-
// object with the real prototype so we get the actual method implementations.
|
|
512
|
-
const ctx = Object.create(V3ContextClass.prototype);
|
|
513
|
-
// Assign the mock connection
|
|
514
|
-
Object.defineProperty(ctx, "conn", { value: mockConn, writable: false });
|
|
515
|
-
return ctx;
|
|
516
|
-
}
|
|
517
|
-
function getMockConn(ctx) {
|
|
518
|
-
return ctx.conn;
|
|
519
|
-
}
|
|
520
|
-
(0, vitest_1.describe)("cookies()", () => {
|
|
521
|
-
(0, vitest_1.it)("returns all cookies from Storage.getCookies", async () => {
|
|
522
|
-
const cdpCookies = [
|
|
523
|
-
toCdpCookie(makeCookie({ name: "a", domain: "example.com" })),
|
|
524
|
-
toCdpCookie(makeCookie({ name: "b", domain: "other.com" })),
|
|
525
|
-
];
|
|
526
|
-
const ctx = makeContext({
|
|
527
|
-
"Storage.getCookies": () => ({ cookies: cdpCookies }),
|
|
528
|
-
});
|
|
529
|
-
const result = await ctx.cookies();
|
|
530
|
-
(0, vitest_1.expect)(result).toHaveLength(2);
|
|
531
|
-
(0, vitest_1.expect)(result.map((c) => c.name)).toEqual(["a", "b"]);
|
|
532
|
-
});
|
|
533
|
-
(0, vitest_1.it)("filters by URL when provided as string", async () => {
|
|
534
|
-
const cdpCookies = [
|
|
535
|
-
toCdpCookie(makeCookie({ name: "a", domain: "example.com" })),
|
|
536
|
-
toCdpCookie(makeCookie({ name: "b", domain: "other.com" })),
|
|
537
|
-
];
|
|
538
|
-
const ctx = makeContext({
|
|
539
|
-
"Storage.getCookies": () => ({ cookies: cdpCookies }),
|
|
540
|
-
});
|
|
541
|
-
const result = await ctx.cookies("http://example.com/");
|
|
542
|
-
(0, vitest_1.expect)(result).toHaveLength(1);
|
|
543
|
-
(0, vitest_1.expect)(result[0].name).toBe("a");
|
|
544
|
-
});
|
|
545
|
-
(0, vitest_1.it)("filters by URL when provided as array", async () => {
|
|
546
|
-
const cdpCookies = [
|
|
547
|
-
toCdpCookie(makeCookie({ name: "a", domain: "example.com" })),
|
|
548
|
-
toCdpCookie(makeCookie({ name: "b", domain: "other.com" })),
|
|
549
|
-
];
|
|
550
|
-
const ctx = makeContext({
|
|
551
|
-
"Storage.getCookies": () => ({ cookies: cdpCookies }),
|
|
552
|
-
});
|
|
553
|
-
const result = await ctx.cookies(["http://other.com/"]);
|
|
554
|
-
(0, vitest_1.expect)(result).toHaveLength(1);
|
|
555
|
-
(0, vitest_1.expect)(result[0].name).toBe("b");
|
|
556
|
-
});
|
|
557
|
-
(0, vitest_1.it)("defaults sameSite to Lax when CDP returns undefined", async () => {
|
|
558
|
-
const cdpCookie = {
|
|
559
|
-
...toCdpCookie(makeCookie()),
|
|
560
|
-
sameSite: undefined,
|
|
561
|
-
};
|
|
562
|
-
const ctx = makeContext({
|
|
563
|
-
"Storage.getCookies": () => ({ cookies: [cdpCookie] }),
|
|
564
|
-
});
|
|
565
|
-
const result = await ctx.cookies();
|
|
566
|
-
(0, vitest_1.expect)(result[0].sameSite).toBe("Lax");
|
|
567
|
-
});
|
|
568
|
-
(0, vitest_1.it)("returns empty array when browser has no cookies", async () => {
|
|
569
|
-
const ctx = makeContext({
|
|
570
|
-
"Storage.getCookies": () => ({ cookies: [] }),
|
|
571
|
-
});
|
|
572
|
-
const result = await ctx.cookies();
|
|
573
|
-
(0, vitest_1.expect)(result).toEqual([]);
|
|
574
|
-
});
|
|
575
|
-
(0, vitest_1.it)("maps all CDP cookie fields to our Cookie type", async () => {
|
|
576
|
-
const cdpCookie = toCdpCookie(makeCookie({
|
|
577
|
-
name: "full",
|
|
578
|
-
value: "v",
|
|
579
|
-
domain: ".test.com",
|
|
580
|
-
path: "/p",
|
|
581
|
-
expires: 1700000000,
|
|
582
|
-
httpOnly: true,
|
|
583
|
-
secure: true,
|
|
584
|
-
sameSite: "Strict",
|
|
585
|
-
}));
|
|
586
|
-
const ctx = makeContext({
|
|
587
|
-
"Storage.getCookies": () => ({ cookies: [cdpCookie] }),
|
|
588
|
-
});
|
|
589
|
-
const result = await ctx.cookies();
|
|
590
|
-
(0, vitest_1.expect)(result[0]).toEqual({
|
|
591
|
-
name: "full",
|
|
592
|
-
value: "v",
|
|
593
|
-
domain: ".test.com",
|
|
594
|
-
path: "/p",
|
|
595
|
-
expires: 1700000000,
|
|
596
|
-
httpOnly: true,
|
|
597
|
-
secure: true,
|
|
598
|
-
sameSite: "Strict",
|
|
599
|
-
});
|
|
600
|
-
});
|
|
601
|
-
(0, vitest_1.it)("strips extra CDP fields (size, priority, etc.) from result", async () => {
|
|
602
|
-
const cdpCookie = toCdpCookie(makeCookie({ name: "stripped" }));
|
|
603
|
-
const ctx = makeContext({
|
|
604
|
-
"Storage.getCookies": () => ({ cookies: [cdpCookie] }),
|
|
605
|
-
});
|
|
606
|
-
const result = await ctx.cookies();
|
|
607
|
-
const keys = Object.keys(result[0]);
|
|
608
|
-
(0, vitest_1.expect)(keys).not.toContain("size");
|
|
609
|
-
(0, vitest_1.expect)(keys).not.toContain("priority");
|
|
610
|
-
(0, vitest_1.expect)(keys).not.toContain("sourceScheme");
|
|
611
|
-
(0, vitest_1.expect)(keys).not.toContain("sourcePort");
|
|
612
|
-
});
|
|
613
|
-
(0, vitest_1.it)("calls Storage.getCookies exactly once per invocation", async () => {
|
|
614
|
-
const ctx = makeContext({
|
|
615
|
-
"Storage.getCookies": () => ({ cookies: [] }),
|
|
616
|
-
});
|
|
617
|
-
await ctx.cookies();
|
|
618
|
-
await ctx.cookies("http://example.com");
|
|
619
|
-
const calls = getMockConn(ctx).callsFor("Storage.getCookies");
|
|
620
|
-
(0, vitest_1.expect)(calls).toHaveLength(2);
|
|
621
|
-
});
|
|
622
|
-
});
|
|
623
|
-
(0, vitest_1.describe)("addCookies()", () => {
|
|
624
|
-
(0, vitest_1.it)("sends all cookies in a single Storage.setCookies call", async () => {
|
|
625
|
-
const ctx = makeContext({
|
|
626
|
-
"Storage.setCookies": () => ({}),
|
|
627
|
-
});
|
|
628
|
-
await ctx.addCookies([
|
|
629
|
-
{ name: "a", value: "1", domain: "example.com", path: "/" },
|
|
630
|
-
{ name: "b", value: "2", domain: "other.com", path: "/" },
|
|
631
|
-
]);
|
|
632
|
-
const calls = getMockConn(ctx).callsFor("Storage.setCookies");
|
|
633
|
-
(0, vitest_1.expect)(calls).toHaveLength(1);
|
|
634
|
-
(0, vitest_1.expect)(calls[0].params).toMatchObject({
|
|
635
|
-
cookies: [
|
|
636
|
-
{ name: "a", domain: "example.com" },
|
|
637
|
-
{ name: "b", domain: "other.com" },
|
|
638
|
-
],
|
|
639
|
-
});
|
|
640
|
-
});
|
|
641
|
-
(0, vitest_1.it)("derives domain/path/secure from url", async () => {
|
|
642
|
-
const ctx = makeContext({
|
|
643
|
-
"Storage.setCookies": () => ({}),
|
|
644
|
-
});
|
|
645
|
-
await ctx.addCookies([
|
|
646
|
-
{ name: "a", value: "1", url: "https://example.com/app/page" },
|
|
647
|
-
]);
|
|
648
|
-
const calls = getMockConn(ctx).callsFor("Storage.setCookies");
|
|
649
|
-
(0, vitest_1.expect)(calls[0].params).toMatchObject({
|
|
650
|
-
cookies: [
|
|
651
|
-
{ name: "a", domain: "example.com", path: "/app/", secure: true },
|
|
652
|
-
],
|
|
653
|
-
});
|
|
654
|
-
});
|
|
655
|
-
(0, vitest_1.it)("throws when Storage.setCookies fails", async () => {
|
|
656
|
-
const ctx = makeContext({
|
|
657
|
-
"Storage.setCookies": () => {
|
|
658
|
-
throw new Error("CDP failure");
|
|
659
|
-
},
|
|
660
|
-
});
|
|
661
|
-
await (0, vitest_1.expect)(ctx.addCookies([
|
|
662
|
-
{ name: "bad", value: "x", domain: "example.com", path: "/" },
|
|
663
|
-
])).rejects.toThrow(/Failed to set cookies \["bad"\]/);
|
|
664
|
-
});
|
|
665
|
-
(0, vitest_1.it)("throws for sameSite None without secure", async () => {
|
|
666
|
-
const ctx = makeContext({
|
|
667
|
-
"Storage.setCookies": () => ({}),
|
|
668
|
-
});
|
|
669
|
-
await (0, vitest_1.expect)(ctx.addCookies([
|
|
670
|
-
{
|
|
671
|
-
name: "x",
|
|
672
|
-
value: "1",
|
|
673
|
-
domain: "example.com",
|
|
674
|
-
path: "/",
|
|
675
|
-
sameSite: "None",
|
|
676
|
-
secure: false,
|
|
677
|
-
},
|
|
678
|
-
])).rejects.toThrow(/sameSite: "None" without secure: true/);
|
|
679
|
-
});
|
|
680
|
-
(0, vitest_1.it)("does nothing when passed an empty array", async () => {
|
|
681
|
-
const ctx = makeContext({
|
|
682
|
-
"Storage.setCookies": () => ({}),
|
|
683
|
-
});
|
|
684
|
-
await ctx.addCookies([]);
|
|
685
|
-
const calls = getMockConn(ctx).callsFor("Storage.setCookies");
|
|
686
|
-
(0, vitest_1.expect)(calls).toHaveLength(0);
|
|
687
|
-
});
|
|
688
|
-
(0, vitest_1.it)("sends all cookie fields to CDP (including optional ones)", async () => {
|
|
689
|
-
const ctx = makeContext({
|
|
690
|
-
"Storage.setCookies": () => ({}),
|
|
691
|
-
});
|
|
692
|
-
await ctx.addCookies([
|
|
693
|
-
{
|
|
694
|
-
name: "full",
|
|
695
|
-
value: "val",
|
|
696
|
-
domain: "x.com",
|
|
697
|
-
path: "/p",
|
|
698
|
-
expires: 9999999999,
|
|
699
|
-
httpOnly: true,
|
|
700
|
-
secure: true,
|
|
701
|
-
sameSite: "Strict",
|
|
702
|
-
},
|
|
703
|
-
]);
|
|
704
|
-
const calls = getMockConn(ctx).callsFor("Storage.setCookies");
|
|
705
|
-
(0, vitest_1.expect)(calls[0].params).toEqual({
|
|
706
|
-
cookies: [
|
|
707
|
-
{
|
|
708
|
-
name: "full",
|
|
709
|
-
value: "val",
|
|
710
|
-
domain: "x.com",
|
|
711
|
-
path: "/p",
|
|
712
|
-
expires: 9999999999,
|
|
713
|
-
httpOnly: true,
|
|
714
|
-
secure: true,
|
|
715
|
-
sameSite: "Strict",
|
|
716
|
-
},
|
|
717
|
-
],
|
|
718
|
-
});
|
|
719
|
-
});
|
|
720
|
-
(0, vitest_1.it)("error message includes all cookie names when batch fails", async () => {
|
|
721
|
-
const ctx = makeContext({
|
|
722
|
-
"Storage.setCookies": () => {
|
|
723
|
-
throw new Error("CDP failure");
|
|
724
|
-
},
|
|
725
|
-
});
|
|
726
|
-
await (0, vitest_1.expect)(ctx.addCookies([
|
|
727
|
-
{ name: "alpha", value: "1", domain: "a.com", path: "/" },
|
|
728
|
-
{ name: "beta", value: "2", domain: "b.com", path: "/" },
|
|
729
|
-
])).rejects.toThrow(/Failed to set cookies \["alpha", "beta"\]/);
|
|
730
|
-
});
|
|
731
|
-
});
|
|
732
|
-
(0, vitest_1.describe)("clearCookies()", () => {
|
|
733
|
-
const cdpCookies = [
|
|
734
|
-
toCdpCookie(makeCookie({ name: "session", domain: "example.com", path: "/" })),
|
|
735
|
-
toCdpCookie(makeCookie({ name: "_ga", domain: ".example.com", path: "/" })),
|
|
736
|
-
toCdpCookie(makeCookie({ name: "pref", domain: "other.com", path: "/settings" })),
|
|
737
|
-
];
|
|
738
|
-
(0, vitest_1.it)("uses atomic Storage.clearCookies when called with no options", async () => {
|
|
739
|
-
const ctx = makeContext({
|
|
740
|
-
"Storage.clearCookies": () => ({}),
|
|
741
|
-
});
|
|
742
|
-
await ctx.clearCookies();
|
|
743
|
-
const clearCalls = getMockConn(ctx).callsFor("Storage.clearCookies");
|
|
744
|
-
(0, vitest_1.expect)(clearCalls).toHaveLength(1);
|
|
745
|
-
// Should NOT have fetched or re-set anything
|
|
746
|
-
const getCalls = getMockConn(ctx).callsFor("Storage.getCookies");
|
|
747
|
-
(0, vitest_1.expect)(getCalls).toHaveLength(0);
|
|
748
|
-
const setCalls = getMockConn(ctx).callsFor("Storage.setCookies");
|
|
749
|
-
(0, vitest_1.expect)(setCalls).toHaveLength(0);
|
|
750
|
-
});
|
|
751
|
-
(0, vitest_1.it)("clears and re-adds only non-matching cookies (name filter)", async () => {
|
|
752
|
-
const ctx = makeContext({
|
|
753
|
-
"Storage.getCookies": () => ({ cookies: [...cdpCookies] }),
|
|
754
|
-
"Storage.clearCookies": () => ({}),
|
|
755
|
-
"Storage.setCookies": () => ({}),
|
|
756
|
-
});
|
|
757
|
-
await ctx.clearCookies({ name: "_ga" });
|
|
758
|
-
const clearCalls = getMockConn(ctx).callsFor("Storage.clearCookies");
|
|
759
|
-
(0, vitest_1.expect)(clearCalls).toHaveLength(1);
|
|
760
|
-
const setCalls = getMockConn(ctx).callsFor("Storage.setCookies");
|
|
761
|
-
(0, vitest_1.expect)(setCalls).toHaveLength(1);
|
|
762
|
-
const kept = (setCalls[0].params?.cookies).map((c) => c.name);
|
|
763
|
-
(0, vitest_1.expect)(kept).toEqual(["session", "pref"]);
|
|
764
|
-
});
|
|
765
|
-
(0, vitest_1.it)("clears and re-adds only non-matching cookies (domain filter)", async () => {
|
|
766
|
-
const ctx = makeContext({
|
|
767
|
-
"Storage.getCookies": () => ({ cookies: [...cdpCookies] }),
|
|
768
|
-
"Storage.clearCookies": () => ({}),
|
|
769
|
-
"Storage.setCookies": () => ({}),
|
|
770
|
-
});
|
|
771
|
-
await ctx.clearCookies({ domain: "other.com" });
|
|
772
|
-
const setCalls = getMockConn(ctx).callsFor("Storage.setCookies");
|
|
773
|
-
const kept = (setCalls[0].params?.cookies).map((c) => c.name);
|
|
774
|
-
(0, vitest_1.expect)(kept).toEqual(["session", "_ga"]);
|
|
775
|
-
});
|
|
776
|
-
(0, vitest_1.it)("clears and re-adds only non-matching cookies (regex name)", async () => {
|
|
777
|
-
const ctx = makeContext({
|
|
778
|
-
"Storage.getCookies": () => ({ cookies: [...cdpCookies] }),
|
|
779
|
-
"Storage.clearCookies": () => ({}),
|
|
780
|
-
"Storage.setCookies": () => ({}),
|
|
781
|
-
});
|
|
782
|
-
await ctx.clearCookies({ name: /^_ga/ });
|
|
783
|
-
const setCalls = getMockConn(ctx).callsFor("Storage.setCookies");
|
|
784
|
-
const kept = (setCalls[0].params?.cookies).map((c) => c.name);
|
|
785
|
-
(0, vitest_1.expect)(kept).toEqual(["session", "pref"]);
|
|
786
|
-
});
|
|
787
|
-
(0, vitest_1.it)("applies AND logic across multiple filters", async () => {
|
|
788
|
-
const ctx = makeContext({
|
|
789
|
-
"Storage.getCookies": () => ({ cookies: [...cdpCookies] }),
|
|
790
|
-
"Storage.clearCookies": () => ({}),
|
|
791
|
-
"Storage.setCookies": () => ({}),
|
|
792
|
-
});
|
|
793
|
-
await ctx.clearCookies({ name: "session", domain: "example.com" });
|
|
794
|
-
const setCalls = getMockConn(ctx).callsFor("Storage.setCookies");
|
|
795
|
-
const kept = (setCalls[0].params?.cookies).map((c) => c.name);
|
|
796
|
-
(0, vitest_1.expect)(kept).toEqual(["_ga", "pref"]);
|
|
797
|
-
});
|
|
798
|
-
(0, vitest_1.it)("does nothing when filter matches no cookies", async () => {
|
|
799
|
-
const ctx = makeContext({
|
|
800
|
-
"Storage.getCookies": () => ({ cookies: [...cdpCookies] }),
|
|
801
|
-
"Storage.clearCookies": () => ({}),
|
|
802
|
-
"Storage.setCookies": () => ({}),
|
|
803
|
-
});
|
|
804
|
-
await ctx.clearCookies({ name: "nonexistent" });
|
|
805
|
-
const clearCalls = getMockConn(ctx).callsFor("Storage.clearCookies");
|
|
806
|
-
(0, vitest_1.expect)(clearCalls).toHaveLength(0);
|
|
807
|
-
const setCalls = getMockConn(ctx).callsFor("Storage.setCookies");
|
|
808
|
-
(0, vitest_1.expect)(setCalls).toHaveLength(0);
|
|
809
|
-
});
|
|
810
|
-
(0, vitest_1.it)("clears without re-adding when filter matches all cookies", async () => {
|
|
811
|
-
const ctx = makeContext({
|
|
812
|
-
"Storage.getCookies": () => ({ cookies: [...cdpCookies] }),
|
|
813
|
-
"Storage.clearCookies": () => ({}),
|
|
814
|
-
"Storage.setCookies": () => ({}),
|
|
815
|
-
});
|
|
816
|
-
await ctx.clearCookies({ name: /.*/ });
|
|
817
|
-
const clearCalls = getMockConn(ctx).callsFor("Storage.clearCookies");
|
|
818
|
-
(0, vitest_1.expect)(clearCalls).toHaveLength(1);
|
|
819
|
-
const setCalls = getMockConn(ctx).callsFor("Storage.setCookies");
|
|
820
|
-
(0, vitest_1.expect)(setCalls).toHaveLength(0);
|
|
821
|
-
});
|
|
822
|
-
(0, vitest_1.it)("handles regex that matches multiple cookies", async () => {
|
|
823
|
-
const ctx = makeContext({
|
|
824
|
-
"Storage.getCookies": () => ({
|
|
825
|
-
cookies: [
|
|
826
|
-
toCdpCookie(makeCookie({ name: "_ga_ABC", domain: "example.com", path: "/" })),
|
|
827
|
-
toCdpCookie(makeCookie({ name: "_ga_DEF", domain: "example.com", path: "/" })),
|
|
828
|
-
toCdpCookie(makeCookie({ name: "_gid", domain: "example.com", path: "/" })),
|
|
829
|
-
toCdpCookie(makeCookie({ name: "session", domain: "example.com", path: "/" })),
|
|
830
|
-
],
|
|
831
|
-
}),
|
|
832
|
-
"Storage.clearCookies": () => ({}),
|
|
833
|
-
"Storage.setCookies": () => ({}),
|
|
834
|
-
});
|
|
835
|
-
await ctx.clearCookies({ name: /^_ga/ });
|
|
836
|
-
const setCalls = getMockConn(ctx).callsFor("Storage.setCookies");
|
|
837
|
-
const kept = (setCalls[0].params?.cookies).map((c) => c.name);
|
|
838
|
-
(0, vitest_1.expect)(kept).toContain("_gid");
|
|
839
|
-
(0, vitest_1.expect)(kept).toContain("session");
|
|
840
|
-
(0, vitest_1.expect)(kept).not.toContain("_ga_ABC");
|
|
841
|
-
(0, vitest_1.expect)(kept).not.toContain("_ga_DEF");
|
|
842
|
-
});
|
|
843
|
-
(0, vitest_1.it)("regex domain filter combined with path filter", async () => {
|
|
844
|
-
const ctx = makeContext({
|
|
845
|
-
"Storage.getCookies": () => ({ cookies: [...cdpCookies] }),
|
|
846
|
-
"Storage.clearCookies": () => ({}),
|
|
847
|
-
"Storage.setCookies": () => ({}),
|
|
848
|
-
});
|
|
849
|
-
await ctx.clearCookies({ domain: /example/, path: "/settings" });
|
|
850
|
-
const clearCalls = getMockConn(ctx).callsFor("Storage.clearCookies");
|
|
851
|
-
(0, vitest_1.expect)(clearCalls).toHaveLength(0);
|
|
852
|
-
const setCalls = getMockConn(ctx).callsFor("Storage.setCookies");
|
|
853
|
-
(0, vitest_1.expect)(setCalls).toHaveLength(0);
|
|
854
|
-
});
|
|
855
|
-
(0, vitest_1.it)("clearCookies with empty options object uses atomic clear (same as no args)", async () => {
|
|
856
|
-
const ctx = makeContext({
|
|
857
|
-
"Storage.clearCookies": () => ({}),
|
|
858
|
-
});
|
|
859
|
-
await ctx.clearCookies({});
|
|
860
|
-
const clearCalls = getMockConn(ctx).callsFor("Storage.clearCookies");
|
|
861
|
-
(0, vitest_1.expect)(clearCalls).toHaveLength(1);
|
|
862
|
-
});
|
|
863
|
-
(0, vitest_1.it)("clears and re-adds only non-matching cookies (path filter)", async () => {
|
|
864
|
-
const ctx = makeContext({
|
|
865
|
-
"Storage.getCookies": () => ({ cookies: [...cdpCookies] }),
|
|
866
|
-
"Storage.clearCookies": () => ({}),
|
|
867
|
-
"Storage.setCookies": () => ({}),
|
|
868
|
-
});
|
|
869
|
-
await ctx.clearCookies({ path: "/settings" });
|
|
870
|
-
const clearCalls = getMockConn(ctx).callsFor("Storage.clearCookies");
|
|
871
|
-
(0, vitest_1.expect)(clearCalls).toHaveLength(1);
|
|
872
|
-
const setCalls = getMockConn(ctx).callsFor("Storage.setCookies");
|
|
873
|
-
(0, vitest_1.expect)(setCalls).toHaveLength(1);
|
|
874
|
-
const kept = (setCalls[0].params?.cookies).map((c) => c.name);
|
|
875
|
-
(0, vitest_1.expect)(kept).toEqual(["session", "_ga"]);
|
|
876
|
-
(0, vitest_1.expect)(kept).not.toContain("pref");
|
|
877
|
-
});
|
|
878
|
-
(0, vitest_1.it)("throws when Storage.getCookies fails during filtered clear", async () => {
|
|
879
|
-
const ctx = makeContext({
|
|
880
|
-
"Storage.getCookies": () => {
|
|
881
|
-
throw new Error("CDP getCookies failure");
|
|
882
|
-
},
|
|
883
|
-
"Storage.clearCookies": () => ({}),
|
|
884
|
-
"Storage.setCookies": () => ({}),
|
|
885
|
-
});
|
|
886
|
-
await (0, vitest_1.expect)(ctx.clearCookies({ name: "session" })).rejects.toThrow(/CDP getCookies failure/);
|
|
887
|
-
// clearCookies and setCookies should never have been called
|
|
888
|
-
const clearCalls = getMockConn(ctx).callsFor("Storage.clearCookies");
|
|
889
|
-
(0, vitest_1.expect)(clearCalls).toHaveLength(0);
|
|
890
|
-
const setCalls = getMockConn(ctx).callsFor("Storage.setCookies");
|
|
891
|
-
(0, vitest_1.expect)(setCalls).toHaveLength(0);
|
|
892
|
-
});
|
|
893
|
-
(0, vitest_1.it)("throws when Storage.clearCookies fails during filtered clear", async () => {
|
|
894
|
-
const ctx = makeContext({
|
|
895
|
-
"Storage.getCookies": () => ({ cookies: [...cdpCookies] }),
|
|
896
|
-
"Storage.clearCookies": () => {
|
|
897
|
-
throw new Error("CDP clearCookies failure");
|
|
898
|
-
},
|
|
899
|
-
"Storage.setCookies": () => ({}),
|
|
900
|
-
});
|
|
901
|
-
await (0, vitest_1.expect)(ctx.clearCookies({ name: "session" })).rejects.toThrow(/CDP clearCookies failure/);
|
|
902
|
-
// setCookies should never have been called — cookies are untouched
|
|
903
|
-
const setCalls = getMockConn(ctx).callsFor("Storage.setCookies");
|
|
904
|
-
(0, vitest_1.expect)(setCalls).toHaveLength(0);
|
|
905
|
-
});
|
|
906
|
-
(0, vitest_1.it)("throws when Storage.setCookies fails during re-add, cookies are already wiped", async () => {
|
|
907
|
-
const ctx = makeContext({
|
|
908
|
-
"Storage.getCookies": () => ({ cookies: [...cdpCookies] }),
|
|
909
|
-
"Storage.clearCookies": () => ({}),
|
|
910
|
-
"Storage.setCookies": () => {
|
|
911
|
-
throw new Error("CDP setCookies failure");
|
|
912
|
-
},
|
|
913
|
-
});
|
|
914
|
-
await (0, vitest_1.expect)(ctx.clearCookies({ name: "session" })).rejects.toThrow(/cookie jar is now empty/);
|
|
915
|
-
// clearCookies WAS called — cookies are gone
|
|
916
|
-
const clearCalls = getMockConn(ctx).callsFor("Storage.clearCookies");
|
|
917
|
-
(0, vitest_1.expect)(clearCalls).toHaveLength(1);
|
|
918
|
-
});
|
|
919
|
-
});
|
|
920
|
-
(0, vitest_1.describe)("cookies() sameSite mapping", () => {
|
|
921
|
-
(0, vitest_1.it)("passes through valid sameSite values as-is", async () => {
|
|
922
|
-
for (const sameSite of ["Strict", "Lax", "None"]) {
|
|
923
|
-
const cdpCookie = { ...toCdpCookie(makeCookie()), sameSite };
|
|
924
|
-
const ctx = makeContext({
|
|
925
|
-
"Storage.getCookies": () => ({ cookies: [cdpCookie] }),
|
|
926
|
-
});
|
|
927
|
-
const result = await ctx.cookies();
|
|
928
|
-
(0, vitest_1.expect)(result[0].sameSite).toBe(sameSite);
|
|
929
|
-
}
|
|
930
|
-
});
|
|
931
|
-
(0, vitest_1.it)("does not normalize lowercase sameSite values from CDP", async () => {
|
|
932
|
-
// CDP may return lowercase values; the current implementation casts
|
|
933
|
-
// without normalizing, so "none" passes through as-is.
|
|
934
|
-
const cdpCookie = { ...toCdpCookie(makeCookie()), sameSite: "none" };
|
|
935
|
-
const ctx = makeContext({
|
|
936
|
-
"Storage.getCookies": () => ({ cookies: [cdpCookie] }),
|
|
937
|
-
});
|
|
938
|
-
const result = await ctx.cookies();
|
|
939
|
-
// This documents the current behavior: lowercase is NOT normalized.
|
|
940
|
-
(0, vitest_1.expect)(result[0].sameSite).toBe("none");
|
|
941
|
-
});
|
|
942
|
-
});
|
|
943
|
-
});
|
|
944
|
-
//# sourceMappingURL=cookies.test.js.map
|