You are here

public function ThunderEntityBrowserTestTrait::openEntityBrowser in Thunder 8.5

Same name and namespace in other branches
  1. 8.2 tests/src/FunctionalJavascript/ThunderEntityBrowserTestTrait.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderEntityBrowserTestTrait::openEntityBrowser()
  2. 8.3 tests/src/FunctionalJavascript/ThunderEntityBrowserTestTrait.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderEntityBrowserTestTrait::openEntityBrowser()
  3. 8.4 tests/src/FunctionalJavascript/ThunderEntityBrowserTestTrait.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderEntityBrowserTestTrait::openEntityBrowser()
  4. 6.2.x tests/src/FunctionalJavascript/ThunderEntityBrowserTestTrait.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderEntityBrowserTestTrait::openEntityBrowser()
  5. 6.0.x tests/src/FunctionalJavascript/ThunderEntityBrowserTestTrait.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderEntityBrowserTestTrait::openEntityBrowser()
  6. 6.1.x tests/src/FunctionalJavascript/ThunderEntityBrowserTestTrait.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderEntityBrowserTestTrait::openEntityBrowser()

Open modal entity browser and switch into iframe from it.

Parameters

\Behat\Mink\Element\DocumentElement $page: Current active page.

string $drupalSelector: Drupal selector.

string $entityBrowser: Entity browser name.

2 calls to ThunderEntityBrowserTestTrait::openEntityBrowser()
MediaGalleryModifyTest::testAddRemove in tests/src/FunctionalJavascript/MediaGalleryModifyTest.php
Test add/remove Images in Gallery.
MediaImageModifyTest::testRemoveAdd in tests/src/FunctionalJavascript/MediaImageModifyTest.php
Test add/remove image in image paragraph.

File

tests/src/FunctionalJavascript/ThunderEntityBrowserTestTrait.php, line 25

Class

ThunderEntityBrowserTestTrait
Trait with support for handling Entity Browser actions.

Namespace

Drupal\Tests\thunder\FunctionalJavascript

Code

public function openEntityBrowser(DocumentElement $page, $drupalSelector, $entityBrowser) {
  $this
    ->clickButtonDrupalSelector($page, $drupalSelector);
  $this
    ->getSession()
    ->switchToIFrame('entity_browser_iframe_' . $entityBrowser);

  // Wait that iframe is loaded and jQuery is available.
  $this
    ->getSession()
    ->wait(10000, '(typeof jQuery !== "undefined")');
  $this
    ->assertSession()
    ->assertWaitOnAjaxRequest();
}