You are here

protected function InlineBlockTestBase::waitForNoElement in Drupal 8

Waits for an element to be removed from the page.

Parameters

string $selector: CSS selector.

int $timeout: (optional) Timeout in milliseconds, defaults to 10000.

Deprecated

in drupal:8.8.0 and is removed from drupal:9.0.0. Use Drupal\FunctionalJavascriptTests\JSWebAssert::assertNoElementAfterWait()

File

core/modules/layout_builder/tests/src/FunctionalJavascript/InlineBlockTestBase.php, line 186

Class

InlineBlockTestBase
Base class for testing inline blocks.

Namespace

Drupal\Tests\layout_builder\FunctionalJavascript

Code

protected function waitForNoElement($selector, $timeout = 10000) {
  @trigger_error('::waitForNoElement is deprecated in Drupal 8.8.0 and will be removed before Drupal 9.0.0. Use \\Drupal\\FunctionalJavascriptTests\\JSWebAssert::assertNoElementAfterWait() instead.', E_USER_DEPRECATED);
  $condition = "(typeof jQuery !== 'undefined' && jQuery('{$selector}').length === 0)";
  $this
    ->assertJsCondition($condition, $timeout);
}