Merge pull request #14 from halkyon/message_rework

stepIWillSeeALogInMessage now allows for other form message types.
This commit is contained in:
Ingo Schommer 2013-11-28 15:23:50 -08:00
commit aa31606dde
2 changed files with 5 additions and 8 deletions

View File

@ -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

View File

@ -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));
}
/**