0
votes

Trying to test following input element

<input name="birthdate" id="#birthdate" class="input" type="date">

Through Laravel Dusk I've tried

$browser->type('birthdate', now()->toDateString())

end even

->type('birthdate', '31-01-2003')

->type('birthdate', '31-Jan-2003')

enter image description here enter image description here

No data is inserted and even Submit button is not pressed. Dump reveals that I will remain on the form without submitting.

Chrome version:

(Session info: headless chrome=71.0.3578.98)
(Driver info: chromedriver=2.45.615291 
"laravel/dusk","version": "v4.0.4",

Thanks

1
What versions of Dusk and Chrome are you using?Jonas Staudenmeir
added to my original post. I believe latest stable version both.Vojta
Have you seen github.com/laravel/dusk/issues/104? Does it work with type="text"?Jonas Staudenmeir
I did check this solution but unfortunately doesn't work. Also "text" type would pass the test however I need a date from user so typing "John Doe" instead of birth date would't be a solutionVojta

1 Answers

0
votes

Need to format it properly

->type('birthdate', $newuser->birthdate->format('mdY'))