mirror of
https://github.com/silverstripe/silverstripe-behat-extension
synced 2024-10-22 17:05:32 +02:00
Merge pull request #14 from halkyon/message_rework
stepIWillSeeALogInMessage now allows for other form message types.
This commit is contained in:
commit
aa31606dde
@ -528,7 +528,7 @@ It's based on the `vendor/bin/behat -di @cms` output.
|
||||
|
||||
Given /^I should see a log-in form$/
|
||||
|
||||
Then /^I will see a bad log-in message$/
|
||||
Then /^I will see a "bad" log-in message$/
|
||||
|
||||
### CMS UI
|
||||
|
||||
|
@ -147,21 +147,18 @@ class LoginContext extends BehatContext
|
||||
public function stepIShouldSeeALogInForm()
|
||||
{
|
||||
$page = $this->getSession()->getPage();
|
||||
|
||||
$loginForm = $page->find('css', '#MemberLoginForm_LoginForm');
|
||||
assertNotNull($loginForm, 'I should see a log-in form');
|
||||
}
|
||||
|
||||
/**
|
||||
* @Then /^I will see a bad log-in message$/
|
||||
* @Then /^I will see a "([^"]*)" log-in message$/
|
||||
*/
|
||||
public function stepIWillSeeABadLogInMessage()
|
||||
public function stepIWillSeeALogInMessage($type)
|
||||
{
|
||||
$page = $this->getSession()->getPage();
|
||||
|
||||
$badMessage = $page->find('css', '.message.bad');
|
||||
|
||||
assertNotNull($badMessage, 'Bad message not found.');
|
||||
$message = $page->find('css', sprintf('.message.%s', $type));
|
||||
assertNotNull($message, sprintf('%s message not found.', $type));
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user