Laravel Dusk Test Hanging On Login Hi
I'm just getting started with Dusk and am failing at the first hurdle! I'm simply trying to login to my application and see the dashboard.
However, it just hangs on http://myurl.dev/_dusk/login/1 and then fails saying it couldn't see the expected text.
Here's my test...
function test_it_displays_the_dashboard()
{
$user = factory(User::class)->create();
$this->browse(function ($browser) use ($user) {
$browser->loginAs($user)
->visit('/dashboard')
->assertSee('Dashboard');
});
}
Any ideas what's going wrong?
Thanks
I think this was actually caused by the user not having permission to view the page (my bad), however, it was just getting stuck on the url, and not returning to one of my application pages. With the flash error message.
If anyone else finds this thread check the permission of the user, it might be the problem.
I'm having the same issue, currently running Laravel 5.4 through Homestead. How did you fix this?
@gabiyo In my case, I was trying to access a part of my application as a normal user when it needed to be a super user with admin privileges
I am having the exact same problem.
It seems like $browser->loginAs($user) does not work at all.
Any help would be much appreciated.
Having the same issue also. Mine returns a blank page.
Please sign in or create an account to participate in this conversation.