Skip to content

Commit

Permalink
At the start of a webdriver session the user is not logged in. (#366)
Browse files Browse the repository at this point in the history
  • Loading branch information
pfrenssen committed Jun 8, 2017
1 parent 3bb57c3 commit 0ab44c8
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/Drupal/DrupalExtension/Context/RawDrupalContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -508,8 +508,14 @@ public function logout() {
* Returns TRUE if a user is logged in for this session.
*/
public function loggedIn() {
$session = $this->getSession();
$page = $session->getPage();
// If there is no session or no page yet, this is a brand new test session
// and the user is not logged in.
if (!$session = $this->getSession()) {
return FALSE;
}
if (!$page = $session->getPage()) {
return FALSE;
}

// Look for a css selector to determine if a user is logged in.
// Default is the logged-in class on the body tag.
Expand Down

0 comments on commit 0ab44c8

Please sign in to comment.