beyondcode / dusk-dashboard

A beautiful dashboard for your Laravel Dusk tests
https://pociot.dev/8-introducing-laravel-dusk-dashboard
MIT License
558 stars 62 forks source link

Add action collectors to scoped component browser instances #51

Open nie7321 opened 5 years ago

nie7321 commented 5 years ago

This fixes the error from #50 by wrapping the scoped callback with another callback to inject the action collector.

It is an imperfect solution -- since onComponent is called before the callback is evaluated in Laravel\Dusk\Browser, I cannot think of a nice way to get the correct action collector instance in place for a component's assert() method.

I could copy-paste the method definition, but that seems kinda gross and brittle. Does anyone have any ideas?

doroshenkoss commented 4 years ago

Have almost same problem. I'd appreciate all the help I can get. Thanks!