-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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() does not input a minus operation if a symbol or letter is typed before a number in a number field #6055
.type() does not input a minus operation if a symbol or letter is typed before a number in a number field #6055
Comments
I have confirmed the This bug was introduced in 3.7.0 and not fixed in the 3.8.1 patch #6033
<!DOCTYPE html>
<html>
<body>
<input type="number">
</body>
</html> it('types - char', () => {
cy.visit('index.html')
cy.get('input').type('-2')
.should('have.value', '-2') // passes!
})
it('does not type - char', () => {
cy.visit('index.html')
cy.get('input').type('-a2')
.should('have.value', '-2') // fails :(
}) 3.7.03.8.03.8.1Console Table of Events WorkaroundRoll back to use Cypress version 3.7.0 |
Fix edge case introduced into cypress-io#6033 about typing invalid number Fixes cypress-io#6055
Hi there ! This issue isn't marked as 'help wanted' but I did had the same problem as the OP. Since I didn't wanted to roll back on v3.7.0, I did a fix and opened a PR fixing this issue. |
The code for this is done in cypress-io/cypress#6121, but has yet to be released. |
Released in 3.8.2 |
Current behavior:
Using
cy.get('input').type('-a2')
or '-&2' or other invalid symbols outputs "2", whereas manually typing them outputs -2.Desired behavior:
The code above should output -2 ignoring the invalid symbols.
Steps to reproduce: (app code and test code)
Use the type command to input a minus operation followed by a symbol and then a number e.g. "-a2" or "-&2" into a number field.
Versions
3.8.1
The text was updated successfully, but these errors were encountered: