Pre-conditions - in my text form "," sign not allowed to input
Input inside type() func:
1,99
Output:
1
199
It worked in previous version of cypress correctly and problem I met in 3.8.0
Just try to type from tests some signs that couldn't be written.
Cypress 3.8.0
OS: Mac Mojave
Browser: Chrome
What is the type of your input? We've also noticed some difference in recent versions and tracked it down to these regexp: https://github.com/cypress-io/cypress/blob/6ed8d31cf045acd486757474934ef84f5f96cb74/packages/driver/src/cy/keyboard.ts#L65
To be honest I don't think that automation framework should do this at all.
This is only for number inputs, and Cypress has to do this because they replicate certain browser / html functionality, unlike Selenium.
But I agree, something went really quite wrong with the number input in 3.8.0.
What is the type of your input? We've also noticed some difference in recent versions and tracked it down to these regexp:
I'm using them as string obj. Should I prefer to use them as a number type or it doesn't matter?
@abaybabaydabudidabuday Can you paste in the html of the input element? We want to know the type attribute. Should look something like:
<input type="???" />
I verified this behavior in 3.8.0.
When typing manually, I can type 1 , 0 0 0 where the , does not display in the input, but the entire 1000 is set as the value.
index.html
<!DOCTYPE html>
<html>
<body>
<input type="number"/>
</body>
</html>
it('Type in number', () => {
cy.visit('index.html')
cy.get('input').type('1,000')
})

Events table when clicking on 'type' command

You can see the test run where it only has 1 in the value.

Events table when clicking on 'type' command. Seems like the input event is never firing for the , + 0 characters.

Roll back to 3.7.0 in the meantime.
The code for this is done in cypress-io/cypress#6033, but has yet to be released.
We'll update this issue and reference the changelog when it's released.
Released in 3.8.1.