You are here

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

Selects an item in the current entity browser.

Parameters

\Behat\Mink\Element\NodeElement $item: The item element.

1 call to EntityBrowserTrait::selectItem()
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 78

Class

EntityBrowserTrait
Contains methods for interacting with entity browsers in frames.

Namespace

Drupal\Tests\lightning_media\Traits

Code

private function selectItem(NodeElement $item) {
  $result = $item
    ->waitFor(10, function (NodeElement $item) {
    $item
      ->click();
    return $item
      ->hasClass('selected') && $item
      ->hasCheckedField('Select this item');
  });
  $this
    ->assertTrue($result);
}