Skip to content

Commit

Permalink
Update Backstop scripts after removal of deprecated waitFor()
Browse files Browse the repository at this point in the history
For context garris/BackstopJS#1441 which says we need to maintain this ourselves
  • Loading branch information
giorgiosironi committed Nov 8, 2022
1 parent 92208cc commit c240c24
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions backstop_data/engine_scripts/puppet/clickAndHoverHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,31 @@ module.exports = async (page, scenario) => {

if (keyPressSelector) {
for (const keyPressSelectorItem of [].concat(keyPressSelector)) {
await page.waitFor(keyPressSelectorItem.selector);
await page.waitForSelector(keyPressSelectorItem.selector);
await page.type(keyPressSelectorItem.selector, keyPressSelectorItem.keyPress);
}
}

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

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

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

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

0 comments on commit c240c24

Please sign in to comment.