I'm doing automated testing using Laravel Dusk, when I do this:
$test = $browser->script('$(".page-sidebar-menu").text();');
dd($test);
It returns array of null, but if run $(".page-sidebar-menu").text(); in a browser, it returns all text inside that class.
Where I go wrong in here? Please help if you know.
Okay it's wrong of me to asked this, I not include return inside script it should be like this
$test = $browser->script('return $(".page-sidebar-menu").text();');
dd($test);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With