You are here

protected function MoveBlockHelperTrait::waitForNoElement in Layout Builder Restrictions 8.2

Waits for an element to be removed from the page.

@todo Remove in https://www.drupal.org/node/2892440.

Parameters

string $selector: CSS selector.

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

6 calls to MoveBlockHelperTrait::waitForNoElement()
MoveBlockBlacklistTest::testMovePluginBlock in modules/layout_builder_restrictions_by_region/tests/src/FunctionalJavascript/MoveBlockBlacklistTest.php
Tests moving a plugin block.
MoveBlockCategoryRestrictionTest::testMovePluginBlock in modules/layout_builder_restrictions_by_region/tests/src/FunctionalJavascript/MoveBlockCategoryRestrictionTest.php
Tests moving a plugin block.
MoveBlockHelperTrait::assertRegionBlocksOrder in tests/src/Traits/MoveBlockHelperTrait.php
Asserts that blocks are in the correct order for a region.
MoveBlockRestrictionTest::testMoveContentBlock in tests/src/FunctionalJavascript/MoveBlockRestrictionTest.php
Tests moving a content block.
MoveBlockRestrictionTest::testMovePluginBlock in tests/src/FunctionalJavascript/MoveBlockRestrictionTest.php
Tests moving a plugin block.

... See full list

File

tests/src/Traits/MoveBlockHelperTrait.php, line 41

Class

MoveBlockHelperTrait
General-purpose methods for moving blocks in Layout Builder.

Namespace

Drupal\Tests\layout_builder_restrictions\Traits

Code

protected function waitForNoElement($selector, $timeout = 10000) {
  $condition = "(typeof jQuery !== 'undefined' && jQuery('{$selector}').length === 0)";
  $this
    ->assertJsCondition($condition, $timeout);
}