You are here

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

Same name and namespace in other branches
  1. 8.8 tests/features/bootstrap/VarbaseContext.php \VarbaseContext::theMediaBrowserIsOpen()
  2. 9.0.x tests/features/bootstrap/VarbaseContext.php \VarbaseContext::theMediaBrowserIsOpen()

#varbase: To check if the media browser with the selected iframe id is open.

Example : Then the "entity_browser_iframe_media_browser" media browser should be open

@Then /^the "([^"]*)" media browser should be open$/

File

tests/features/bootstrap/VarbaseContext.php, line 1417

Class

VarbaseContext
Defines application features from the specific context.

Code

public function theMediaBrowserIsOpen($entityBrowserIframeId) {
  if (!($elem = $this
    ->getSession()
    ->getPage()
    ->find('css', '.ui-dialog.ui-widget-content'))) {
    throw new Exception('The media browser failed to open.');
  }
  $entityBrowserIframe = $this
    ->getSession()
    ->getPage()
    ->find('css', "#{$entityBrowserIframeId}");
  if (!$entityBrowserIframeId) {
    throw new \Exception("{$entityBrowserIframeId} is not found.");
  }
}