You are here

protected function ConditionalFieldTestBase::changeField 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::changeField()

Helper to change Field value with Javascript.

98 calls to ConditionalFieldTestBase::changeField()
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

1 method overrides ConditionalFieldTestBase::changeField()
ConditionalFieldSelectMultipleTest::changeField in tests/src/FunctionalJavascript/ConditionalFieldSelectMultipleTest.php
Helper to change Field value with Javascript.

File

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

Class

ConditionalFieldTestBase
Base setup for ConditionalField tests.

Namespace

Drupal\Tests\conditional_fields\FunctionalJavascript

Code

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