public function FeatureContext::iFrameInBodyDescriptionShouldHaveTheSrc in Open Social 8
Same name and namespace in other branches
- 8.2 tests/behat/features/bootstrap/FeatureContext.php \FeatureContext::iFrameInBodyDescriptionShouldHaveTheSrc()
@Then /^The iframe in the body description should have the src "([^"]*)"$/
File
- tests/
behat/ features/ bootstrap/ FeatureContext.php, line 116
Class
- FeatureContext
- Defines application features from the specific context.
Code
public function iFrameInBodyDescriptionShouldHaveTheSrc($src) {
$cssSelector = 'article .card__body .body-text iframe';
$session = $this
->getSession();
$element = $session
->getPage()
->find('xpath', $session
->getSelectorsHandler()
->selectorToXpath('css', $cssSelector));
if (null === $element) {
throw new \InvalidArgumentException(sprintf('Could not evaluate CSS Selector: "%s"', $cssSelector));
}
$iframe_source = $element
->getAttribute('src');
if ($iframe_source !== $src) {
throw new \InvalidArgumentException(sprintf('The iframe does not have the src: "%s"', $src));
}
}