garris / garris/BackstopJS

clickSelector only clicks first element found

Open
#1,391 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
7.2k
Forks
621
PR merge metrics
No merged PRs in 30d

Description

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)

Contributor guide

Open the contributing guide

Research direction

Start by reading clickAndHoverHelper.js at the page.click(clickSelectorIndex) call and trace how the selector is used. Verify the behavior for multiple matching elements, then check whether the same concern applies to page.hover() and page.type(). Done means the relevant actions consistently handle all elements matched by the given selector.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
testing
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.