public function FeatureContext::assertTextInMessagebox in Acquia Lift Connector 7
Same name and namespace in other branches
- 7.2 behat-tests/features/bootstrap/FeatureContext.php \FeatureContext::assertTextInMessagebox()
@Then I should see the message :text in the messagebox
File
- behat-tests/features/ bootstrap/ FeatureContext.php, line 551 
Class
- FeatureContext
- Defines application features from the specific context.
Code
public function assertTextInMessagebox($text) {
  $this
    ->spinUntilMessageBoxIsPopulated();
  $script = "return jQuery('#acquia-lift-message-box').find('.message').text();";
  $message = $this
    ->getSession()
    ->evaluateScript($script);
  if (strpos($message, $text) === FALSE) {
    throw new \Exception(sprintf('The message "%s" was not found in the messagebox.', $text));
  }
}