You are here

private function EntityBrowserTrait::waitForItems in Lightning Media 8.3

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

Waits for the current entity browser to have at least one selectable item.

Return value

\Behat\Mink\Element\NodeElement[] The selectable items.

9 calls to EntityBrowserTrait::waitForItems()
CKEditorMediaBrowserTest::testDocumentEmbed in tests/src/FunctionalJavascript/CKEditorMediaBrowserTest.php
Tests that the image embed plugin is not used to embed a document.
CKEditorMediaBrowserTest::testEditEmbed in tests/src/FunctionalJavascript/CKEditorMediaBrowserTest.php
Tests that the entity embed dialog opens when editing a pre-existing embed.
CKEditorMediaBrowserTest::testImageEmbed in tests/src/FunctionalJavascript/CKEditorMediaBrowserTest.php
Tests that the image embed plugin is used to embed an image.
CKEditorMediaBrowserTest::testUnlimitedCardinality in tests/src/FunctionalJavascript/CKEditorMediaBrowserTest.php
Tests that cardinality is never enforced in the media browser.
CKEditorMediaBrowserTest::waitForItemsCount in tests/src/FunctionalJavascript/CKEditorMediaBrowserTest.php
Waits for a specific number of selectable media items to be present.

... See full list

File

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

Class

EntityBrowserTrait
Contains methods for interacting with entity browsers in frames.

Namespace

Drupal\Tests\lightning_media\Traits

Code

private function waitForItems() {
  $items = $this
    ->getSession()
    ->getPage()
    ->waitFor(10, function (DocumentElement $page) {
    return $page
      ->findAll('css', '[data-selectable]');
  });
  $this
    ->assertNotEmpty($items);
  return $items;
}