Skip to content

Commit

Permalink
Language neutral login.
Browse files Browse the repository at this point in the history
  • Loading branch information
leymannx authored Jan 23, 2019
1 parent 09508ea commit b0ae533
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Drupal/DrupalExtension/Context/RawDrupalContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()));
}
Expand Down

0 comments on commit b0ae533

Please sign in to comment.