netojose / laravel-bootstrap-4-forms

Bootstrap 4 forms for Laravel 5/6/7/8
MIT License
183 stars 58 forks source link

Added Laravel Dusk Element Shortcut #109

Open frankyso opened 3 years ago

frankyso commented 3 years ago

The Problem

I always use this package when developing with the Laravel framework and bootstrap, it's just a little difficult when making browser testing because to define selectors for text I wrote a fairly long code for the dusk selector like the example below:

Form::text('username', 'Username')->attrs(['dusk' => 'username'])

to generate an input like this

<input dusk="username" name="username">

The Idea

I'm thinking of adding a Laravel Dusk selector to make it easier for us to choose elements that will be used for automated browser testing later.

This PR will add a new function to specify the dusk selector directly into the element. as an example :

Form::text('username', 'Username')->dusk('username');

thank you for this wonderful package 🥇