Expanding the click method wrapper
We are now ready to add our clickAdv()
wrapper method. We will have a pageSync()
method execute after every click to build in the flexible timing while we wait for the page to complete:
export async function clickAdv( element: ChainablePromiseElement<WebdriverIO.Element>) { let success: boolean = false; const SELECTOR = await element.selector; log(`Clicking ${SELECTOR}`); try { //await element.waitForDisplayed(); if (!await isElementInViewport(element)){ await element.scrollIntoView({ block: "center", inline: "center" }); await waitForElementToStopMoving(element) } await highlightOn(element); await element.click({ block: "center" }); await...