You are here

public function FeatureContext::assertModalWindowWithTitle in Acquia Lift Connector 7.2

Same name and namespace in other branches
  1. 7 behat-tests/features/bootstrap/FeatureContext.php \FeatureContext::assertModalWindowWithTitle()

@Then /^I should see the modal with title "([^"]*)"$/

Throws

\Exception If the modal with the specified title cannot be found on the page or is invisible.

File

behat-tests/features/bootstrap/FeatureContext.php, line 563

Class

FeatureContext
Defines application features from the specific context.

Code

public function assertModalWindowWithTitle($title) {
  $region = $this
    ->getRegion('modal_title');
  if (!$region || !$region
    ->isVisible()) {
    throw new \Exception(sprintf('The modal dialog titled %s is not visible on the page %s', $title, $this
      ->getSession()
      ->getCurrentUrl()));
  }
  $regionText = $region
    ->getText();
  if (strpos($regionText, $title) === FALSE) {
    throw new \Exception(sprintf("The title '%s' was not found in the modal title region on the page %s", $title, $this
      ->getSession()
      ->getCurrentUrl()));
  }
}