You are here

public function VarbaseContext::iShouldSeeImageWithTheTitleTextUnderTheEditorMediaBrowser in Varbase: The Ultimate Drupal CMS Starter Kit (Bootstrap Ready) 8.8

Same name and namespace in other branches
  1. 8.4 tests/features/bootstrap/VarbaseContext.php \VarbaseContext::iShouldSeeImageWithTheTitleTextUnderTheEditorMediaBrowser()
  2. 8.5 tests/features/bootstrap/VarbaseContext.php \VarbaseContext::iShouldSeeImageWithTheTitleTextUnderTheEditorMediaBrowser()
  3. 8.6 tests/features/bootstrap/VarbaseContext.php \VarbaseContext::iShouldSeeImageWithTheTitleTextUnderTheEditorMediaBrowser()
  4. 8.7 tests/features/bootstrap/VarbaseContext.php \VarbaseContext::iShouldSeeImageWithTheTitleTextUnderTheEditorMediaBrowser()
  5. 9.0.x tests/features/bootstrap/VarbaseContext.php \VarbaseContext::iShouldSeeImageWithTheTitleTextUnderTheEditorMediaBrowser()

Find an image with the title text attribute.

Varbase Context #varbase.

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 452

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);
}