This service installs all legacy JSON Wire Protocol to your browser instance in cases you still need to run tests on environments that don't support WebDriver.
You can install this package via:
npm install @wdio/jsonwp-service
In your wdio.conf.ts
or wdio.conf.js
add this service to the list of services:
// wdio.conf.ts
export const config: WebdriverIO.Config = {
// ...
services: ['jsonwp']
// ...
}
Once set up as described, you have access to all JSON Wire Protocol commands, e.g.:
import { browser } from '@wdio/globals'
describe('my test suite', () => {
it('can call JSONWP commands', async () => {
// call JSONWP command
await browser.buttonUp()
})
})
If you are using WebdriverIO as a standalone package you can use this service by integrating this service as following:
import { remote } from 'webdriverio'
import JSONWPService from '@wdio/jsonwp-service'
const browser = await remote({ ... })
const jsonwp = new JSONWPService()
jsonwp.before(undefined, undefined, browser)
// call JSONWP command
await browser.buttonUp()
For more information on WebdriverIO see the homepage.