Select2.js support for the Laravel Dusk testing. Support Select2 v3 and Select2 v4 versions.
P.S. This gif slow because I forgot to set third parameter to one or zero.
composer require --dev roquie/laravel-dusk-select2
Now, u may use it!
- Update your
roquie/laravel-dusk-select2
dependency to^1.0
in yourcomposer.json
file. - Remove
+ .select2
from first parameter, also see last parameter.
For default select2:
$browse->select2('@selector');
@selector
class name of your <select>
html tag.
If value not passed, it be selected automatically.
Another way, if need concrete value:
$browse->select2('@selector', 'you_text_value');
For multiple mode usage like this:
$browse->select2('@selector', ['foo', 'bar'], 5);
// the last parameter - count of seconds for ajax loading before choice item.
- Add Laravel Dusk tests for Laravel Dusk extend feature ;)
- Add gif demonstration how it works.
- May be use
+ select2
out of the box?. - Integration with Circle CI.
@taylorotwell don't kill the kittens, Laravel Dusk also should be used outside of the framework.
cd tests
php -S localhost:8888 tests/index.html
vendor/bin/phpunit
If u using MacOS, before running phpunit
, run vendor/laravel/dusk/bin/chromedriver-mac
.