Laravel dusk doesn't see vuejs selectors Laravel dusk doesn't see vuejs selectors vue.js vue.js

Laravel dusk doesn't see vuejs selectors


The reason of that exception was that I was using 'npm run hot' instead of 'npm run prod'


To check if the element is on the page, you have to do this:

$browser->assertSee('Connection')

The connection is an example.

I also have difficulties to do dusk test. I can't press a button etc.


You can try adding dusk attribute to your HTML element, for example:

<div class="users" dusk="user-list">...</div>

In your test, use the following:

$browser    ->waitFor('@user-list');

The dusk="" attribute works as a custom selector to be used by Laravel Dusk to interact with the HTML elements on the page.

Reference:Testing Vue components with Laravel Dusk