title: Laravel Dusk and Select2
body: <p>I'm working with Laravel 8 and for the screen tests I'm using Dusk (<a href="https://laravel.com/docs/8.x/dusk" rel="nofollow noreferrer">https://laravel.com/docs/8.x/dusk</a>).</p>
  <p>In one of the screens, i have a select2 with &quot;tags&quot; property enabled (<a href="https://select2.org/tagging" rel="nofollow noreferrer">https://select2.org/tagging</a>), that allows you to create a new record if there is no option in select.</p>
  <p>I just cant the test &quot;Create a new option for select2 with dusk&quot; work for some reason</p>
  <p>I've tried using this package (<a href="https://github.com/roquie/laravel-dusk-select2" rel="nofollow noreferrer">https://github.com/roquie/laravel-dusk-select2</a>) and also using scripts (<a href="https://laravel.com/docs/8.x/dusk#executing-javascript" rel="nofollow noreferrer">https://laravel.com/docs/8.x/dusk#executing-javascript</a>) to get this result, but in none of the cases successful.</p>
  <pre><code>Blade
  
  &lt;select 
      class=&quot;select2&quot; 
      name=&quot;nome&quot; 
      required
  &gt;
      &lt;option value=&quot;1&quot;&gt;Teste 1&lt;/option&gt;
      &lt;option value=&quot;2&quot;&gt;Teste 2&lt;/option&gt;
  &lt;/select&gt;
  
  Js
  
  $('.select2').select2({ 
      tags: true,
  });
  </code></pre>