Skip to content

Commit

Permalink
Update click.js for relative selectors
Browse files Browse the repository at this point in the history
If a Relative Selector is passed in as the third argument inside of click(), it doesn't actually make it down to waitAndGetActionableElement. 

 We found that `await click(element, options, within(withinElement))`  doesn't search in the "within" element
  • Loading branch information
DCoomer authored Dec 20, 2024
1 parent 6645c6d commit 4d475f0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/actions/click.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ async function simulateInputEvents(options) {
}

async function click(selector, options = {}, ...args) {
let allOptions = options;
let allOptions = args;
if (options instanceof RelativeSearchElement) {
allOptions = [options].concat(args);
}
const clickOptions = setClickOptions(allOptions);
const clickOptions = setClickOptions(options);
clickOptions.noOfClicks = clickOptions.clickCount || 1;

if (isSelector(selector) || isString(selector) || isElement(selector)) {
Expand Down

0 comments on commit 4d475f0

Please sign in to comment.