public function VarbaseContext::iClickOnTheTabUnderTheMediaBrowser in Varbase: The Ultimate Drupal CMS Starter Kit (Bootstrap Ready) 8.7
Same name and namespace in other branches
- 8.8 tests/features/bootstrap/VarbaseContext.php \VarbaseContext::iClickOnTheTabUnderTheMediaBrowser()
 - 8.4 tests/features/bootstrap/VarbaseContext.php \VarbaseContext::iClickOnTheTabUnderTheMediaBrowser()
 - 8.5 tests/features/bootstrap/VarbaseContext.php \VarbaseContext::iClickOnTheTabUnderTheMediaBrowser()
 - 8.6 tests/features/bootstrap/VarbaseContext.php \VarbaseContext::iClickOnTheTabUnderTheMediaBrowser()
 - 9.0.x tests/features/bootstrap/VarbaseContext.php \VarbaseContext::iClickOnTheTabUnderTheMediaBrowser()
 
#varbase : To click on a tab under the editor media browser.
Example 1: When I click on the "Library" tab under the editor media browser Example 2: When I click on the "My files" tab under the editor media browser
@When /^I click on the "([^"]*)" tab under the editor media browser$/
File
- tests/
features/ bootstrap/ VarbaseContext.php, line 299  
Class
- VarbaseContext
 - Defines application features from the specific context.
 
Code
public function iClickOnTheTabUnderTheMediaBrowser($text) {
  // Switch to the "entity_browser_iframe_editor_media_browser" iframe.
  $this
    ->getSession()
    ->switchToIFrame('entity_browser_iframe_editor_media_browser');
  // Find the Tab by txt
  $element = $this
    ->getSession()
    ->getPage()
    ->find('xpath', "//*[contains(@class, 'ui-tabs-anchor') and text() = '{$text}']");
  if (empty($element)) {
    throw new Exception('The editor media browser dose not have [ ' . $text . ' ] tab.');
  }
  $element
    ->click();
  // Switch back too the page from the "mediaBrowser" iframe.
  $this
    ->getSession()
    ->switchToIFrame(null);
}