-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Update/improve cy.type validation logic #586
Comments
Having a |
|
Is this something that will be added? We are struggling to make cypress type into a paragraph that is inside a content editable div.
|
Is there any kind of "workaround" or "dirty hack" available to bypass this issue until this is solved? |
My company is also exploring Cypress and wondering if this will be a feature that will be supported by the Cypress team in the future? Our use case is similar to anocaj; We want to simulate typing into a complex text editor that is a div. |
Yes, we do intend this to be done in the future, but currently it is not assigned to anyone. The code can be found here if anyone wants to begin a Work in Progress PR: https://github.com/cypress-io/cypress/blob/develop/packages/driver/src/cy/commands/actions/type.coffee#L23 |
@Magneticmagnum that is not addressed by this issue...however we should already support typing into |
This will be fixed by an upcoming patch release. It's really as simple us using the type property instead of type attribute. So we can still whitelist input types, as long as we use the type property getter |
nothing is working with cy.type when subject is not typeable.please create some solution. |
@wasiqkhan786 This issue has been resolved and there are tests against it. This issue will be closed to further comment. If you're experiencing a bug similar to this in Cypress, please open a new issue with a fully reproducible example that we can run. There may be a specific edge case with the issue that we need more detail to fix. |
It appears fairly common that users need to type into an input that has an invalid type attribute (
type="STRING"
,type="username"
), triggering the errorcy.type() can only be called on textarea or :text
.Here are two possible ways to improve the experience for this use case:
Allow validation to be bypassed with either
{ force: true}
or{ validation: false }
. Also, improve the error message so it's clear what:text
means and include details on how to bypass validation.Instead of whitelisting input types, blacklist certain types instead (e.g. checkbox). This would provide a good error message if typing into something that's blacklisted, but allow users to type into inputs with types that aren't accounted for, just as a browser actually allows.
The text was updated successfully, but these errors were encountered: