import { ClientFunction, Selector } from 'testcafe'; const scrollIntoView = ClientFunction( (selector: Selector) => { const element = selector() as unknown as HTMLElement; element.scrollIntoView(); }); fixture`HTMLElement` .page('https://example.com'); test('Scroll element into view', async t => { const bottomOfPage = Selector('#bottom-div'); await scrollIntoView(bottomOfPage);