Created
March 14, 2018 09:48
-
-
Save TuHuynhVan/a4c3aaa7e17d1702a0891d6465af0992 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
class Swipe { | |
static swipeRight(selector) { | |
if (!selector) { | |
browser.touchAction([{action: 'press', x: 0, y: 100}, {action: 'moveTo', x: 200, y: 100}, 'release']); | |
} else { | |
let startX = $(selector).getLocation().x; | |
let endX = startX + 200; | |
let y = $(selector).getLocation().y; | |
browser.touchAction([{action: 'press', x: startX, y: y}, {action: 'moveTo', x: endX, y: y}, 'release']); | |
} | |
} | |
} | |
module.exports = Swipe; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment