mirror of
https://github.com/silverstripe/silverstripe-behat-extension
synced 2024-10-22 17:05:32 +02:00
More resilient login form detection (works with absolute URLs and GET params)
This commit is contained in:
parent
0a6854590d
commit
8956b2d4fa
@ -124,7 +124,7 @@ class LoginContext extends BehatContext
|
||||
public function stepILogInWith($email, $password)
|
||||
{
|
||||
$page = $this->getSession()->getPage();
|
||||
$forms = $page->findAll('css', 'form[action="Security/LoginForm"]');
|
||||
$forms = $page->findAll('xpath', '//form[contains(@action, "Security/LoginForm")]');
|
||||
assertNotNull($forms, 'Login form not found');
|
||||
|
||||
// Try to find visible forms on current page
|
||||
@ -142,7 +142,7 @@ class LoginContext extends BehatContext
|
||||
$loginUrl = $c->joinUrlParts($c->getBaseUrl(), $c->getLoginUrl());
|
||||
$this->getSession()->visit($loginUrl);
|
||||
$page = $this->getSession()->getPage();
|
||||
$forms = $page->findAll('css', 'form[action="Security/LoginForm"]');
|
||||
$forms = $page->findAll('xpath', '//form[contains(@action, "Security/LoginForm")]');
|
||||
}
|
||||
|
||||
// Try to find visible forms again on login page.
|
||||
|
Loading…
Reference in New Issue
Block a user