-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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 spaces in email input #1327
Comments
This is due to type='email' inputs automatically trimming end whitespace when reading off the value property, and will automatically trim the whitespace when setting value directly. Will only really be solved by native events. |
FYI, the example documentation here: https://docs.cypress.io/guides/getting-started/writing-your-first-test.html includes adding a space to an email field, which breaks: describe('My First Test', function () {
it('Gets, types and asserts', function () {
cy.visit('https://example.cypress.io')
cy.contains('type').click()
// Should be on a new URL which includes '/commands/actions'
cy.url().should('include', '/commands/actions')
// Get an input, type into it and verify that the value has been updated
cy.get('.action-email')
.type('[email protected ]')
.should('have.value', '[email protected]') // ❌ Fails here without space
})
}) |
The same seems to apply to |
came across this issue today, trying to test validation rules. Given that a real user can type spaces, I need cypress to be able to replicate the behaviour |
I found some workaround. |
This issue has not had any activity in 180 days. Cypress evolves quickly and the reported behavior should be tested on the latest version of Cypress to verify the behavior is still occurring. It will be closed in 14 days if no updates are provided. |
This issue has been closed due to inactivity. |
This is still an issue in v12.14.0 |
This will be an issue in core for the foreseeable future since implementing native events is a fairly big change and not something on the roadmap right now. Good news is this can already work using cypress-real-events. I just tested it out, and it works perfectly. Here's my code: /// <reference types="cypress" />
describe('page', () => {
it('works', () => {
cy.visit('http://localhost:8000')
cy.get('input').type('a b c') // not working
cy.get('input').clear().realType('a b c') // works as expected
})
}) I use |
Current behavior:
You can't type spaces within an
input
oftype="email"
. I came across this while trying to debug #1298Desired behavior:
Honestly, this likely doesn't matter to anyone because...why are you typing spaces in email fields? But I wanted to document since the behavior differs from typing manually in the browser.
How to reproduce:
The text was updated successfully, but these errors were encountered: