Created
November 9, 2017 14:02
-
-
Save christian-bromann/01ed768b00f5d82cd9f91fac54b82544 to your computer and use it in GitHub Desktop.
Actions API demo using WebdriverIO in standalone mode
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(async function () { | |
const webdriverio = require('webdriverio') | |
const browser = webdriverio.remote({ | |
path: '/', | |
desiredCapabilities: { | |
browserName: 'firefox' | |
} | |
}) | |
await browser.init() | |
await browser.url('http://webdriverio.christian-bromann.com/draw.html') | |
await browser.actions([{ | |
"type": "pointer", | |
"id": "finger1", | |
"actions": [ | |
{"type": "pointerMove", "duration": 0, "x": 300, "y": 100}, | |
{"type": "pointerDown", "button": 0}, | |
{"type": "pause", "duration": 500}, | |
{"type": "pointerMove", "duration": 1000, "origin": "pointer", "x": 0, "y": 400}, | |
{"type": "pointerUp", "button": 0} | |
] | |
}]) | |
await browser.actions([{ | |
"type": "pointer", | |
"id": "finger2", | |
"actions": [ | |
{"type": "pointerMove", "duration": 0, "x": 100, "y": 300}, | |
{"type": "pointerDown", "button": 0}, | |
{"type": "pause", "duration": 500}, | |
{"type": "pointerMove", "duration": 1000, "origin": "pointer", "x": 400, "y": 0}, | |
{"type": "pointerUp", "button": 0} | |
] | |
}]) | |
await browser.end() | |
})() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is using Firefox