You are here

protected function ConditionalFieldTestBase::changeSelect in Conditional Fields 8

Same name and namespace in other branches
  1. 4.x tests/src/FunctionalJavascript/ConditionalFieldTestBase.php \Drupal\Tests\conditional_fields\FunctionalJavascript\ConditionalFieldTestBase::changeSelect()

Helper to change selection with Javascript.

20 calls to ConditionalFieldTestBase::changeSelect()
ConditionalFieldCheckboxesTest::testVisibleValueAnd in tests/src/FunctionalJavascript/ConditionalFieldCheckboxesTest.php
The target field is Visible when the control field has value with AND condition.
ConditionalFieldCheckboxesTest::testVisibleValueNot in tests/src/FunctionalJavascript/ConditionalFieldCheckboxesTest.php
The target field is Visible when the control field has value with NOT condition.
ConditionalFieldCheckboxesTest::testVisibleValueOr in tests/src/FunctionalJavascript/ConditionalFieldCheckboxesTest.php
The target field is Visible when the control field has value with OR condition.
ConditionalFieldCheckboxesTest::testVisibleValueRegExp in tests/src/FunctionalJavascript/ConditionalFieldCheckboxesTest.php
The target field is Visible when the control field has value from Regular expression.
ConditionalFieldCheckboxesTest::testVisibleValueWidget in tests/src/FunctionalJavascript/ConditionalFieldCheckboxesTest.php
The target field is Visible when the control field has value from Widget.

... See full list

File

tests/src/FunctionalJavascript/ConditionalFieldTestBase.php, line 101

Class

ConditionalFieldTestBase
Base setup for ConditionalField tests.

Namespace

Drupal\Tests\conditional_fields\FunctionalJavascript

Code

protected function changeSelect($selector, $value = '') {
  $this
    ->getSession()
    ->executeScript("jQuery('" . $selector . "').val('" . $value . "').trigger('click').trigger('change');");
}