silverstripe-labs/silverstripe-behat-extension — pull request #12 by halkyon (2013-11-28 09:24:22+00:00)
Title: BUG Fixing issues where logging out steps aren't performed correctly.

Firstly, stepIAmNotLoggedIn() would previously just kill the test
session, but this has the side effect of losing the current testsession
temporary database, so this causes steps of logging out to fail the
rest of the steps in a scenario.

Secondly, if we're logging a user in with stepILogInWith(), make
sure they are logged out first, otherwise "You don't have permission"
message will appear, but there is no form elements available to log
in with in this case. Logging out first by visiting Security/login
fixes this.