-
Notifications
You must be signed in to change notification settings - Fork 278
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cookies bleed between scenarios if last step is on a different domain #642
Comments
When using Selenium, we can indeed only remove cookies for the current domain when resetting the session. Btw, if you use Mink in Behat through MinkExtension, you can mark a scenario as needing a full restart of the session by tagging it as |
I realise I'm pushing the boundaries of this ticket but is the issue limited to Selenium? (i.e. would it work if we used zombie?). GoutteDriver isn't an option in this case as the Paypal sandbox depends so heavily on Javascript. I only exposed the problem by accident - would it be possible to output a warning of some form to tell users that this unexpected behaviour is taking place thanks to Selenium? It wasn't too serious in our case but I imagine it could cause a lot of head scratching for others wondering what was going on. I had convinced myself scenarios were insulated by default (though I'm not sure where I got that from :). Thanks for the info about |
ZombieDriver is also able to reset the session fully. Only Selenium and Sahi are limited to the current domain (because they are limited by what browsers are allowing from JS). We are currently in the process of rewriting the Mink documentation. Can you open an issue on the docs repo to ask to document this for session resetting ? Regarding stopping the session fully at the end of the scenario, I'm opening an issue on MinkExtension to add this feature |
Thank you :) I'll open the docs issue now. |
Mink v1.5.0, tests run using Selenium
We have acceptance tests that follow the user journey from our site (e.g. localhost) through to paypal, and have found that if the scenario ends on a PayPal page, the cookies from localhost are not cleared and (for example) a user remains logged-in at the start of the next scenario.
Adding a step calling getSession()->restart() at the end resolves the issue.
I haven't verified whether or not the issue occurs with Goutte too (as PayPal depends on javascript) - if it would help let me know and I'll create a test project.
The text was updated successfully, but these errors were encountered: