You are here

protected function PanelsIPETestTrait::setBlockConfigurationFormValue in Panels 8.4

Same name and namespace in other branches
  1. 8.3 panels_ipe/tests/src/FunctionalJavascript/PanelsIPETestTrait.php \Drupal\Tests\panels_ipe\FunctionalJavascript\PanelsIPETestTrait::setBlockConfigurationFormValue()

Sets a configuration value on the Block configuration form.

Parameters

string $name: The string name of the form value, i.e. settings[label].

string|bool|array $value: The value for the given form value.

File

panels_ipe/tests/src/FunctionalJavascript/PanelsIPETestTrait.php, line 194

Class

PanelsIPETestTrait
Trait which can be used to test Panels IPE components.

Namespace

Drupal\Tests\panels_ipe\FunctionalJavascript

Code

protected function setBlockConfigurationFormValue($name, $value) {
  $selector_converter = new CssSelectorConverter();
  $xpath = $selector_converter
    ->toXPath('.panels-ipe-block-plugin-form [name="' . $name . '"]');

  // Set the value of the given form field.
  $this
    ->getSession()
    ->getDriver()
    ->setValue($xpath, $value);
}