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

Comments

5 participants
@dvf

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

This comment has been minimized.

Member

jennifer-shehane commented Jul 7, 2017

Have confirmed bug.

@chrisbreiding

This comment has been minimized.

Collaborator

chrisbreiding commented Jul 10, 2017

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

This comment has been minimized.

Member

brian-mann commented Sep 14, 2017

Fixed in 0.20.0

@caseybaggz

This comment has been minimized.

caseybaggz commented Dec 13, 2017

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

This comment has been minimized.

Member

jennifer-shehane commented Dec 13, 2017

@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

This comment has been minimized.

caseybaggz commented Dec 13, 2017

@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