This is a bug.
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">
This is an input element, so I would expect the input to be entered.
Create an input with type = "PASSWORD" (uppercase), and try type().
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});
});
});
Have confirmed bug.
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.
Fixed in 0.20.0
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">
@caseybaggz This is actually related to this issue: https://github.com/cypress-io/cypress/issues/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
@jennifer-shehane wow...I have been working too much lately to have overlooked that. Thanks for the humble comment.
