You are here

protected function ConditionalFieldTestBase::waitUntilVisible in Conditional Fields 4.x

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

Waits and asserts that a given element is visible.

Parameters

string $selector: The CSS selector.

int $timeout: (Optional) Timeout in milliseconds, defaults to 1000.

string $message: (Optional) Message to pass to assertJsCondition().

106 calls to ConditionalFieldTestBase::waitUntilVisible()
ConditionalFieldCheckboxesTest::testVisibleValueAnd in tests/src/FunctionalJavascript/ConditionalFieldCheckboxesTest.php
Target field is Visible when control field has value with AND condition.
ConditionalFieldCheckboxesTest::testVisibleValueNot in tests/src/FunctionalJavascript/ConditionalFieldCheckboxesTest.php
Target field is Visible when control field has value with NOT condition.
ConditionalFieldCheckboxesTest::testVisibleValueOr in tests/src/FunctionalJavascript/ConditionalFieldCheckboxesTest.php
Target field is Visible when the control field has value with OR condition.
ConditionalFieldCheckboxesTest::testVisibleValueRegExp in tests/src/FunctionalJavascript/ConditionalFieldCheckboxesTest.php
Target field is Visible when the control field has value from regex.
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 76

Class

ConditionalFieldTestBase
Base setup for ConditionalField tests.

Namespace

Drupal\Tests\conditional_fields\FunctionalJavascript

Code

protected function waitUntilVisible($selector, $timeout = 1000, $message = '') {
  $condition = "jQuery('{$selector}').is(':visible');console.log(jQuery('{$selector}'))";
  $this
    ->assertJsCondition($condition, $timeout, $message);
}