-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Missing letters when using type #3817
Comments
I added |
@Mattinn this is a common question and a problem. See my two blog posts about it |
Thanks Gleb, these posts explain the problem very well 👍 |
Some weird race condition is happening here. For more details see: cypress-io/cypress#3817 #6732
Some weird race condition is happening here. For more details see: cypress-io/cypress#3817 #6732
I found this issue when Googling for why my field is missing the first few characters of my type. cy.get('#customer-postcode').type('W1A 1AA');
cy.get('#customer-postcode').should('have.value', 'W1A 1AA'); I expected to see I am using Cypress 4.10.0 |
same here |
This is not flaky cypress 4.11.0 has the same issue |
Some of you may be experiencing this issue: #5480 This specific issue that the original poster was experiencing has been closed as fixed however. If you're experiencing a bug similar to this in Cypress, please open a new issue with a fully reproducible example that we can run. There may be a specific edge case with the issue that we need more detail to fix. |
I solved my issue by adding |
I don't think it is a good idea to keep hardcoded wait before every type. |
so what the alternative ? |
By using a work-around like cy.wait() some time the above issue disappears, but the original issue remains the same. |
Yeah. Exactly. |
Here is another workaround which worked for me.
look for cypress-plugin-tab here |
I had an issue with password not matching. Here's what i tried and this worked for me.
|
|
Hey, I see people commenting on this issue, despite it being closed. If you have a reproducible example you can share with us (so we can run it ourselves to see the problem), please open a new issue. |
If you try to type a big text and use back to back type for 4-5 different fields you might see the issue. using Cypress 6.4.0. |
@shirshendu30 Please provide code - HTML, CSS, and JS and the Cypress tests that fail with it. Open a new issue. |
describe('Check Insight Present in Filtertab', function () {
const explorerPage = new Explorer();
const login = new Login();
let filterOptions: string[] = [];
let check: boolean = false;
it('Explorer Insight verification', () => {
cy.visit('url');
login.email().type('longUserName- 50 chrs');
login.password().type('longPwd - 40chars');
login.signInButton().should('be.visible').click();
explorerPage.filterbutton().should('be.visible').click();
})
it('verify Product, Folder, Test in source Explorer', () => {
cy.visit('url');
login.email().type('longUserName- 50 chrs');
login.password().type('longPwd - 40chars');
login.signInButton().should('be.visible').click();
cy.visit('someotherurl');
})
}) Mostly when we have two 'it' , 2nd test('it') is only wrting first few characters of the username and password. This is intermittent. mostly seem when used chrome browser. |
@shirshendu30 We cannot run the code you've provided - there is no HTML/CSS or site to visit. We cannot look into the issue without being able to reproduce it ourselves. |
I'm hitting this bug for the 4th time in 12 months of various fresh installations.
cy.get("input[name=email]").type("x"); // dummy input to "warm up" Cypress
cy.get("input[name=email]").clear().type(email);
cy.get("input[name=password]").type(password);
cy.get("button[type=submit]").click();
form
div
label(for="email") Email
input(
name="email",
placeholder="Email",
type="email",
autocomplete="username"
)
div
label(for="password") Password
input(
name="password",
placeholder="Password",
type="password",
autocomplete="current-password"
)
button(type="submit") Log in Really hope this can help because persistent bugs like this for what should be simple example really trip me up when trying to evangelise about the joys & ease of testing with awesome tools like Cypress. Hope this can help any other googlers or at least help me converge towards this workaround much quicker next time 😅 |
@akwasin If you have a reproducible example that we can run completely and see the error, you can email it so [email protected] |
@akwasin your case seems pretty close to https://www.cypress.io/blog/2018/02/05/when-can-the-test-start/ - from the command log I see you visit the page and immediately do |
@AbrahamBrookes Out of curiosity, do you reckon that its faster to type |
Depends on how long it takes to type your warm up text I guess. My worry with `wait` is that I just don't like how it smells. If the app takes longer than the `wait` duration to boot for some reason then we're back where we started. I feel like typing and clearing is at least interaction with the app so maybe cypress will pick up a different error somehow. Probably not though, this is just conjecture. I just don't like using lots of waits.
edit: Oh I get you you mean my typing speed. I actually duplicate the whole line twice and change the middle one to a `clear()` so it's pretty fast I guess. I'm not that fast a typer.
|
@AbrahamBrookes about your edit, You're right on your first point, I was referring to the speed of Cypress handling |
We're having this issue. I'd love to make a reproducible example but it's likely that reproducing requires having a large app that has relatively large page load times, and our app isn't open source unfortunately. Anyway, seconding the solution others had, for us adding wait(1000) solved it, which we set to (2000) to be safe. Obviously annoying, but it got the job done. |
Could you try plugin cypress real events to see if that works? |
@KittyGarrison luckily there's a good amount of suggestions on how to fix this. |
@akwasin Sorry to say but I fail see how waiting for half a second is a good suggestion. |
@demetris-manikas I totally agree but its currently one of the best functional workarounds to the current issue. |
@akwasin Well... If |
Or you could not enable the input box until the app is you know, ready to process the input? Maybe have the disabled attribute and remove it only after the app has finished scaffolding?
…Sent from my iPhone
On Feb 16, 2022, at 10:23, Demetris Manikas ***@***.***> wrote:
@akwasin Well... If .click().wait(0) works why doesn't cypress add it in the .type() code and save us all ?
I guess because it does not always work to only call .wait(0).
Anyway...
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.
|
Or possibly add a setting to adjust execution speed, like playwrights slo-mo. |
Or the hell with cypress
|
Don't you think that is the issue with you application? |
I was having same issue and none of the workaround worked for me. I had to use |
In my case, I found the issue with our app design that is causing it. We have a component that overlays all views when user data wasn't loaded that happens for a brief moment but enough to stop cypress typing. Example to reproduce it:
test.js.mp4I hope this could help. |
The issue is still exists |
Is this wait(0) documented somewhere? |
Nope not that I know of and its extremely anti-pattern'ish but so the best working solution to missing letters. https://docs.cypress.io/guides/references/best-practices#Unnecessary-Waiting |
How can this bug persist for so long? Isn't that a bug in .type? |
I'm also experiencing the same issue. The only workaround that works is adding a hardcoded sleep but I'd like to avoid this if possible. |
I'm also facing this issue(( |
issue still exist! |
Yeah, 10.4.0 and I still can experience this as well |
If they haven't solved it after so long, it will be that the problem is more complicated than it seems (I hope), but still it's strange that nobody says anything about it |
Because there is no reproducible example, it can be to multiple reasons |
Right now there doesn't seem to be enough information to reproduce the problem on our end. We'll have to close this issue until we can reproduce it. This does not mean that your issue is not happening - it just means that we do not have a path to move forward. Please open a new issue with a reproducible example and link to this issue. Here are some tips for providing a Short, Self Contained, Correct, Example and our own Troubleshooting Cypress guide. |
Current behavior:
I just upgraded to Cypress 3.2.0 and noticed this strange behavior with type
For some reason the first letter gets cut out, this test used to run fine in 3.1.5.
Desired behavior:
That the typed text does not get cut short
Steps to reproduce: (app code and test code)
The test
The form
Versions
Windows 10
Cypress 3.2.0
Chrome 73.0.3683.86 (Official Build) (64-bit)
The text was updated successfully, but these errors were encountered: