Skip to content

Commit

Permalink
feat: Add support for delays between visual test scenarios (#67)
Browse files Browse the repository at this point in the history
  • Loading branch information
brankol authored Nov 15, 2022
1 parent cbb5a3f commit de8e6b0
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions resources/Visual/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,14 @@ module.exports = async (page, scenario) => {

if (clickSelector) {
for (const clickSelectorIndex of [].concat(clickSelector)) {
await page.waitForSelector(clickSelectorIndex);
await page.click(clickSelectorIndex);
if (typeof clickSelectorIndex === 'object') {
if (typeof clickSelectorIndex.waitFor === 'number') {
await page.waitForTimeout(clickSelectorIndex.waitFor);
}
} else {
await page.waitForSelector(clickSelectorIndex);
await page.click(clickSelectorIndex);
}
}
}

Expand Down

0 comments on commit de8e6b0

Please sign in to comment.