From 080daedec1105b0acc866ee646d312acdd2954a8 Mon Sep 17 00:00:00 2001 From: DCoomer Date: Fri, 20 Dec 2024 11:51:43 -0500 Subject: [PATCH 1/7] Update click.js for relative selectors 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 Signed-off-by: DCoomer --- lib/actions/click.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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)) { From d5570ac49f1748275a4503f7b1a3157dc11ad617 Mon Sep 17 00:00:00 2001 From: DCoomer <20802896+DCoomer@users.noreply.github.com> Date: Thu, 26 Dec 2024 10:33:58 -0500 Subject: [PATCH 2/7] Updated Unit Test for https://github.com/getgauge/taiko/pull/2747 Signed-off-by: DCoomer <20802896+DCoomer@users.noreply.github.com> --- test/unit-tests/click.test.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/unit-tests/click.test.js b/test/unit-tests/click.test.js index 39f415f20..6eee96b0a 100644 --- a/test/unit-tests/click.test.js +++ b/test/unit-tests/click.test.js @@ -154,6 +154,14 @@ describe(test_name, () => { }); }); + describe("With proximity selector and Options Object", () => { + it("should click", async () => { + await click("Click with proximity", {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"); From 617b982bf32c2c1170d74512a097e16a7aa6004c Mon Sep 17 00:00:00 2001 From: DCoomer <20802896+DCoomer@users.noreply.github.com> Date: Thu, 26 Dec 2024 12:35:44 -0500 Subject: [PATCH 3/7] Updated Unit Test Formatting for #2747 Signed-off-by: DCoomer <20802896+DCoomer@users.noreply.github.com> --- test/unit-tests/click.test.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/test/unit-tests/click.test.js b/test/unit-tests/click.test.js index 6eee96b0a..050605a79 100644 --- a/test/unit-tests/click.test.js +++ b/test/unit-tests/click.test.js @@ -156,9 +156,16 @@ describe(test_name, () => { describe("With proximity selector and Options Object", () => { it("should click", async () => { - await click("Click with proximity", {waitForNavigation: true}, below("Proximity marker")); - expect(await text("Click works with proximity selector and Options Object.").exists()).to.be - .true; + await click( + "Click with proximity", + { waitForNavigation: true }, + below("Proximity marker"), + ); + expect( + await text( + "Click works with proximity selector and Options Object." + ).exists() + ).to.be.true; }); }); From 778bde687c97fda08d691c76f665cad242bc8044 Mon Sep 17 00:00:00 2001 From: DCoomer <20802896+DCoomer@users.noreply.github.com> Date: Mon, 30 Dec 2024 15:51:25 +0000 Subject: [PATCH 4/7] Updated Unit Test Formatting for #2747 Signed-off-by: DCoomer <20802896+DCoomer@users.noreply.github.com> --- test/unit-tests/click.test.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/unit-tests/click.test.js b/test/unit-tests/click.test.js index 050605a79..5c35ebc30 100644 --- a/test/unit-tests/click.test.js +++ b/test/unit-tests/click.test.js @@ -157,14 +157,14 @@ describe(test_name, () => { describe("With proximity selector and Options Object", () => { it("should click", async () => { await click( - "Click with proximity", - { waitForNavigation: true }, + "Click with proximity", + { waitForNavigation: true }, below("Proximity marker"), ); expect( await text( - "Click works with proximity selector and Options Object." - ).exists() + "Click works with proximity selector and Options Object.", + ).exists(), ).to.be.true; }); }); From e61ee57ad9ef3fa9742853757c013fabdd041cb9 Mon Sep 17 00:00:00 2001 From: DCoomer <20802896+DCoomer@users.noreply.github.com> Date: Tue, 31 Dec 2024 21:01:27 +0000 Subject: [PATCH 5/7] Updated Unit Test HTML and formatting for #2747 Signed-off-by: DCoomer <20802896+DCoomer@users.noreply.github.com> --- test/unit-tests/click.test.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/unit-tests/click.test.js b/test/unit-tests/click.test.js index 5c35ebc30..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,16 +155,16 @@ describe(test_name, () => { }); }); - describe("With proximity selector and Options Object", () => { + describe("With proximity selector and options object", () => { it("should click", async () => { await click( - "Click with proximity", + "Click with proximity and options object", { waitForNavigation: true }, below("Proximity marker"), ); expect( await text( - "Click works with proximity selector and Options Object.", + "Click works with proximity selector and options object.", ).exists(), ).to.be.true; }); From ff382c599ad56d5ff1e87cbfba9e04205a27ab79 Mon Sep 17 00:00:00 2001 From: DCoomer <20802896+DCoomer@users.noreply.github.com> Date: Thu, 2 Jan 2025 15:19:33 +0000 Subject: [PATCH 6/7] Bump Version for 2747 Signed-off-by: DCoomer <20802896+DCoomer@users.noreply.github.com> --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f49b7d931..ce4b9e542 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "$schema": "http://json.schemastore.org/package", "name": "taiko", - "version": "1.4.2", + "version": "1.4.3", "description": "Taiko is a Node.js library for automating Chromium based browsers", "main": "bin/taiko.js", "bin": { From 13a29d00cf196f60af165865024148d2b8167b2f Mon Sep 17 00:00:00 2001 From: DCoomer <20802896+DCoomer@users.noreply.github.com> Date: Thu, 2 Jan 2025 15:21:54 +0000 Subject: [PATCH 7/7] Bump Version for 2747 Signed-off-by: DCoomer <20802896+DCoomer@users.noreply.github.com> --- package-lock.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 069af4ac5..975716bf3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "taiko", - "version": "1.4.2", + "version": "1.4.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "taiko", - "version": "1.4.2", + "version": "1.4.3", "hasInstallScript": true, "license": "MIT", "dependencies": {