@wdio/jsonwp-service
v0.1.0
Published
A WebdriverIO service that enables JSONWireProtocol commands for your session.
Downloads
28
Readme
WDIO JSONWP Service
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.
Installing
You can install this package via:
npm install @wdio/jsonwp-service
Configuration
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']
// ...
}
Usage
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()
})
})
Standalone
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.