MCPcopy
hub / github.com/codeceptjs/CodeceptJS / swipe

Method swipe

lib/helper/Appium.js:1122–1130  ·  view source on GitHub ↗

* Perform a swipe on the screen or an element. * * ```js * let locator = "#io.selendroid.testapp:id/LinearLayout1"; * I.swipe(locator, 800, 1200, 1000); * ``` * * [See complete reference](http://webdriver.io/api/mobile/swipe.html) * * @param {CodeceptJS.LocatorOrString} lo

(locator, xoffset, yoffset, speed = 1000)

Source from the content-addressed store, hash-verified

1120 */
1121
1122 async swipe(locator, xoffset, yoffset, speed = 1000) {
1123 onlyForApps.call(this)
1124 const res = await this.browser.$(parseLocator.call(this, locator))
1125 // if (!res.length) throw new ElementNotFound(locator, 'was not found in UI');
1126 return this.performSwipe(await res.getLocation(), {
1127 x: (await res.getLocation()).x + xoffset,
1128 y: (await res.getLocation()).y + yoffset,
1129 })
1130 }
1131
1132 /**
1133 * Perform a swipe on the screen.

Callers 5

swipeDownMethod · 0.95
swipeLeftMethod · 0.95
swipeRightMethod · 0.95
swipeUpMethod · 0.95
Appium_test.jsFile · 0.80

Calls 2

performSwipeMethod · 0.95
$Method · 0.80

Tested by

no test coverage detected