Skip to content

Commit

Permalink
remove page.waitfor()
Browse files Browse the repository at this point in the history
  • Loading branch information
roshaanbajwa committed Mar 6, 2024
1 parent 047ccf1 commit 9e1a218
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/backstop/engine_scripts/puppet/clickAndHoverHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,24 @@ module.exports = async (page, scenario) => {

if (hoverSelector) {
for (const hoverSelectorIndex of [].concat(hoverSelector)) {
await page.waitFor(hoverSelectorIndex);
await page.waitForTimeout(hoverSelectorIndex);
await page.hover(hoverSelectorIndex);
}
}

if (clickSelector) {
for (const clickSelectorIndex of [].concat(clickSelector)) {
await page.waitFor(clickSelectorIndex);
await page.waitForTimeout(clickSelectorIndex);
await page.click(clickSelectorIndex);
}
}

if (postInteractionWait) {
await page.waitFor(postInteractionWait);
await page.waitForTimeout(postInteractionWait);
}

if (scrollToSelector) {
await page.waitFor(scrollToSelector);
await page.waitForTimeout(scrollToSelector);
await page.evaluate(scrollToSelector => {
document.querySelector(scrollToSelector).scrollIntoView();
}, scrollToSelector);
Expand Down

0 comments on commit 9e1a218

Please sign in to comment.