Dusk test not working as expected

Posted 7 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.

Reply to

Use Markdown with GitHub-flavored code blocks.