You are here

public function LayoutBuilderTestTrait::assertNoElementAfterWait in Layout Builder Symmetric Translations 8

Waits for an element to be removed from the page.

@todo: Remove after https://www.drupal.org/project/drupal/issues/2892440

Parameters

string $selector: CSS selector.

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

string $message: (optional) Custom message to display with the assertion.

2 calls to LayoutBuilderTestTrait::assertNoElementAfterWait()
InlineBlockTranslationTest::updateTranslatedBlock in tests/src/FunctionalJavascript/InlineBlockTranslationTest.php
Update a translation inline block.
TranslationTest::testLabelTranslation in tests/src/FunctionalJavascript/TranslationTest.php
Tests that block labels can be translated.

File

tests/src/FunctionalJavascript/LayoutBuilderTestTrait.php, line 67

Class

LayoutBuilderTestTrait
Common functions for testing Layout Builder.

Namespace

Drupal\Tests\layout_builder_st\FunctionalJavascript

Code

public function assertNoElementAfterWait($selector, $timeout = 10000, $message = '') {
  $page = $this
    ->getSession()
    ->getPage();
  if ($message === '') {
    $message = "Element '{$selector}' was not on the page after wait.";
  }
  $this
    ->assertTrue($page
    ->waitFor($timeout / 1000, function () use ($page, $selector) {
    return empty($page
      ->find('css', $selector));
  }), $message);
}