Cypress: Cannot type on datetime-local input

Created on 15 Oct 2018  路  10Comments  路  Source: cypress-io/cypress

Hi, i'm trying to type on an input of datetime-local type.
On the documentation, it says that datetime-local is supported but nothing was never typed, no matter how I tried to type it type.('10102019{rightarrow1010pm}',type.('000000000000pm}').
Also, in this #1366 issue has a workaround. but both did not work.
It does select the input, but never types.

ready for work bug

Most helpful comment

So, i did some more tests and this is what i found out:
Code:

cy
  .get("input[type=\"datetime-local\"]:first")
  .type("1959-09-13T10:10");
Error:
The specified value "1" does not conform to the required format
The format is "yyyy-MM-ddThh:mm" followed by optional ":ss" or ":ss.SSS".
The specified value "9" does not conform to the required format
The format is "yyyy-MM-ddThh:mm" followed by optional ":ss" or ":ss.SSS".
The specified value "5" does not conform to the required format
The format is "yyyy-MM-ddThh:mm" followed by optional ":ss" or ":ss.SSS".
... for all numbers of datetime

I have tried with input type date and works fine

All 10 comments

Hi @keryar, are you seeing any errors with the type commands you wrote?

No errors, the cy.get() returns the input, and the .type() apparently types, because it goes through as it really typed. But nothing is displayed.

Hi, i also have the same problem. I try all combinations of date i can remember.
The documentation says about date and time inputs but not datetime. Is that working? If yes can you give us an example?

Thanks

I think the difference here in this case from others I had is that this one acts like everything went fine, even though nothing was writen.

So, i did some more tests and this is what i found out:
Code:

cy
  .get("input[type=\"datetime-local\"]:first")
  .type("1959-09-13T10:10");
Error:
The specified value "1" does not conform to the required format
The format is "yyyy-MM-ddThh:mm" followed by optional ":ss" or ":ss.SSS".
The specified value "9" does not conform to the required format
The format is "yyyy-MM-ddThh:mm" followed by optional ":ss" or ":ss.SSS".
The specified value "5" does not conform to the required format
The format is "yyyy-MM-ddThh:mm" followed by optional ":ss" or ":ss.SSS".
... for all numbers of datetime

I have tried with input type date and works fine

Any news on this?

@sadplace yes, this is going in along with native events #2436

Just wanted to check in as well -- has this been fixed? I'm having a similar issue with the same console log. Including it here.

image

I'm checking this documentation out as well and datetime-local doesn't have supplementary info. But I'm assuming the format is yyyy-MM-ddThh:mm because that's what the console says.

https://docs.cypress.io/api/commands/type.html

The date input works fine!

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

Released in 3.5.0.

Was this page helpful?
0 / 5 - 0 ratings