{"name":"@wdio/browser-runner","version":"9.2.2","keywords":["webdriver","webdriverio","wdio","wdio-runner"],"author":"Christian Bromann <mail@bromann.dev>","license":"MIT","_id":"@wdio/browser-runner@9.2.2","maintainers":[{"name":"christian-bromann","email":"mail@bromann.dev"},{"name":"wdio-user","email":"bot@webdriver.io"},{"name":"wswebcreation-nl","email":"wim@wswebcreation.nl"}],"homepage":"https://github.com/webdriverio/webdriverio/tree/main/packages/wdio-browser-runner","bugs":{"url":"https://github.com/webdriverio/webdriverio/issues"},"dist":{"shasum":"0b9eafd7053b71c1e9d4b46a6781368c9d600bea","tarball":"http://registry-npm.ywwl.com/@wdio/browser-runner/download/@wdio/browser-runner-9.2.2.tgz","fileCount":67,"integrity":"sha512-ouy4mYDIX6HKZgdAkjNqa39Mn1oqsKuifH2b/eFm93G69+4+qf92x67AmKlB38mhaoCMFv6RIeMe5uxAKZDINQ==","signatures":[{"sig":"MEUCIHzgAwGDfx0/rrfKJZfqFggkHwMNtDE2xenwZz/nAve0AiEAwdZWDC8bvtoBWBsf3LeQ5wVUYU2rYdhDP/WdpK7GHXY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":833522,"size":210457,"noattachment":false,"key":"/@wdio/browser-runner/-/@wdio/browser-runner-9.2.2.tgz"},"type":"module","types":"./build/index.d.ts","engines":{"node":">=18.20.0"},"exports":{".":{"types":"./build/index.d.ts","import":"./build/index.js"},"./spy":{"types":"./build/browser/spy.d.ts","browser":"./build/browser/spy.js","browserSource":"./src/browser/spy.ts"},"./mock":{"types":"./build/browser/mock.d.ts","browser":"./build/browser/mock.js","browserSource":"./src/browser/mock.ts"},"./setup":{"types":"./build/browser/setup.d.ts","browser":"./build/browser/setup.js","browserSource":"./src/browser/setup.ts"},"./driver":{"types":"./build/browser/driver.d.ts","browser":"./build/browser/driver.js","browserSource":"./src/browser/driver.ts"},"./expect":{"types":"./build/browser/expect.d.ts","browser":"./build/browser/expect.js","browserSource":"./src/browser/expect.ts"},"./stencil":{"types":"./build/browser/integrations/stencil.d.ts","import":"./build/browser/integrations/stencil.js","importSource":"./src/browser/integrations/stencil.ts"}},"gitHead":"a82feee9b819e978b0d75dc899dd8284303935e1","scripts":{"build":"mkdir ./build/third_party && cp ./node_modules/mocha/mocha.css ./build/third_party/mocha.css && cp ./node_modules/mocha/mocha.js ./build/third_party/mocha.js"},"_npmUser":{"name":"wdio-user","email":"bot@webdriver.io"},"repository":{"url":"git+https://github.com/webdriverio/webdriverio.git","type":"git","directory":"packages/wdio-browser-runner"},"_npmVersion":"lerna/8.1.8/node@v20.11.1+x64 (linux)","description":"A WebdriverIO runner to run unit tests tests in the browser.","directories":{},"_nodeVersion":"20.11.1","dependencies":{"mlly":"^1.6.1","vite":"~5.4.0","expect":"30.0.0-alpha.6","recast":"^0.23.6","get-port":"^7.1.0","@vitest/spy":"^2.0.4","@wdio/logger":"9.1.3","deepmerge-ts":"^7.0.3","safe-stringify":"^1.1.0","@wdio/protocols":"9.2.2","istanbul-reports":"^3.1.7","@wdio/local-runner":"9.2.2","expect-webdriverio":"^5.0.1","source-map-support":"^0.5.21","import-meta-resolve":"^4.0.0","istanbul-lib-report":"^3.0.1","vite-plugin-istanbul":"^6.0.0","istanbul-lib-coverage":"^3.2.2","modern-node-polyfills":"^1.0.0","istanbul-lib-source-maps":"^5.0.4","vite-plugin-top-level-await":"^1.4.1","@originjs/vite-plugin-commonjs":"^1.0.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"mocha":"^10.7.3","esbuild":"^0.24.0","geckodriver":"^4.4.4","@types/istanbul-reports":"^3.0.4","@types/istanbul-lib-report":"^3.0.3","@types/istanbul-lib-coverage":"^2.0.6","@types/istanbul-lib-source-maps":"^4.0.4"},"peerDependencies":{"webdriver":"workspace:*","@wdio/types":"workspace:*","@wdio/utils":"workspace:*","webdriverio":"workspace:*","@wdio/runner":"workspace:*","@wdio/globals":"workspace:*","@wdio/mocha-framework":"workspace:*"},"typeScriptVersion":"3.8.3","optionalDependencies":{"unimport":"^3.10.0","@nuxt/kit":"^3.12.4","@stencil/core":"^4.20.0"},"peerDependenciesMeta":{"webdriver":{"optional":false},"@wdio/types":{"optional":true},"@wdio/runner":{"optional":false},"@wdio/globals":{"optional":true},"@wdio/webdriverio":{"optional":false},"@wdio/mocha-framework":{"optional":false}},"_npmOperationalInternal":{"tmp":"tmp/browser-runner_9.2.2_1730102461602_0.3212987769713771","host":"s3://npm-registry-packages"},"readme":"WebdriverIO Browser Runner\n==========================\n\n> A WebdriverIO runner to run unit and component tests within the browser.\n\nAs opposed to the [Local Runner](https://www.npmjs.com/package/@wdio/local-runner) the [Browser Runner](https://www.npmjs.com/package/@wdio/browser-runner) initiates and executes the framework within the browser. This allows you to run unit tests or component tests in an actual browser rather than in a JSDOM like many other test frameworks.\n\nWhile [JSDOM](https://www.npmjs.com/package/jsdom) is widely used for testing purposes, it is in the end not an actual browser nor can you emulate mobile environments with it. With this runner WebdriverIO enables you to easily run your tests in the browser and use WebDriver commands to interact with elements rendered on the page.\n\nHere is an overview of running tests within JSDOM vs. WebdriverIOs Browser Runner\n\n| | JSDOM | WebdriverIO Browser Runner |\n|-|-------|----------------------------|\n|1.| Runs your tests within Node.js using a re-implementation of web standards, notably the WHATWG DOM and HTML Standards | Executes your test in an actual browser and runs the code in an environment that your users use |\n|2.| Interactions with components can only be imitated via JavaScript | You can use the [WebdriverIO API](api) to interact with elements through the WebDriver protocol |\n|3.| Canvas support requires [additional dependencies](https://www.npmjs.com/package/canvas) and [has limitations](https://github.com/Automattic/node-canvas/issues) | You have access to the real [Canvas API](https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API) |\n|4.| JSDOM has some [caveats](https://github.com/jsdom/jsdom#caveats) and unsupported Web APIs | All Web APIs are supported as test run in an actual browser |\n|5.| Impossible to detect errors cross browser | Support for all browsers including mobile browser |\n|6.| Can __not__ test for element pseudo states | Support for pseudo states such as `:hover` or `:active` |\n\nThis runner uses [Vite](https://vitejs.dev/) to compile your test code and load it in the browser. It comes with presets for the following component frameworks:\n\n- React\n- Preact\n- Vue.js\n- Svelte\n- SolidJS\n\nEvery test file / test file group runs within a single page which means that between each test the page is being reloaded to guarantee isolation between tests.\n\n### Install\n\nTo use the Browser Runner you can install it via:\n\n```sh\nnpm install --save-dev @wdio/browser-runner\n```\n\n### Setup\n\nTo use the Browser runner, you have to define a `runner` property within your `wdio.conf.js` file, e.g.:\n\n```js\n// wdio.conf.js\nexport const {\n    // ...\n    runner: 'browser',\n    // ...\n}\n```\n\n### Runner Options\n\nThe Browser runner allows following configurations:\n\n#### `preset`\n\nIf you test components using one of the mentioned frameworks above, you can define a preset that ensures everything is configured out of the box. This option can't be used together with `viteConfig`.\n\n__Type:__ `vue` | `svelte` | `solid` | `react` | `preact` | `stencil`<br />\n__Example:__\n\n```js title=\"wdio.conf.js\"\nexport const {\n    // ...\n    runner: ['browser', {\n        preset: 'svelte'\n    }],\n    // ...\n}\n```\n\n#### `viteConfig`\n\nDefine your own [Vite configuration](https://vitejs.dev/config/). You can either pass in a custom object or import an existing `vite.conf.ts` file if you use Vite.js for development. Note that WebdriverIO merges custom configurations to set up framework and runner objects. This option can't be used together with `preset`.\n\n__Type:__ [`UserConfig`](https://github.com/vitejs/vite/blob/52e64eb43287d241f3fd547c332e16bd9e301e95/packages/vite/src/node/config.ts#L119-L272)<br />\n__Example:__\n\n```js title=\"wdio.conf.ts\"\nimport viteConfig from '../vite.config.ts'\n\nexport const {\n    // ...\n    runner: ['browser', { viteConfig }],\n    // ...\n}\n```\n\n#### `headless`\n\nIf set to `true` the runner will update capabilities to run tests headless. By default this is enabled within CI environments where a `CI` environment variable is set to `'1'` or `'true'`.\n\n__Type:__ `boolean`<br />\n__Default:__ `false`, set to `true` if `CI` environment variable is set\n\n#### `rootDir`\n\nProject root directory.\n\n__Type:__ `string`<br />\n__Default:__ `process.cwd()`\n\n#### `coverage`\n\nWebdriverIO supports test coverage reporting through [`istanbul`](https://istanbul.js.org/). See [Coverage Options](#coverage-options) for more details.\n\n__Type:__ `object`<br />\n__Default:__ `undefined`\n\n### Coverage Options\n\nThe following options allow to configure coverage reporting.\n\n#### `enabled`\n\nEnables coverage collection.\n\n__Type:__ `boolean`<br />\n__Default:__ `false`\n\n#### `include`\n\nList of files included in coverage as glob patterns.\n\n__Type:__ `string[]`<br />\n__Default:__ `[**]`\n\n#### `exclude`\n\nList of files excluded in coverage as glob patterns.\n\n__Type:__ `string[]`<br />\n__Default:__\n\n```\n[\n  'coverage/**',\n  'dist/**',\n  'packages/*/test{,s}/**',\n  '**/*.d.ts',\n  'cypress/**',\n  'test{,s}/**',\n  'test{,-*}.{js,cjs,mjs,ts,tsx,jsx}',\n  '**/*{.,-}test.{js,cjs,mjs,ts,tsx,jsx}',\n  '**/*{.,-}spec.{js,cjs,mjs,ts,tsx,jsx}',\n  '**/__tests__/**',\n  '**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build}.config.*',\n  '**/.{eslint,mocha,prettier}rc.{js,cjs,yml}',\n]\n```\n\n#### `extension`\n\nList of file extensions the report should include.\n\n__Type:__ `string | string[]`<br />\n__Default:__ `['.js', '.cjs', '.mjs', '.ts', '.mts', '.cts', '.tsx', '.jsx', '.vue', '.svelte']`\n\n#### `reportsDirectory`\n\nDirectory to write coverage report to.\n\n__Type:__ `string`<br />\n__Default:__ `./coverage`\n\n#### `reporter`\n\nCoverage reporters to use. See [istanbul documentation](https://istanbul.js.org/docs/advanced/alternative-reporters/) for detailed list of all reporters.\n\n__Type:__ `string[]`<br />\n__Default:__ `['text', 'html', 'clover', 'json-summary']`\n\n#### `perFile`\n\nCheck thresholds per file. See `lines`, `functions`, `branches` and `statements` for the actual thresholds.\n\n__Type:__ `boolean`<br />\n__Default:__ `false`\n\n#### `clean`\n\nClean coverage results before running tests.\n\n__Type:__ `boolean`<br />\n__Default:__ `true`\n\n#### `lines`\n\nThreshold for lines.\n\n__Type:__ `number`<br />\n__Default:__ `undefined`\n\n#### `functions`\n\nThreshold for functions.\n\n__Type:__ `number`<br />\n__Default:__ `undefined`\n\n#### `branches`\n\nThreshold for branches.\n\n__Type:__ `number`<br />\n__Default:__ `undefined`\n\n#### `statements`\n\nThreshold for statements.\n\n__Type:__ `number`<br />\n__Default:__ `undefined`\n\n### Examples\n\nMake sure to check out the docs around [component testing](https://webdriver.io/docs/component-testing) and have a look into the [example repository](https://github.com/webdriverio/component-testing-examples) for examples using these and various other frameworks.\n\n---\n\nFor more information on WebdriverIO runner, check out the [documentation](https://webdriver.io/docs/runner).\n","publish_time":1730102461830,"_cnpm_publish_time":1730102461830,"dist-tags":{"latest":"10.2.0","next":"10.2.0-alpha.100.sha-b38abd894","v8":"8.46.0","v9":"9.33.1"}}