Skip to content

edcesar/laravel-dusk-select2

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation




Introduction

Select2.js support for the Laravel Dusk testing. Support Select2 v3 and Select2 v4 versions.

Demo

P.S. This gif slow because I forgot to set third parameter to one or zero.

Install

composer require --dev roquie/laravel-dusk-select2

Now, u may use it!

Upgrade from 0.1.* to 1.0.*

  1. Update your roquie/laravel-dusk-select2 dependency to ^1.0 in your composer.json file.
  2. Remove + .select2 from first parameter, also see last parameter.

Usage

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.

Examples

Here.

Todo

  • 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.

Tests

@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.

License

MIT

About

Select2.js support for the Laravel Dusk testing

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • HTML 51.3%
  • PHP 48.7%