Support the ongoing development of Laravel.io →
Authentication Session Testing
Last updated 2 years ago.
0

Hi Martin,

Although this is a delayed response, hopefully it can partially help others.

Using the "Auth::login" or "Auth::loginUsingId" is not going to help - as that's logging in via the command line part of behat, whereas the broswer side (I imagine you're using Mink or something?) does not get that session data, so it is not logged in for that part.

I'm still trying to figure out how it can be done, but will let you know if I find out.

Last updated 2 years ago.
0

Hello,

I wrote an article on how to set up the php testing framework Behat in order to use it with the Laravel framework in a Homestead development environment. It mentions the problems one faces when testing authentication in a testing environment.

http://blog.g-design.net/post/88422737295/using-behat-with-laravel-homestead

I hope this helps.

Last updated 2 years ago.
0

Hi,

I just blogged about how to share set a session when using a separate server with Behat. The approach can be used with Homestead, Artisan Serve or any other separate server.

It involves passing the session cookie to the Goutte or Selenium session.

http://www.label305.com/laravel/mink/behat/session/2015/01/23/Handle-authenticated-users-when-using-Behat-and-Mink-with-Laravel.html

Regards!

Last updated 9 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.