driver: add support for date inputs

This commit is contained in:
Chris Breiding
2017-05-23 10:48:05 -04:00
parent 1aa716f329
commit c62d329bc1
6 changed files with 103 additions and 22 deletions
+4
View File
@@ -190,6 +190,10 @@ cy.get("body").type("{uparrow}{uparrow}{downarrow}{downarrow}{leftarrow}{rightar
cy.get("body").type("{shift}", {release: false}).get("li:first").click()
```
# Date inputs
Using `cy.type()` on a date input (`<input type="date">`) requires specifying a valid date in the format `yyyy-MM-dd`, e.g. `"1999-12-31"`. This isn't exactly how a user would type into a date input, but is a workaround since date input support varies between browsers and the format varies based on locale. `yyyy-MM-dd` is the format required by [the W3 spec](https://www.w3.org/TR/html5/forms.html#date-state-(type=date)) and is what the input's `value` will be set to regardless of browser or locale.
# Known Issues
## Native `input[type=date,datetime,datetime-local,month,year,color]`