{"_id":"@wdio/session@10.2.0","bin":{"wdio-session":"bin/wdio-session.js"},"bugs":{"url":"https://github.com/webdriverio/webdriverio/issues"},"dist":{"shasum":"5e1c5f26238443249e0b6d256d51f60add9a5d15","tarball":"http://registry-npm.ywwl.com/@wdio/session/download/@wdio/session-10.2.0.tgz","fileCount":154,"integrity":"sha512-bI3JTbSTxuUpvl0toJ6x4LYiEi6onlvNw/hkZYPe7X6TB1iP+mxhvOwDTcH4Y9Dh8J4mdohkZoDPn4fMfhkHoQ==","signatures":[{"sig":"MEUCIQCVne9j7XvFxvRdLePgjKiz3p1hP+B/UvRjepY+3cvZfwIgOJ6jo5dcQe7fA4gJ5j4b5FxdEZIViOpRuPHFnOU6rnM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIDqTD2dau92BDexTvC4FTfLzvyiYOdku0gpDnCYmROtNAiEAqS1hcIhs9KQvtRIF0lKi+OyTQB7MLEsgOtJ4UzPvNC4="}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@wdio%2fsession@10.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":1541600,"size":407847,"noattachment":false,"key":"/@wdio/session/-/@wdio/session-10.2.0.tgz"},"name":"@wdio/session","type":"module","types":"./build/index.d.ts","author":{"name":"Christian Bromann","email":"mail@bromann.dev"},"engines":{"node":">=22.23.4 <23 || >=24.22.1 <25 || >=26.12.1"},"exports":{".":{"types":"./build/index.d.ts","import":"./build/index.js"},"./cli":{"types":"./build/cli.d.ts","import":"./build/cli.js","source":"./src/cli.ts"},"./agent":{"types":"./build/agent.d.ts","import":"./build/agent.js","source":"./src/agent.ts"},"./daemon":{"import":"./build/daemon.js","source":"./src/daemon/main.ts"},"./package.json":"./package.json"},"gitHead":"5743972ac11d3dd92de450347932722f95b4e030","license":"MIT","version":"10.2.0","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"627c91ac-103b-4373-a2ae-ddf63f5e0b7c"}},"homepage":"https://github.com/webdriverio/webdriverio/tree/main/packages/wdio-session","keywords":["webdriverio","wdio","session","cli","agent","automation"],"repository":{"url":"git+https://github.com/webdriverio/webdriverio.git","type":"git","directory":"packages/wdio-session"},"_npmVersion":"lerna/10.1.1/node@v24.22.2+x64 (linux)","description":"Drive browsers, mobile apps and desktop apps with WebdriverIO from the shell","directories":{},"maintainers":[{"name":"christian-bromann","email":"mail@bromann.dev"},{"name":"wdio-user","email":"bot@webdriver.io"},{"name":"wswebcreation-nl","email":"wim@wswebcreation.nl"}],"_nodeVersion":"24.22.2","dependencies":{"acorn":"^8.15.0","yargs":"^18.2.0","semver":"^7.7.4","get-port":"^7.1.0","picomatch":"^4.0.7","image-size":"^2.0.4","@types/node":"^22.20.4","@wdio/types":"10.2.0","@wdio/utils":"10.2.0","@wdio/config":"10.2.0","@wdio/logger":"10.2.0","@wdio/snapshot":"10.2.0","@wdio/display-server":"10.2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.23.15","appium":"^3.8.0","webdriverio":"10.2.0","@types/yargs":"^17.0.33","@types/semver":"^7.5.8","@types/picomatch":"^4.0.2","expect-webdriverio":"^8.0.0","@wdio/visual-service":"^11.0.0","@wdio/electron-service":"^10.4.1"},"peerDependencies":{"tsx":"*","appium":"^3.0.0","webdriverio":"^10.0.0","expect-webdriverio":"^8.0.0","@wdio/visual-service":"^10.0.0 || ^11.0.0","@wdio/electron-service":"*"},"typeScriptVersion":"6.0.3","peerDependenciesMeta":{"tsx":{"optional":true},"appium":{"optional":true},"webdriverio":{"optional":false},"expect-webdriverio":{"optional":true},"@wdio/visual-service":{"optional":true},"@wdio/electron-service":{"optional":true}},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/session_10.2.0_1793930710888_0.6844098896773301"},"readme":"WebdriverIO Session\n===================\n\n> Drive browsers, mobile apps and desktop apps with WebdriverIO from the shell.\n\n`wdio session` starts a WebdriverIO session that outlives the command that\ncreated it, so a coding agent (or a human) can automate an app with many short\nshell commands and turn what worked into a test.\n\n```sh\nnpx wdio session open chrome http://localhost:3000\nnpx wdio session snapshot\nnpx wdio session click e3\nnpx wdio session <<'JS'\nawait expect($('aria/Cart (1)')).toBeDisplayed()\nJS\nnpx wdio session export --out test/specs/cart.e2e.ts\nnpx wdio session close\n```\n\nThe command is part of `@wdio/cli`. `npx wdio` installs the unscoped\n[`wdio`](https://www.npmjs.com/package/wdio) package, which runs that CLI, so\nyou do not install `@wdio/session` or `@wdio/cli` first. For the full guide, see\n[webdriver.io/docs/session](https://webdriver.io/docs/session).\nCheck a machine with `npx wdio session doctor`. Agents install the skill with\n`npx wdio session skill --install .`.\n\n## Use the actions from code\n\nInstall `webdriverio` next to this package: it is a required peer dependency.\n\n`@wdio/session/agent` runs the same actions, snapshots and refs on a browser\nyour code already owns, for example in a test or a `remote()` script. There is\nno daemon. `dispose()` leaves the browser session open.\n\n> **Experimental:** the `@wdio/session/agent` API, the snapshot text and the\n> `RefEntry` fields `ref()` returns may change in a minor release. The ref\n> syntax (`e3`) and the code an action records stay stable.\n\n```ts\nimport { remote } from 'webdriverio'\nimport { createAgentSession } from '@wdio/session/agent'\n\nconst browser = await remote({ capabilities: { browserName: 'chrome' } })\nconst agent = await createAgentSession(browser, { captureEvents: true })\n\nawait browser.url('http://localhost:3000')\nconst { text } = await agent.snapshot({ interactive: true })\nconst { code } = await agent.run('click', { target: 'e3' })\nconsole.log(code) // await $('role/button[name=\"Add to cart\"]').click()\n\nawait agent.dispose()\nawait browser.deleteSession()\n```\n\n`run(action, args)` type-checks the action name and its arguments against the\naction specs: positionals and options are camelCased (`--max-chars` becomes\n`maxChars`) and a variadic positional is one string. A typo is a compile error.\nUse `runAction(name, args)` when the name is only known at runtime, for example\nfrom a recorded step. It takes untyped arguments.\n\n`snapshot(opts)` returns an `AgentSnapshot`: `text`, the `tree`, and the\n`lines`, `refs` and `chars` counts, plus `page` and `notes` when there are any.\n`maxChars` caps the size. Above it `tooBig` is `true` and `text` is a summary.\nIt writes no file and works for app (Appium) sessions too.\n\nAction results carry structured fields next to `text` and `code`:\n\n- `changes`: what the page shows after the action, a `PageChange` of kind\n  `page` (a navigation or new frame), `changed` (added elements) or `removed`.\n- `noVisibleChange`: `true` after a click or tap that changed nothing.\n- `page` and `notes`: the URL and title, and load-error or bot-check notes.\n- `data`: typed per action, for example `get` gives `{ text, value, ... }`.\n\nHints in the output name `wdio session` commands. The `hint` option rewrites\nthem for your own tools. Return `undefined` to keep the CLI text:\n\n```ts\nconst tools: Record<string, string> = { snapshot: 'page_snapshot', click: 'page_click' }\nconst agent = await createAgentSession(browser, {\n    hint: (command) => (tools[command] ? `${tools[command]}()` : undefined)\n})\n```\n\nFailures throw `SessionError`, with a `code` of type `ErrorCode`. Both are\nexported from `@wdio/session/agent`.\n\n`tsx` and `expect-webdriverio` are optional peer dependencies. `expect` inside\n`exec` needs `expect-webdriverio` installed in your project. TypeScript configs\nload without `tsx` through Node type stripping or jiti.\n","publish_time":1793930711079,"_cnpm_publish_time":1793930711079,"dist-tags":{"latest":"10.2.0","next":"10.2.0-alpha.100.sha-b38abd894"}}