webdriver-actions
Backwards-compatible W3C WebDriver Actions API commands.
Important: This is still a WIP. Most actions are not implemented yet.
As of December 2017 the Actions API is only implemented in geckodriver.
This module takes a series of Actions API compatible actions and transforms them to backwards-compatible WebDriver commands that work with current versions of chromedriver and safaridriver - where possible.
This should become obsolete as soon as all modern browser web-drivers support the Actions API.
You can track chromedriver's progress here.
Usage
$ npm i --save webdriver-actions
const WebdriverActions = // - 1st argument, an object containing W3C Actions// - 2nd argument, the active element ID - will be used to dispatch keyboard// valuesconst commands = WebdriverActions console /*[ { "url": "element/foo-active-element-id/value", "data": { "type": "keyDown", "value": "" } }, { "url": "element/foo-active-element-id/value", "data": { "type": "keyUp", "value": "" } }, { "url": "moveto", "data": { "type": "pointerMove", "duration": 0, "x": 100, "y": 100, "xoffset": 100, "yoffset": 100 } }, { "url": "buttonup", "data": { "type": "pointerUp", "button": 0 } }, { "url": "buttondown", "data": { "type": "pointerDown", "button": 0 } }]*/
Test
npm test
Authors
License
MIT