You are here

public function FeatureContext::iShouldSeeTheImage in Bear 7

@When /^I should see the "([^"]*)" image$/

File

tests/features/bootstrap/FeatureContext.php, line 177

Class

FeatureContext
Defines application features from the specific context.

Code

public function iShouldSeeTheImage($file) {
  $escapedValue = $this
    ->getSession()
    ->getSelectorsHandler()
    ->xpathLiteral($file);
  $image = $this
    ->getSession()
    ->getPage()
    ->find('named', array(
    'link',
    $escapedValue,
  ));
  if (!$image) {
    throw new \Exception(sprintf('Image "%s" was not found on the page %s', $file, $this
      ->getSession()
      ->getCurrentUrl()));
  }
}