question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] `click()` or `dblclick()` is not executing on 'path' tag for the DOM

See original GitHub issue

Context:

  • Playwright Version: 1.23.0
  • Operating System: Linux
  • Node.js version: 14.17.3
  • Browser: [e.g. All, Chromium, Firefox, WebKit]
  • Extra: electron application
  • Electron version: 18.0.1 also tested in 13.6.6

System:

  • OS: Linux 5.14 Ubuntu 20.04.4 LTS (Focal Fossa)
  • Memory: 1.05 GB / 15.38 GB
  • Container: Yes

Binaries:

  • Node: 14.17.3 - /usr/local/lib/nodejs/node-v14.17.3-linux-x64/bin/node
  • npm: 6.14.13 - /usr/local/lib/nodejs/node-v14.17.3-linux-x64/bin/npm

Languages:

  • Bash: 5.0.17 - /usr/bin/bash

Code Snippet

Help us help you! Put down a short code snippet that illustrates your bug and that we can run and debug locally. For example:

Here is the complete repo to reproduce the bug: https://github.com/RizwanMR/angular-electron

Describe the bug Steps to reproduce:

  1. clone the repo.
  2. do npm i
  3. run the script ‘npm run e2e’

Expected result: Should click the element inside the playwright test(‘Click link’)

Actual Result: Throws error as below for the path tag locator.click: Timeout 30000ms exceeded. =========================== logs =========================== waiting for selector “(//*[contains(@class,‘path-elm’)])[1]” selector resolved to hidden <path class=“path-elm” _ngcontent-dbt-c4=“” d="M 55 30…></path> attempting click action waiting for element to be visible, enabled and stable element is not visible - waiting… ============================================================

  61 |   test('Click link', async () => {
  62 |     const elem = firstWindow.locator(`(//*[contains(@class,'path-elm')])[1]`);
> 63 |     const text = await elem.click();
     |                             ^
  64 |     expect(true).toBe(true);
  65 |   });
  66 |

    at /home/hi/Documents/angular-electron/e2e/main.spec.ts:63:29
    at /home/hi/Documents/angular-electron/node_modules/@playwright/test/lib/workerRunner.js:388:15

Add any other details about the problem here.

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:6
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
RizwanMRcommented, Jul 5, 2022

It worked, but expecting it to click the element as it is visible on the page, and forcing the element click will bypass so many checks on the element.

2reactions
ltsudacommented, Jul 5, 2022

Just a suggestion, if you are using @Playwright/Test, you can remove the playwright package/library. All import statements are present in @Playwright/Test as you can see below:

image image

Read more comments on GitHub >

github_iconTop Results From Across the Web

Prevent click event from firing when dblclick event fires
Each one carries out a different command, but I find that when double clicking on the element, in addition to firing the double...
Read more >
86768 - dblclick event is not triggered by SVG path elements
Issue 86768: dblclick event is not triggered by SVG path elements · 1. generate an SVG 'rect' element and a 'path' element ·...
Read more >
Click on an svg element doesn't trigger a click event. #4495
Using element(by.tagName('svg')).click() throws an "element not visible" error. Using browser.actions().click(element.all(by.css('svg')).get(0).
Read more >
Element: dblclick event - Web APIs | MDN
The dblclick event fires when a pointing device button (such as a mouse's primary button) is double-clicked; that is, when it's rapidly clicked...
Read more >
Interacting with Elements - Cypress Documentation
Some commands in Cypress are for interacting with the DOM such as: .click() .dblclick() .rightclick() .type() .clear() ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found