stepIWillSeeALogInMessage now allows for other form message types.

Not just "bad", but others like "good", "required", and "warning".
This commit is contained in:
Sean Harvey 2013-11-28 22:50:58 +13:00
parent d4006b9735
commit 8da0dbaea5
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

@ -144,21 +144,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.');
} }
/** /**