You are here

private function EntityBrowserTrait::waitForEntityBrowserToClose in Lightning Media 8.4

Same name and namespace in other branches
  1. 8.3 tests/src/Traits/EntityBrowserTrait.php \Drupal\Tests\lightning_media\Traits\EntityBrowserTrait::waitForEntityBrowserToClose()

Waits for the current entity browser frame to close.

Parameters

string $id: (optional) The machine name of the entity browser whose frame we are in. Defaults to the value of $this->currentEntityBrowser.

2 calls to EntityBrowserTrait::waitForEntityBrowserToClose()
ImageBrowserCardinalityTest::testCardinality in modules/lightning_media_image/tests/src/FunctionalJavascript/ImageBrowserCardinalityTest.php
Tests that cardinality is enforced in the image browser.
ImageBrowserTest::testUpload in tests/src/FunctionalJavascript/ImageBrowserTest.php
Tests uploading an image in the image browser.

File

tests/src/Traits/EntityBrowserTrait.php, line 47

Class

EntityBrowserTrait
Contains methods for interacting with entity browsers in frames.

Namespace

Drupal\Tests\lightning_media\Traits

Code

private function waitForEntityBrowserToClose($id = NULL) {
  $id = $id ?: $this->currentEntityBrowser;
  $this
    ->assertNotEmpty($id);
  $this
    ->getSession()
    ->switchToIFrame(NULL);
  $this
    ->assertJsCondition("typeof window.entity_browser_iframe_{$id} === 'undefined'");
}