-
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
{enter} on input type=number leads to invalid input (3.8.0 regression) #5968
{enter} on input type=number leads to invalid input (3.8.0 regression) #5968
Comments
@Narretz I'm not able to recreate this from the code provided in 3.8.0 in Electron 78 or Chrome 79. Can you double check the provided code exactly and see if the error occurs for you? Thanks. The code I ran with no other settings:
<!DOCTYPE html>
<html>
<body>
<input type="number" id="input" />
</body>
</html>
it('types', function () {
cy.visit('index.html')
cy.get('#input')
.type('2')
.type('{enter}')
}) |
Hi @jennifer-shehane thanks for the quick response. Since the screenshot seems to be showing the end of the test run, then it's also showing the wrong result I mentioned - the input shouldn't be empty, it should still have the 2 in it. Did you check the console for the message / warning? (There will be no error in the test log, so the result being "green" is expected) |
@jennifer-shehane do you need anything else for this issue? |
@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. <!DOCTYPE html>
<html>
<body>
<input type="number" id="input" />
</body>
</html> it('types', function () {
cy.visit('index.html')
cy.get('#input')
// doing .type('2{enter}`) causes same error
.type('2')
.type('{enter}')
.should('have.value', '2')
}) 3.7.03.8.0
|
Thanks! Next time I will include a failing test. |
I believe I have a similar issue. When typing '0500' or any number with 0 at the start will results in the input only being 0. |
The code for this is done in cypress-io/cypress#6033, but has yet to be released. |
Released in |
Current behavior:
when you type a number in an number input and then type enter, the input becomes empty and the console logs an error:
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:
spec code:
Versions
Cypress 3.8.0
edit: Chrome 79 with cypress run
Possibly related to #5854
The text was updated successfully, but these errors were encountered: