-
Notifications
You must be signed in to change notification settings - Fork 30
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
BUG Fixing logout issues with steps #12
Conversation
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.
I had this in working as well. :) except I defined it as I will be logged out of the CMS instead because the test is to specific to the CMS and will probably cause lingering issues later if different users are required to log in and out of a website |
@srizzling When you log out there's no difference between logging out of the CMS and the website, everything goes through Security/login or Security/logout. Could you explain what you mean (and what you did) by logging out of the CMS instead of website? |
So, if I created a website which provided a service where users login it would still go through Security/login? |
@srizzling Yes. So if you had a "frontend" members page, users would go through Security/login. Likewise, logging into /admin takes the user to Security/login where they login and are redirected back to /admin. |
Ah, my bad. Maybe, we could extract that string and put it in context class similar to how $c->getLoginUrl() works? |
@srizzling Could do, although |
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. See #12
I've pushed the |
Fixing hardcoded queries that are MySQL specific.
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.