无法使用 Laravel Dusk 测试输入类型 datetime-local

Cannot test input type datetime-local with Larave Dusk

我的表单中有以下代码。我需要让用户输入日期和时间。

<input type="datetime-local" class="form-control" id="collection_datetime" name="collection_datetime" required>

当尝试使用 Laravel Dusk 自动测试表单时,我总是会遇到错误。

这是我试过的

 ->type('collection_datetime', Carbon::now()->format('Y-m-d\TH:i'))
->type('collection_datetime', '12/31/2019 12:59 PM')

没有一个有效。 您可以给我的任何建议都将不胜感激。 谢谢

这是有效的,我希望它能帮助别人。 在我看来这很重要我希望有更漂亮的解决方案

                ->type('collection_datetime', '13')
                ->type('collection_datetime', 'sep')
                ->keys('#collection_datetime', ['{tab}'])
                ->type('collection_datetime', '2019')
                ->keys('#collection_datetime', ['{tab}'])
                ->type('collection_datetime', '0104AM')