You are here

protected function FileBrowserTest::clickViewEntity in File Entity Browser 8

Click on entity in view to be selected.

Parameters

string $entityId: Entity ID that will be selected. Format: "file:1".

Throws

\Behat\Mink\Exception\ElementNotFoundException

1 call to FileBrowserTest::clickViewEntity()
FileBrowserTest::testFileBrowserView in tests/src/FunctionalJavascript/FileBrowserTest.php
Tests that selecting files in the view works.

File

tests/src/FunctionalJavascript/FileBrowserTest.php, line 75

Class

FileBrowserTest
Tests the file_browser module.

Namespace

Drupal\Tests\file_browser\FunctionalJavascript

Code

protected function clickViewEntity($entityId) {
  $xpathViewRow = '//*[./*[contains(@class, "views-field-entity-browser-select") and .//input[@name="entity_browser_select[' . $entityId . ']"]]]';
  $this
    ->assertSession()
    ->elementExists('xpath', $xpathViewRow)
    ->click();
}