From b0ae533b2f34b1941309ac264079ef7ab63e5abf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Norman=20K=C3=A4mper-Leymann?= Date: Wed, 23 Jan 2019 11:19:34 +0100 Subject: [PATCH] Language neutral login. Closes #524 --- src/Drupal/DrupalExtension/Context/RawDrupalContext.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Drupal/DrupalExtension/Context/RawDrupalContext.php b/src/Drupal/DrupalExtension/Context/RawDrupalContext.php index e034404b..8da4e999 100644 --- a/src/Drupal/DrupalExtension/Context/RawDrupalContext.php +++ b/src/Drupal/DrupalExtension/Context/RawDrupalContext.php @@ -547,9 +547,9 @@ public function login(\stdClass $user) { $this->getSession()->visit($this->locatePath('/user')); $element = $this->getSession()->getPage(); - $element->fillField($this->getDrupalText('username_field'), $user->name); - $element->fillField($this->getDrupalText('password_field'), $user->pass); - $submit = $element->findButton($this->getDrupalText('log_in')); + $element->fillField('name', $user->name); + $element->fillField('pass', $user->pass); + $submit = $element->find('xpath', '//form[@id="user-login-form"]')->find('xpath', '//input[@type="submit"]'); if (empty($submit)) { throw new \Exception(sprintf("No submit button at %s", $this->getSession()->getCurrentUrl())); }