You are here

private function EntityBrowserTrait::waitForItems 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::waitForItems()

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

Return value

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

1 call to EntityBrowserTrait::waitForItems()
ImageBrowserCardinalityTest::testCardinality in modules/lightning_media_image/tests/src/FunctionalJavascript/ImageBrowserCardinalityTest.php
Tests that cardinality is enforced in the image browser.

File

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

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;
}