diff --git a/lib/actions/click.js b/lib/actions/click.js index abe9be828..1d0baad8b 100644 --- a/lib/actions/click.js +++ b/lib/actions/click.js @@ -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)) { diff --git a/test/unit-tests/click.test.js b/test/unit-tests/click.test.js index 39f415f20..94b9b1ffd 100644 --- a/test/unit-tests/click.test.js +++ b/test/unit-tests/click.test.js @@ -48,6 +48,7 @@ describe(test_name, () => {

Click with proximity + Click with proximity and options object
Text accross elements
@@ -154,6 +155,21 @@ describe(test_name, () => { }); }); + describe("With proximity selector and options object", () => { + it("should click", async () => { + await click( + "Click with proximity and options object", + { waitForNavigation: true }, + below("Proximity marker"), + ); + expect( + await text( + "Click works with proximity selector and options object.", + ).exists(), + ).to.be.true; + }); + }); + describe("Text accross element", () => { it("should click", async () => { await click("Text accross elements");