@wdio/devtools-service
Version:
Hook up WebdriverIO with DevTools
49 lines (33 loc) • 1.05 kB
Markdown
Hook your WebdriverIO project up with Devtools capabilities.
You can install the package via:
```sh
npm install @devtools/hook
```
You can collect WebdriverIO trace data within standalone or testrunner environments. Read more on these different modes in the [docs](https://webdriver.io/docs/setuptypes#standalone-mode).
When initiating a standalone WebdriverIO session, just wrap the `remote` call with the `setupForDevtools` exported by the package as follows:
```ts
import { remote } from 'webdriverio'
import { setupForDevtools } from '@wdio/devtools-service'
const browser = await remote(setupForDevtools({
capabilities: {
browserName: 'chrome',
browserVersion: 'latest'
}
}))
// call commands
// ...
await browser.deleteSession()
```
To integrate WebdriverIO Devtools in your test runner, just add this service to your `wdio.conf.js` as follows:
```ts
export const config: WebdriverIO.Config = {
// ...
services: ['devtools']
// ...
}
```