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

Cannot type() into input field with invalid type #1061

Closed
maticko opened this issue Dec 13, 2017 · 2 comments
Closed

Cannot type() into input field with invalid type #1061

maticko opened this issue Dec 13, 2017 · 2 comments
Labels
type: duplicate This issue or pull request already exists

Comments

@maticko
Copy link

maticko commented Dec 13, 2017

  • Operating System: any
  • Cypress Version: 1.1.4
  • Browser Version: Chrome

Is this a Feature or Bug?

Bug

Current behavior:

Won't type into input filed with invalid type (like type="invalid"), throws an error.

Desired behavior:

Cypress should type to input field anyway. Cypress shouldn't be so strict regarding the input field type. It should handle types that it cannot recognise (as default text).

How to reproduce:

Create HTML input element with an invalid type.

<input type="invalid" />

Then use cypress to type into that input field.

Test code:

cy.get('input').type('banana')

Additional Info (images, stack traces, etc)

image

@jennifer-shehane
Copy link
Member

We have chosen to be strict about only allowing valid input types to be typed into. We feel that this helps ensure that your application's HTML is valid and is another layer of testing that is more helpful than harmful. If your application uses invalid HTML, there is no assurance that browsers will respect the behavior you expect.

That being said, I'd like to hear the use case for why you feel using an invalid input type is necessary for your application - we are always open to hear situations we have not considered.

@jennifer-shehane jennifer-shehane added the stage: needs information Not enough info to reproduce the issue label Dec 13, 2017
@brian-mann brian-mann added the type: duplicate This issue or pull request already exists label Dec 13, 2017
@brian-mann
Copy link
Member

This is actually a duplicate of #586

We decided to accept a new option to turn off validation. Just needs a PR to get merged in.

@jennifer-shehane jennifer-shehane removed the stage: needs information Not enough info to reproduce the issue label Dec 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants