You are here

public function EntityBrowserContext::selectItems in Lightning Media 8.3

Selects several items from an entity browser.

@When I select :count item(s) from the :id entity browser

Parameters

int $count: The number of items to select.

string $id: The entity browser ID.

File

tests/contexts/EntityBrowserContext.behat.inc, line 268

Class

EntityBrowserContext
Contains step definitions for interacting with entity browser instances.

Namespace

Acquia\LightningExtension\Context

Code

public function selectItems($count, $id) {
  $this->isJS ? $this
    ->switchJs($id) : $this
    ->switchNoJs($id);
  $this
    ->getSession()
    ->getPage()
    ->clickLink('Library');
  $this
    ->awaitAjax();
  for ($n = 0; $n < $count; $n++) {
    $this
      ->select($n + 1);
  }
  $this
    ->submit();
  $this
    ->awaitAjax();
}