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.

Missing letters when using type

See original GitHub issue

Current behavior:

I just upgraded to Cypress 3.2.0 and noticed this strange behavior with type

missingFirstLetter

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

  it('Successful login', () => {
    cy.visit('/')
    cy.get('head title')
    .should('contain', 'Log in')
    cy.get('#email')
      .type('Admin{enter}', {force: true, delay: 700})
    cy.get('#password')
      .type('superSafePassword{enter}')
    cy.get('.primary').click()
    cy.get('#title')
      .should('contain', 'Dashboard')
  });
});

The form

<div class='right'>
  <p class='greeting'>Log in to your account</p>
  <ListErrors {errors}/>

  <form on:submit='submit(event)' autocomplete='off'>
    <fieldset class='login'>
      <img alt='user' src='img/user.svg' class='login-icon' />
      <input type='text' placeholder='Email' id='email' autocomplete='off' bind:value=email>
    </fieldset>

    <fieldset class='login'>
      <img alt='password' src='img/password.svg' class='login-icon' />
      <input type='password' placeholder='Password' id='password' autocomplete='new-password' bind:value=password>
    </fieldset>
    <Button kind='primary block' type='submit' disabled='{!email || !password}'>Log in</Button>
  </form>
</div>

Versions

Windows 10 Cypress 3.2.0 Chrome 73.0.3683.86 (Official Build) (64-bit)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:5
  • Comments:61 (9 by maintainers)

github_iconTop GitHub Comments

19reactions
jonnyparriscommented, Feb 6, 2021

I’m hitting this bug for the 4th time in 12 months of various fresh installations.

  1. the WORKAROUND (without using an arbitrary wait()) that I use is simply to duplicate the very first input type() command. Something like the following:
    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();
  1. This is has been so consistent it’s hard to believe that no maintainers can reproduce it; but here’s some markup (pug) to run it against that hopefully can help debug (@jennifer-shehane 🙏🏾 ). It’s essentially just an input for email and password with a button to submit the form
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 😅

11reactions
romankhomitskyicommented, May 17, 2022

The issue is still exists

Read more comments on GitHub >

github_iconTop Results From Across the Web

Solved: missing letters when I type - Dell Community
Solved: I have a Studio 540S and when I type I have letters missing. There is times it in a delayed movement when...
Read more >
Why do I keep missing letters and words when I'm writing?
My first question would be, how many letters and words are you missing? I type pretty quickly, and have written a lot of...
Read more >
missing letters when typing fast - HP Support Community
I have a new Pavilion laptop with Windows 10 and very annoyingly when I type fast keystrokes are missed.
Read more >
Missing letters when typing | CA Service Management
HI Team, when I type some text in description / resolution fields some letters are not typing properly. This is not problem with...
Read more >
Initial letters missing while using type() in Cypress
This question leaves out some vital bits that I would like to clear up. If you try out the click-trick on that HTML...
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