cypress: Cypress Doesn't Finish Typing Strings Before Continuing to Next Field
Current behavior:
When typing a long string into an input field, such as an email address to login in our case, Cypress 3.5.0 appears to no longer type the entire string. It bails on typing the complete string after the period in the email and never completely types the string. For example, test@webdomainhere.com would be typed as test@webdomainhere. in our app, failing the login.
I have also seen similar things with usernames using mixed case, such as associateEnabled would be typed as associate, stopping before the capital letter in the string.
Due to this bug we have had to roll back to using Cypress 3.4.1, where this worked fine.
Example screenshot showing a failed login in Cypress 3.5.0 where the email should’ve had ‘com’ typed after the period:
Desired behavior:
Entire string passed to a cy.type() function should be typed into the input field.
Steps to reproduce: (app code and test code)
Type a long string, such as a long email address into a form field and then move on to a password field with a .click() and see that the end of the first string isn’t entered.
Versions
Cypress v3.5.0 (v3.4.1 works fine, we have had to roll back) Mac OSX 10.14.6 Electron 61 / Chrome 78
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 28
- Comments: 109 (27 by maintainers)
Commits related to this issue
- fix issues with cypress, continuing after typing too fast. related to https://github.com/cypress-io/cypress/issues/5480 — committed to openpetra/openpetra by tpokorra 4 years ago
- Added {force: true} to each cy.type call Why? - There is currently a bug in cypress that cuts off long sentences before they're fully typed. This workaround was mentioned in this thread that is curre... — committed to finn-francis/our_fitness_pal_react by finn-francis 4 years ago
- Add custom "hack" for cypress' broken `.type()` functionality This is most likely the cause of many flakes we're experiencing in CI. More info can be found here: https://github.com/cypress-io/cypress... — committed to metabase/metabase by nemanjaglumac 4 years ago
- Repro for issue #13241 (#13252) * Add custom "hack" for cypress' broken `.type()` functionality (This is most likely the cause of many flakes we're experiencing in CI. More info can be found here: ... — committed to metabase/metabase by nemanjaglumac 4 years ago
- Merge release-0.36.x back into master (#13355) * Fix footer on release-0.36.x (#13287) * Repro for issue #13241 (#13252) * Add custom "hack" for cypress' broken `.type()` functionality (This i... — committed to metabase/metabase by camsaul 4 years ago
- Repro for issue #13241 (#13252) * Add custom "hack" for cypress' broken `.type()` functionality (This is most likely the cause of many flakes we're experiencing in CI. More info can be found here: ht... — committed to metabase/metabase by nemanjaglumac 4 years ago
Unfortunately we have to close this issue as there is not enough information to reproduce the problem. This does not mean that your issue is not happening - it just means that we do not have a path to move forward.
Please comment in this issue with a reproducible example and we will reopen the issue. 🙏
@jennifer-shehane , I am unsure what you’re looking for. Simply use cy.type() on an input field with a string with mixed case and it will reproduce the problem. This happens on various login screens around our app which I cannot share as they are proprietary. Please let me know what you’re expecting for this bug to be investigated
I had a similar issue with this where
only resulted in typing out the first character
s.I was able to get around this issue by adding
{ force: true }option totype().My current cypress version is
3.8.2.Please provide a way to reproduce
Hey everyone, we know this issue is happening and we really, really do want to fix this. But as of yet no one has provided a completely reproducible example that we can currently run that fails in 3.4.1 and passes in 3.5.0.
Please provide a reproducible example - the entire HTML & test code that we can fully run on our system.
We do not currently have an example to reproduce this bug, so no work has been done on this issue and cannot be fixed until that is provided.
Dear great community, i have had the same error, the problem is that Cypress is typing to fast in it. The default input typing speed is 10ms. I solved my problems since i added an option while typing in an input field. You have just to increase the delay of typing! Like ->
delays between 70 and 100 was the perfect range i tried it with 50 ms, but it failed onced. since i updated it to 70 ms, the test now have been run over 600 times! without error.
Sorry for my bad english, i’m not a native english speaker.
Best wishes from germany
From the above stories, and from my own experience trying, it is clearly quite difficult to create such a reproducible example.
I do understand how this benefits you when you are trying to debug an issue.
Nonetheless, is there now not sufficient evidence to suggest that there is an underlying issue that is giving many people problems which therefore warrants further investigation from Cypress?
Sent via Superhuman iOS ( https://sprh.mn/?vip=williamgdjones@gmail.com )
On Wed, Sep 9 2020 at 8:24 pm, Gleb Bahmutov < notifications@github.com > wrote:
I am experiencing this on 4.6.0. Can’t provide example but in my case this won’t happen at the very first time cypress types, for instance, my test first authenticates typing successfully but after navigating through the application and typing again it truncates the strings. What is solving the issue for me every time is to use
clearmethod just asPlease provide a way to reproduce
Hey everyone, we know this issue is happening and we really, really do want to fix this regression. But as of yet no one has provided a completely reproducible example that we can currently run that fails in 3.4.1 and passes in 3.5.0.
Please provide a reproducible example - the entire HTML & test code that we can fully run on our system.
We do not currently have an example to reproduce this bug, so this is no work has been done on this issue and cannot be fixed until that is provided.
@TheWanderingWalnut as a workaround, you may want to just set the values with
cy.get(...).invoke('val', 'email@example.com'). If you can get us a reproducible I’ll be happy to look more into this. Thanks!@bahmutov Think I’ve finally got a solid repro for this!
Check out https://github.com/dacort/cypress_type_repro
It’ll require you to run the Metabase Docker image, but the test takes care of setting it up and shows both a failing and successful
typetest case. There is a drop list that pops up that could be causing the issue?Let me know how else I can help! /cc @nemanjaglumac as he helped put together the repro.
This helped me as well!
4.8.0- bug is still there.Hola comunidad, a mi me está ocurriendo el mismo problema que no terminar escribir una cadena de texto en la versión 4.5. Me está ocurriendo en este mismo momento. Al parecer no hay una solución, pero al menos aquí dejaré el caso. Un saludo.
I too am seeing this issue after upgrading from v3.4.1 -> v3.8.2. Using it as such:
The
searchCriteriawe pass in could be 123456 and typically it will type{enter}after 12345, but missing the 6.We are testing an Angular 8 project with Cypress.
I can confirm this reproduces the issue. It seems to take a few tries but for me, after 3-5 successful attempts it only types the first 2 or 3 letters. It seems to fail a lot more after that happens. Hitting Stop from the TR and rerunning it almost always succeeds the first couple of runs.
I was able to comment out everything reducing to just:
And still reproduce it. @jennifer-shehane can we reopen this?
Using cypress 4.1.0 and had to instrument this workaround:
inputmust be a function that returns a cypress getter, i.e.We have a react app that uses controlled inputs. We respond to the
onInputevent and that is why the component is rerendered on each character that is typed. This work around types VERY slowly, so use it sparingly.After one day trying this, I’ve just found the error. Our app is written in React and eveytime we change the location it fires a setTimout to fire a redux action to clean alerts after x seconds. This leads to weirds re-renders in the middle of the tests that, even if they don’t update the component at all, it prevents Cypress to keep typing. Also, we had other issues with elements being apparently unmounted. But again, this was all related to firing this redux action with the timer to clear notifications.
Thanks!
We just encountered this in 4.0.2 . Our’s was a very simple
It would only type 5 in 4.0.0 and in 4.0.2 sometimes gets 50 or 500. We have many other uses of type around our tests but only this one was failing.
I repeated the same command after it and second time it types the full 5000.
We added the
{force: true}and it’s fine now.It happens running just this test in isolation, not sure how I could try reproduce it but if there’s anything we can do to try help find the cause let me know.