RawDrupalContext::loggedIn() can return false positive #502
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The default
login_form_selector
is usingform#user-login
as a selector, but the actual drupal login form (at least for current d8) usesform#user-login-form
as the id. My guess is an update to underlying form changed this at some point (maybe during migration to drupal 8?)?This can ultimately cause false positives from
RawDrupalContext::loggedIn()
- in some scenarios the login is validated by manually checking the/user/login
page and looking for the form via this selector - if its not found, the user is assumed to be logged in. In this case even though the user is anonymous, the form is not found, so it returns true.I left the old selector in for any possible BC issues, similar to how the
logged_in_selector
works.For example, here's a blank site spun up w/ simplytest.me showing the actual selector:
![image](https://user-images.githubusercontent.com/8114580/44352973-af0f2600-a473-11e8-90f1-a3bd76490030.png)