Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Click events on svg element generates: CypressError: Timed out retrying: Illegal invocation #2245

Closed
mechanical-turk opened this issue Jul 30, 2018 · 30 comments · Fixed by #2246
Assignees
Milestone

Comments

@mechanical-turk
Copy link

mechanical-turk commented Jul 30, 2018

Current behavior:

We have a click assertion:

cy.get('[data-role="rater-button"]')
    .first()
    .click();

instead of it clicking and continuing, we get this error: CypressError: Timed out retrying: Illegal invocation

Desired behavior:

It should click and advance.

Steps to reproduce:

Create an svg object, select it and click it.

Versions

Cypess 3.0.3
Mac OS X (10.12.6)

@brian-mann brian-mann self-assigned this Jul 31, 2018
@brian-mann
Copy link
Member

Yup, for sure a bug in 3.0.3.

@mechanical-turk
Copy link
Author

@brian-mann Fyi, this wasn't a problem on 3.0.2.

@brian-mann
Copy link
Member

Yup this was an area that we completely rewrote and it's a simple fix.

@yourownmood
Copy link

yourownmood commented Jul 31, 2018

Just upgraded to 3.0.3 in my experience its not only related to SVG but to all css selectors like [aria-label="Title"]', [name="Title"]', etc.

3.0.2 is working fine! 😄

@brian-mann
Copy link
Member

brian-mann commented Jul 31, 2018 via email

@yourownmood
Copy link

yourownmood commented Jul 31, 2018

Sorry false, alarm i landed here because of the CypressError: Timed out retrying: Illegal invocation
Found out that the tests failing were clicking on a svg in a button.
So it should be svg related and not css selector related

@mattvb91
Copy link

Same issue here clicking on svg 3.0.3

@jennifer-shehane jennifer-shehane added the stage: needs review The PR code is done & tested, needs review label Jul 31, 2018
davidrapson added a commit to biglotteryfund/blf-alpha that referenced this issue Aug 1, 2018
@jennifer-shehane jennifer-shehane modified the milestones: 3.0.4, 3.1.0 Aug 2, 2018
@jennifer-shehane jennifer-shehane removed the stage: needs review The PR code is done & tested, needs review label Aug 2, 2018
@msmfsd
Copy link

msmfsd commented Aug 6, 2018

Same issue with svg click and aria click

sapegin pushed a commit to styleguidist/react-styleguidist that referenced this issue Aug 7, 2018
@gopijaganthan
Copy link

gopijaganthan commented Aug 10, 2018

cy.get('a[href="/a/contacts"]', {timeout: 100000}).click(**{ force: true }**)

This worked for me

@0102qa
Copy link

0102qa commented Aug 10, 2018

Hi @brian-mann, i can reproduce problem for
cy.get('[data-test-generic="dashboardheader::iconbutton"]')
cy.get('[data-test-specific="middlenav-div(0)"] > :nth-child(1)')
on version 3.0.3. Works fine for 3.0.2

@brian-mann
Copy link
Member

@0102qa we've already fixed the bug and it will go out in the next release

@ghost
Copy link

ghost commented Aug 21, 2018

Hello all,

I'm not sure, but this might needs reopening. I just installed v3.1.0 and the same behaviour is occuring.
I have a button with an SVG element inside of it and when I run .click() on it (the button), it will throw the error: CypressError: Timed out retrying: Illegal invocation

I tried switching the button for a span with text (no SVG) and this works. Then I switched the button with SVG for a button with text and this also works. However the difference for me is when I downgrade to 3.0.2 the same error appears.

@brian-mann
Copy link
Member

@webdevbe can you please put together a minimally reproducible repo showing the problem? We did fix this (and added tests) in 3.1.0 and if this is still failing we'll need help tracking down why.

@nmchaves
Copy link

fwiw 3.1.0 resolved the issue for my team. Thanks Brian!

@ghost
Copy link

ghost commented Aug 23, 2018

Hi @brian-mann,

You can see the problem here: https://github.com/webdevbe/svg-cypress
To run please

  • clone the repo
  • run npm install
  • run npm start
  • in another tab run cypress open

Then you can select the project and the spec is called svg-test.js .

I tried two instances, one with an svg inside a button (which is the problem in my project) and one where there is just the SVG. Both throw the same error.

If you need any extra info, please let me know.

Thanks!

@ghost
Copy link

ghost commented Aug 27, 2018

Hi @brian-mann,

Were you able to reproduce the issue with my test setup?

Thanks

@kuceb
Copy link
Contributor

kuceb commented Aug 27, 2018

Hi @webdevbe
I was not able to reproduce this on Linux with Cypress 3.1.0
Here's the result of the tests:
image

