diff --git a/vendor/drupal/drupal-extension/src/Drupal/DrupalExtension/Context/RawDrupalContext.php b/vendor/drupal/drupal-extension/src/Drupal/DrupalExtension/Context/RawDrupalContext.php
index cdff095..b8569ca 100644
--- a/vendor/drupal/drupal-extension/src/Drupal/DrupalExtension/Context/RawDrupalContext.php
+++ b/vendor/drupal/drupal-extension/src/Drupal/DrupalExtension/Context/RawDrupalContext.php
@@ -416,7 +416,7 @@ public function login() {
 
     $this->getSession()->visit($this->locatePath('/user'));
     $element = $this->getSession()->getPage();
-    $element->fillField($this->getDrupalText('username_field'), $this->user->name);
+    $element->fillField($this->getDrupalText('username_field'), $this->user->mail);
     $element->fillField($this->getDrupalText('password_field'), $this->user->pass);
     $submit = $element->findButton($this->getDrupalText('log_in'));
     if (empty($submit)) {
@@ -427,7 +427,7 @@ public function login() {
     $submit->click();
 
     if (!$this->loggedIn()) {
-      throw new \Exception(sprintf("Failed to log in as user '%s' with role '%s'", $this->user->name, $this->user->role));
+      throw new \Exception(sprintf("Failed to log in as user '%s' with role '%s'", $this->user->mail, $this->user->role));
     }
   }
 
