-
Notifications
You must be signed in to change notification settings - Fork 66
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
Simple select component randomly fails test #343
Comments
I'm seeing the same issue with the example test for QuasarSelect. As mentioned above, it happens more frequently during I've found a potential workaround which is to click on the select twice after mounting (once to open, once to close) and the error hasn't happened since. |
This is probably the case, or something is somewhat forcing your select to close when it shouldn't Could you upgrade Vue, Quasar and Cypress deps and let me know if it still occurs? @david-mohr are you able to replicate this on a clean new project? I'm apparently not able to |
We just noticed the same problem in our own Quasar UI test suite, we're investigating the problem |
@IlCallo yes, I can replicate with a new project. It's inconsistent, but one way I've found to trigger it is to run the test just on QuasarSelect, hit CTRL+C as soon as the second test passes, then run it again
|
I checked this out with @IlCallo. In my case, I didn't have any issues initially when running on node 16. I then switched to both 18 and 20 and started experiencing similar random errors. Like 3 fails on every 5 runs. Hours later, I could not get any errors again on either 16, 18 or 20 after several trials. @lavoscore, @david-mohr, could you confirm if switching the node version makes any difference? |
@n05la3 I found that switching the node version did NOT make any difference (I got failures in all three). FYI I simply used nvm to switch between versions, e.g. |
Maybe it's too soon to celebrate yet, but after upgrading stuff I'm currently unable to reproduce the original behavior. I still see an occasional flake (specific to another test), but had to
Using Node 18.16.0. Anybody else seeing progress with a similar setup? |
Which deps have you bumped during your upgrade? And from which previous version? |
I've looked into this issue a while back but with no luck. The best I can guess is that it's related to QMenu animations. Because in Reference: https://docs.cypress.io/guides/core-concepts/interacting-with-elements#Animations But this issue is so hard to debug: it never fails on my MacBook Pro with M1 Pro, so I can only test it in GitHub Actions. So I can only assume it's related to animations, but never sure how to actually fix it. |
Thanks for reporting your finding, we'll try playing around with |
dependencies:
devDependencies:
|
I tried to bump deps, but to no avail Debugging this a bit further, I noticed that Quasar tests throw this error
And this issue on Cypress, which doesn't seem that much related: cypress-io/cypress#21164 |
In this case, it looks like https://github.com/quasarframework/quasar/blob/3ef2a0a036ad7157b1d69c3d0edb4563c625e433/ui/src/utils/private/position-engine.js#L175 isn't being called when the assertion takes place. |
I was able to get errors consistently by running
in Quasar repo All errors are due to clicks on elements with The problem is that using |
Seems like I pin-pointed the problem to this change: quasarframework/quasar@c9e43fa Not really sure what's going on there, I'll ask for Razvan input on this |
@sodatea you're right, it seems like the problem is that it gets stuck into the retry loop here: After 5 retries it just returns without doing anything and this leaves the Not really sure why this happens tho |
I can confirm the errors on Quasar tests, I'm also consistently getting similar errors. In a few cases, some of the failing test cases pass. |
I can confirm the issue too, using |
I tried digging into this again. It is difficult to pinpoint the culprit since the issue occurs randomly in CI and rarely locally. But it does happen every now and then. I looked into the code but could not locate anything causing this. I guess it is related to Cypress finding the element, trying to click on it while it is still invisible. Cypress is supposed to check that the element is visible before clicking but it seems not to be doing so for some reason. Adding explicit visibility checks resolves the issues. I have added these explicit visibility checks to the Quasar QSelect component tests and it seems to no longer be failing. The issue and Cypress blog post below talk about this more and the recommendation in such cases is to explicitly check that the element is visible before clicking. |
Could you add it automatically to the ".select" override? And convert both Quasar tests to use that helper if possible IIRC they have been written before the helper was available |
Yeah, sure. I'll check that out. |
Seems like this is still happening in some circumstances In particular, I'm experiencing it with Cypress 13.7.0 and the bundled Electron 27.1.3 Tests ran against Firefox or Chromium don't generate that issue, and @n05la3 doesn't experience that problem on his machine, so this could be an env-related problem We'll proceed as defined here and here and then close this issue for good @sodatea we fixed QSelect and use-validate tests into the main repo already, if you have some time to test them out and remove this workaround We also recently migrated Quasar monorepo to pnpm, so this should be good to go too: vitejs/vite-ecosystem-ci#208 |
I have a very simple QSelect based component that will occasionally fail as image below:
It happens very frequently during CI (
cypress run
), less so viacypress open
, and I can't find the cause. The last green message makes me think that Cypress is able to find the popup menu, but even though I can always see its options in the test,withinSelectMenu
can't find them inside the menu, failing here:quasar-testing/packages/e2e-cypress/src/helpers/commands/cypress-overrides.ts
Line 43 in d63b630
Why would that happen only occasionally? Since
withinSelectMenu
"assumes there's a single select menu open at any time", I wonder if there could be some extra empty popup left open somewhere, maybe not correctly unmounted by Cypress between tests or something. I'd appreciate advise on how to narrow this bug down further.Test:
Component:
I'm using version 5.1 and Cypress 12.11.0.
The text was updated successfully, but these errors were encountered: