roquie / laravel-dusk-select2 by Roquie

Select2.js support for the Laravel Dusk testing.
271,292
40
2
Package Data
Maintainer Username: Roquie
Maintainer Contact: roquie0@gmail.com (roquie)
Package Create Date: 2017-03-07
Package Last Update: 2021-02-04
Language: HTML
License: MIT
Last Refreshed: 2024-05-04 15:10:56
Package Statistics
Total Downloads: 271,292
Monthly Downloads: 5,849
Daily Downloads: 52
Total Stars: 40
Total Watchers: 2
Total Forks: 11
Total Open Issues: 2

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

  • [x] Add Laravel Dusk tests for Laravel Dusk extend feature ;)
  • [x] Add gif demonstration how it works.
  • [x] May be use + select2 out of the box?.
  • [x] 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