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$/ 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 ### CMS UI

View File

@ -147,21 +147,18 @@ class LoginContext extends BehatContext
public function stepIShouldSeeALogInForm() public function stepIShouldSeeALogInForm()
{ {
$page = $this->getSession()->getPage(); $page = $this->getSession()->getPage();
$loginForm = $page->find('css', '#MemberLoginForm_LoginForm'); $loginForm = $page->find('css', '#MemberLoginForm_LoginForm');
assertNotNull($loginForm, 'I should see a log-in form'); 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(); $page = $this->getSession()->getPage();
$message = $page->find('css', sprintf('.message.%s', $type));
$badMessage = $page->find('css', '.message.bad'); assertNotNull($message, sprintf('%s message not found.', $type));
assertNotNull($badMessage, 'Bad message not found.');
} }
/** /**