nightwatch-commands
nightwatch-commands copied to clipboard
Add a swipe command
We really need a swipe command to test gestures on page elements (swipe through carousels, etc).
Potential arguments could include:
- Origin point (be it specified through CSS selector or pixel position)
- Direction to swipe
- How many pixels to swipe before touch release
- A perpendicular variation factor to include in the swipe gesture (No one can swipe perfectly straight. This could be a pixel factor that 'fudges' the swipe to make it realistic)
possible JSON wire protocol commands to develop off of include: https://code.google.com/p/selenium/wiki/JsonWireProtocol#POST_session/:sessionId/touch/move https://code.google.com/p/selenium/wiki/JsonWireProtocol#POST_session/:sessionId/touch/scroll https://code.google.com/p/selenium/wiki/JsonWireProtocol#POST_session/:sessionId/touch/flick
The swipe event has still not been included in the protocol.
https://github.com/industral/nightwatch/compare/master...touch