public function VarbaseContext::iShouldSeeImageWithTheTitleTextUnderTheEditorMediaBrowser in Varbase: The Ultimate Drupal CMS Starter Kit (Bootstrap Ready) 8.6
Same name and namespace in other branches
- 8.8 tests/features/bootstrap/VarbaseContext.php \VarbaseContext::iShouldSeeImageWithTheTitleTextUnderTheEditorMediaBrowser()
- 8.4 tests/features/bootstrap/VarbaseContext.php \VarbaseContext::iShouldSeeImageWithTheTitleTextUnderTheEditorMediaBrowser()
- 8.5 tests/features/bootstrap/VarbaseContext.php \VarbaseContext::iShouldSeeImageWithTheTitleTextUnderTheEditorMediaBrowser()
- 8.7 tests/features/bootstrap/VarbaseContext.php \VarbaseContext::iShouldSeeImageWithTheTitleTextUnderTheEditorMediaBrowser()
- 9.0.x tests/features/bootstrap/VarbaseContext.php \VarbaseContext::iShouldSeeImageWithTheTitleTextUnderTheEditorMediaBrowser()
#varbase : To Find an image with the title text attribute.
Example 1: Then I should see image with the "Flag Earth" title text
@Then /^I should see image with the "([^"]*)" title text under (?:|the )editor media browser(?:| modal window)$/
File
- tests/
features/ bootstrap/ VarbaseContext.php, line 397
Class
- VarbaseContext
- Defines application features from the specific context.
Code
public function iShouldSeeImageWithTheTitleTextUnderTheEditorMediaBrowser($titleText) {
// Switch to the "entity_browser_iframe_editor_media_browser" iframe.
$this
->getSession()
->switchToIFrame('entity_browser_iframe_editor_media_browser');
// Find an image with the title.
$element = $this
->getSession()
->getPage()
->find('xpath', "//img[contains(@title, '{$titleText}')]");
if (empty($element)) {
throw new Exception('The editor media browser dose not have an image with the [ ' . $titleText . ' ] title text.');
}
// Switch back too the page from the "entity_browser_iframe_editor_media_browser" iframe.
$this
->getSession()
->switchToIFrame(null);
}