FIX Add support in "I should see a message" step definition for Bootstrap alerts

This commit is contained in:
Robbie Averill 2018-09-14 11:19:53 +02:00
parent 0a64b07b2c
commit 274657f4f8

View File

@ -85,7 +85,13 @@ class CmsUiContext implements Context
*/
public function iShouldSeeAMessage($message)
{
$this->getMainContext()->assertElementContains('.message', $message);
$page = $this->getMainContext()->getSession()->getPage();
if ($page->find('css', '.message')) {
$this->getMainContext()->assertElementContains('.message', $message);
} else {
// Support for new Bootstrap alerts
$this->getMainContext()->assertElementContains('.alert', $message);
}
}
protected function getCmsTabsElement()