Testing a date input field with Laravel Dusk

Stefan Ledin
1 min readMay 6, 2020

--

Here’s a quick tip for those out there who tries to test an <input type="date"> field with Laravel Dusk.

->type('#birthday', '1990-01-01') doesn’t work the way you expect, but this does:

->keys('#birthday', '1990', '{tab}', '01', '01')

--

--

Stefan Ledin

Web developer who makes fast WordPress sites with clean code and awesome backends. Also, JavaScript is nice!