* {{> dragSlider }}
(locator, offsetX = 0)
| 2156 | * {{> dragSlider }} |
| 2157 | */ |
| 2158 | async dragSlider(locator, offsetX = 0) { |
| 2159 | const src = await this._locate(locator) |
| 2160 | assertElementExists(src, locator, 'Slider Element') |
| 2161 | |
| 2162 | // Note: Using public api .getClickablePoint because the .BoundingBox does not take into account iframe offsets |
| 2163 | const sliderSource = await getClickablePoint(src[0]) |
| 2164 | |
| 2165 | // Drag start point |
| 2166 | await this.page.mouse.move(sliderSource.x, sliderSource.y, { steps: 5 }) |
| 2167 | await this.page.mouse.down() |
| 2168 | |
| 2169 | // Drag destination |
| 2170 | await this.page.mouse.move(sliderSource.x + offsetX, sliderSource.y, { steps: 5 }) |
| 2171 | await this.page.mouse.up() |
| 2172 | |
| 2173 | await this._waitForAction() |
| 2174 | } |
| 2175 | |
| 2176 | /** |
| 2177 | * {{> grabAttributeFromAll }} |
no test coverage detected