You are here

public function VarbaseContext::iFillInFieldUnderTheEditorMediaBrowser in Varbase: The Ultimate Drupal CMS Starter Kit (Bootstrap Ready) 9.0.x

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

Fill in a form field with id|name|title|alt|value.

Under the editor media browser. Varbase Context #varbase.

Example: I fill in "flag earth" for "File name" under the editor media browser.

@When /^(?:|I )fill in "(?P<field>(?:[^"]|\\")*)" with "(?P<value>(?:[^"]|\\")*)" under (?:|the )editor media browser$/ @When /^(?:|I )fill in "(?P<field>(?:[^"]|\\")*)" with: under (?:|the )editor media browser$/ @When /^(?:|I )fill in "(?P<value>(?:[^"]|\\")*)" for "(?P<field>(?:[^"]|\\")*)" under (?:|the )editor media browser$/

File

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

Class

VarbaseContext
Defines application features from the specific context.

Code

public function iFillInFieldUnderTheEditorMediaBrowser($field, $value) {

  // Switch to the "entity_browser_iframe_editor_media_browser" iframe.
  $this
    ->getSession()
    ->switchToIFrame('entity_browser_iframe_editor_media_browser');
  $field = str_replace('\\"', '"', $field);
  $value = str_replace('\\"', '"', $value);
  $this
    ->getSession()
    ->getPage()
    ->fillField($field, $value);

  // Switch back too the page from the "entity_browser_iframe_editor_media_browser" iframe.
  $this
    ->getSession()
    ->switchToIFrame(NULL);
}