minkphp / docs

Mink documentation
https://mink.behat.org
83 stars 44 forks source link

Update docs to highlight reset limitation in Selenium #51

Open j4m3s opened 9 years ago

j4m3s commented 9 years ago

I've come across a Selenium cookie clearance limitation (leading to session 'bleed' if a scenario ends on a different domain): minkphp/Mink#642

Please can you include this limitation in the updated docs? I had the impression that scenarios were isolated so it was a surprise when we found this particular case.

aik099 commented 9 years ago

More details:

When script that was using Mink opens pages from different domains and sets cookies on both of them, then calling Session::reset() would only remove cookies from domain belonging to currently opened page.

In general some drivers doesn't allow setting/removing cookies from other than current domain. To get cross-driver consistent behavior the drivers that can manage cookies on different domains, like Zombie, were restricted to current domain only as well.

stof commented 9 years ago

@aik099 note that ZombieDriver resets all cookies properly on reset (the goal for reset is to do the best resetting possible, not to implement the common denominator). So this limitation is only for Selenium, Selenium2 and Sahi.

@j4m3s if you want to contribute, this should probably be documented in https://github.com/minkphp/docs/blob/master/guides/session.rst#resetting-the-session

j4m3s commented 9 years ago

@stof am I right in thinking that scenarios are "soft isolated" by default (i.e. session is reset so cookies are cleared etc)?

My experience with phantomjs suggests not (see also this SO post from someone a while back: http://stackoverflow.com/questions/17279478/when-running-a-behat-login-test-through-phantomjs-it-only-passes-on-the-first-ru) - but I know selenium and Goutte do. I'm trying to find my feet before doing any documentation updating!

stof commented 9 years ago

@j4m3s yes, it is the case