webdriverio
Version:
Next-gen browser and mobile automation test framework for Node.js
25 lines (24 loc) • 894 B
TypeScript
/**
*
* Scroll within the browser viewport. Note that `x` and `y` coordinates are relative to the current
* scroll positon, therefore `browser.scroll(0, 0)` is a non operation.
*
* <example>
:scroll.js
it('should demonstrate the scroll command', async () => {
await browser.url('https://webdriver.io')
console.log(await browser.execute(() => window.scrollY)) // returns 0
await browser.scroll(0, 200)
console.log(await browser.execute(() => window.scrollY)) // returns 200
});
* </example>
*
* @alias element.scroll
* @param {number} [x=0] horizontal scroll position (default: `0`)
* @param {number} [y=0] vertical scroll position (default: `0`)
* @uses protocol/execute
* @type utility
*
*/
export declare function scroll(this: WebdriverIO.Browser, x?: number, y?: number): void | Promise<void>;
//# sourceMappingURL=scroll.d.ts.map