mirror of
https://github.com/silverstripe/silverstripe-behat-extension
synced 2024-10-22 17:05:32 +02:00
API Changes for Authenticator refactor
This commit is contained in:
commit
4e0868e68d
@ -69,19 +69,16 @@ class LoginContext implements Context
|
|||||||
$loginUrl = $c->joinUrlParts($c->getBaseUrl(), $c->getLoginUrl());
|
$loginUrl = $c->joinUrlParts($c->getBaseUrl(), $c->getLoginUrl());
|
||||||
$this->getMainContext()->getSession()->visit($loginUrl);
|
$this->getMainContext()->getSession()->visit($loginUrl);
|
||||||
$page = $this->getMainContext()->getSession()->getPage();
|
$page = $this->getMainContext()->getSession()->getPage();
|
||||||
$forms = $page->findAll('xpath', '//form[contains(@action, "Security/LoginForm")]');
|
$form = $page->findById('MemberLoginForm_LoginForm');
|
||||||
assertNotNull($forms, 'Login form not found');
|
assertNotNull($form, 'Login form not found');
|
||||||
|
|
||||||
// Try to find visible forms again on login page.
|
// Try to find visible forms again on login page.
|
||||||
$visibleForm = null;
|
$visibleForm = null;
|
||||||
/** @var NodeElement $form */
|
/** @var NodeElement $form */
|
||||||
foreach ($forms as $form) {
|
|
||||||
if ($form->isVisible() && $form->find('css', '[name=Email]')) {
|
if ($form->isVisible() && $form->find('css', '[name=Email]')) {
|
||||||
$visibleForm = $form;
|
$visibleForm = $form;
|
||||||
}
|
}
|
||||||
}
|
assertNotNull($visibleForm, 'Could not find login email field');
|
||||||
|
|
||||||
assertNotNull($visibleForm, 'Could not find login form');
|
|
||||||
|
|
||||||
$emailField = $visibleForm->find('css', '[name=Email]');
|
$emailField = $visibleForm->find('css', '[name=Email]');
|
||||||
$passwordField = $visibleForm->find('css', '[name=Password]');
|
$passwordField = $visibleForm->find('css', '[name=Password]');
|
||||||
|
Loading…
Reference in New Issue
Block a user