{enter} on input type=number leads to invalid input (3.8.0 regression)
See original GitHub issueCurrent behavior:
when you type a number in an number input and then type enter, the input becomes empty and the console logs an error:
cypress_runner.js:107262 The specified value "12\n" is not a valid number. The value must match to the following regular expression: -?(\d+|\d+\.\d+|\.\d+)([eE][-+]?\d+)?
You can see that the {enter}
adds \n
to the input value.
Desired behavior:
It should set the value without \n
Steps to reproduce: (app code and test code)
html:
<input type="number" id="input" />
spec code:
cy.get('#input')
.type('2')
.type('{enter}')
Versions
Cypress 3.8.0 edit: Chrome 79 with cypress run
Possibly related to https://github.com/cypress-io/cypress/pull/5854
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
Why the number input is the worst input - Stack Overflow Blog
Either way when the number is invalid you can't get the actual value that appears on screen in the <input type="number"> field:
Read more >In Chrome why can the invalid input `1-1` be typed in an ...
But both of these values are invalid: input.value is the empty string. What is the logic behind this behavior? Example below for you...
Read more >Changelog — Python 3.11.1 documentation
SSLSession objects is no longer allowed as it lead to misconfigured ... Formerly, it did not convert the input type when for sequences...
Read more >Changelog - Cypress Documentation
Fixed an issue where the incorrect Cypress version could be shown in the ... We fixed a regression in 3.8.0 where using .type()...
Read more >PySimpleGUI
There are no pesky classes you are required to write, no callback functions to worry about. None of that is required to show...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@Narretz Right, sorry. It’s helpful to provide the incorrect failing test case. So, the assertion below incorrectly fails.
I do see the message in the console. I misread and thought that was an error throwing in the Test Runner directly.
3.7.0
3.8.0
2
console table{enter}
console tableReleased in
3.8.1
.