I would try cypress cache clear and cypress install again

@ghost
Copy link

ghost commented Aug 28, 2018

Hi @bkucera ,

I tried your suggestions, but they didn't change anything. I then went to one of my colleagues running Linux and there it does work. Personally I'm working on a Windows machine, perhaps this is the reason?

See the output here:
image

Regards

@kuceb
Copy link
Contributor

kuceb commented Aug 28, 2018

@webdevbe what version of Chrome are you using?

@ghost
Copy link

ghost commented Aug 28, 2018

@bkucera Version 68.0.3440.106 (Official Build) (64-bit)

@ghost
Copy link

ghost commented Aug 31, 2018

@bkucera I can open a new issue if that is more clear then communication over a closed one. Let me know, thanks.

@mattrlong
Copy link

I'm also experiencing this error using 3.1.0 on macOS High Sierra, clicking an svg errors with: CypressError: Timed out retrying: Illegal invocation error.

Clicking the same selector through JQuery via Chrome console works as expected.

@kuceb
Copy link
Contributor

kuceb commented Sep 10, 2018

@mattrlong what version of chrome are you on? I can't reproduce this on linux on chrome 68

@kuceb
Copy link
Contributor

kuceb commented Sep 10, 2018

@webdevbe I think we should keep the issue here (for future reference), but I will reopen if I can get a reproducable

@mattrlong
Copy link

@bkucera sorry looked to be a version/caching issue. Can now no longer reproduce.

@kuceb
Copy link
Contributor

kuceb commented Sep 11, 2018

@webdevbe are you still experiencing this issue?

@ghost
Copy link

ghost commented Sep 11, 2018

@bkucera Yes, I just did a fresh run of the specs. But only on Windows, on Linux it works (as mentioned above). Still the same error : CypressError: Timed out retrying: Illegal invocation

Is there someone else in the team (running Windows) that can copy the example I've setup and test?

@kuceb
Copy link
Contributor

kuceb commented Sep 12, 2018

I can try it in a windows VM

@kuceb
Copy link
Contributor

kuceb commented Sep 12, 2018

@webdevbe Just fired up a windows 10 vm, the spec passed with both cypress run and cypress open on Chrome Version 68.0.3440.106 (Official Build) (64-bit)

@ghost
Copy link

ghost commented Sep 20, 2018

@bkucera I don't know what the issue is then. As it seems that I'm the only one experiencing this issue for now, it will probably be something on my configuration.
FWIW, I'll paste the error trace from cypress run here:

 1) testblock should work, clicking on a btn:
     CypressError: Timed out retrying: Illegal invocation
      at Object.cypressErr (http://localhost:3000/__cypress/runner/cypress_runner.js:68160:11)
      at Object.throwErr (http://localhost:3000/__cypress/runner/cypress_runner.js:68125:18)
      at Object.throwErrByPath (http://localhost:3000/__cypress/runner/cypress_runner.js:68152:17)
      at Object.retry (http://localhost:3000/__cypress/runner/cypress_runner.js:61893:16)
      at retryActionability (http://localhost:3000/__cypress/runner/cypress_runner.js:53692:19)
      at tryCatcher (http://localhost:3000/__cypress/runner/cypress_runner.js:7091:23)
      at Function.Promise.attempt.Promise.try (http://localhost:3000/__cypress/runner/cypress_runner.js:4470:29)
      at tryFn (http://localhost:3000/__cypress/runner/cypress_runner.js:62129:24)
      at whenStable (http://localhost:3000/__cypress/runner/cypress_runner.js:62157:12)
      at http://localhost:3000/__cypress/runner/cypress_runner.js:61917:16
      at tryCatcher (http://localhost:3000/__cypress/runner/cypress_runner.js:7091:23)
      at Promise._settlePromiseFromHandler (http://localhost:3000/__cypress/runner/cypress_runner.js:5113:31)
      at Promise._settlePromise (http://localhost:3000/__cypress/runner/cypress_runner.js:5170:18)
      at Promise._settlePromise0 (http://localhost:3000/__cypress/runner/cypress_runner.js:5215:10)
      at Promise._settlePromises (http://localhost:3000/__cypress/runner/cypress_runner.js:5294:18)
      at Promise._fulfill (http://localhost:3000/__cypress/runner/cypress_runner.js:5239:18)
      at http://localhost:3000/__cypress/runner/cypress_runner.js:6778:46

As I can still continue by applying {force:true} I'm not blocked by this, so hopefully somewhere in the future it works as expected.

Thanks for looking into my issue and best regards

valentyn90 added a commit to valentyn90/React-Styleguidist that referenced this issue Oct 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.