* {{> dragSlider }}
(locator, offsetX = 0)
| 2357 | * {{> dragSlider }} |
| 2358 | */ |
| 2359 | async dragSlider(locator, offsetX = 0) { |
| 2360 | const browser = this.browser |
| 2361 | await this.moveCursorTo(locator) |
| 2362 | |
| 2363 | // for chrome |
| 2364 | if (browser.isW3C) { |
| 2365 | const xOffset = await this.grabElementBoundingRect(locator, 'x') |
| 2366 | const yOffset = await this.grabElementBoundingRect(locator, 'y') |
| 2367 | |
| 2368 | return browser.performActions([ |
| 2369 | { |
| 2370 | type: 'pointer', |
| 2371 | id: 'pointer1', |
| 2372 | parameters: { pointerType: 'mouse' }, |
| 2373 | actions: [ |
| 2374 | { |
| 2375 | type: 'pointerMove', |
| 2376 | origin: 'pointer', |
| 2377 | duration: 1000, |
| 2378 | x: xOffset, |
| 2379 | y: yOffset, |
| 2380 | }, |
| 2381 | { type: 'pointerDown', button: 0 }, |
| 2382 | { |
| 2383 | type: 'pointerMove', |
| 2384 | origin: 'pointer', |
| 2385 | duration: 1000, |
| 2386 | x: offsetX, |
| 2387 | y: 0, |
| 2388 | }, |
| 2389 | { type: 'pointerUp', button: 0 }, |
| 2390 | ], |
| 2391 | }, |
| 2392 | ]) |
| 2393 | } |
| 2394 | |
| 2395 | await browser.buttonDown(0) |
| 2396 | await browser.moveToElement(null, offsetX, 0) |
| 2397 | await browser.buttonUp(0) |
| 2398 | } |
| 2399 | |
| 2400 | /** |
| 2401 | * {{> grabAllWindowHandles }} |
nothing calls this directly
no test coverage detected