Dusk test not working as expected

Posted 4 months ago by rajcoder

I am using dusk for testing and have encountered a problem.

I have 2 test functions in ExampleTest file.

In the first test, I am creating a factory user and logging him through login form and asserting that user should see home. This works.

But the second test, where I again visit login page and enter wrong credentials, fails as I guess it somehow maintains the session for the user and thus going to /login redirects back to /home.

What is the problem? How can I remove the logged in user after method gets over ?

Please sign in or create an account to participate in this conversation.

Laracasts Mascot

Hi, Have We Met Yet?

Did you know that, in addition to the forum, Laracasts includes well over 1000 lessons on modern web development? All for the price of one lunch out per month.

Sign Me Up

Channels

Reply to

Use Markdown with GitHub-flavored code blocks.