You are here

protected function EntityUsageJavascriptTestBase::waitUntilVisible in Entity Usage 8

Same name and namespace in other branches
  1. 8.4 tests/src/FunctionalJavascript/EntityUsageJavascriptTestBase.php \Drupal\Tests\entity_usage\FunctionalJavascript\EntityUsageJavascriptTestBase::waitUntilVisible()
  2. 8.2 tests/src/FunctionalJavascript/EntityUsageJavascriptTestBase.php \Drupal\Tests\entity_usage\FunctionalJavascript\EntityUsageJavascriptTestBase::waitUntilVisible()
  3. 8.3 tests/src/FunctionalJavascript/EntityUsageJavascriptTestBase.php \Drupal\Tests\entity_usage\FunctionalJavascript\EntityUsageJavascriptTestBase::waitUntilVisible()

Waits and asserts that a given element is visible.

Parameters

string $selector: The CSS selector.

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

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

File

tests/src/FunctionalJavascript/EntityUsageJavascriptTestBase.php, line 63

Class

EntityUsageJavascriptTestBase
Base class for Entity Usage Javascript functional tests.

Namespace

Drupal\Tests\entity_usage\FunctionalJavascript

Code

protected function waitUntilVisible($selector, $timeout = 2000, $message = '') {
  $condition = "jQuery('" . $selector . ":visible').length > 0";
  $this
    ->assertJsCondition($condition, $timeout, $message);
}