garris / BackstopJS

Catch CSS curve balls.
http://backstopjs.org
MIT License
6.69k stars 604 forks source link

clickSelector only clicks first element found #1391

Open JelleBouwmans opened 2 years ago

JelleBouwmans commented 2 years ago

In clickAndHoverHelper.js the line await page.click(clickSelectorIndex); only clicks the first element found. It should click all elements found with the given selector.

Suggested fix: for (var element of document.querySelectorAll(clickSelectorIndex)) { element.click(); }

This might also be the case for page.hover() and page.type() (keypress)

JelleBouwmans commented 2 years ago

Created the following PR: https://github.com/garris/BackstopJS/pull/1392