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

type() expects input type to be lowercase #550

Closed
dvf opened this issue Jul 6, 2017 · 6 comments
Closed

type() expects input type to be lowercase #550

dvf opened this issue Jul 6, 2017 · 6 comments
Assignees
Milestone

Comments

@dvf
Copy link

dvf commented Jul 6, 2017

  • Operating System: macOS 10.12.5
  • Cypress Version: 0.19.4
  • Browser Version: Chrome 59

Is this a Feature or Bug?

This is a bug.

Current behavior:

I have a form with an input field <input type="PASSWORD" id="PASSWORD" />.

I get the error:

CypressError: cy.type() can only be called on textarea or :text. Your subject is a: <input autocomplete="off" class="focus" id="PASSWORD" name="PASSWORD" onkeypress="DetectCapsLock()" type="PASSWORD">

Desired behavior:

This is an input element, so I would expect the input to be entered.

How to reproduce:

Create an input with type = "PASSWORD" (uppercase), and try type().

Test code:

describe('Test can do stuff', () => {
  it('logs in', () => {
    cy
      .visit('https://example.com/login.html')
      .get('#USERNAME')
      .type('dvf')
      .get('#PASSWORD')
      .type('my password', {force: true});
  });
});
@jennifer-shehane
Copy link
Member

Have confirmed bug.

@chrisbreiding
Copy link
Contributor

The code for this is done, but this has yet to be released. We'll update the issue and reference the changelog when it's released.

@brian-mann
Copy link
Member

Fixed in 0.20.0

@caseybaggz
Copy link

I'm still getting an error similar to this. I have 3 inputs that dynamically show depending on a button click. Typing in the first input works, however typing in the second fails with this error:

Command:     type
Typed:       James
Applied To:  <input type=​"input" value id=​"field_middleName" placeholder=​"Middle Name (optional)​" autocomplete=​"off">​
Error:       CypressError: cy.type() can only be called on textarea or :text. Your subject is a: <input type="input" value="" id="field_middleName" placeholder="Middle Name (optional)" autocomplete="off">

@jennifer-shehane
Copy link
Member

@caseybaggz This is actually related to this issue: #586 This error is displaying because type='input' is not a valid input type: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input

@caseybaggz
Copy link

@jennifer-shehane wow...I have been working too much lately to have overlooked that. Thanks for the humble comment.

bitmoji

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants