You are here

protected function MediaJavascriptTestBase::waitUntilVisible in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/media/tests/src/FunctionalJavascript/MediaJavascriptTestBase.php \Drupal\Tests\media\FunctionalJavascript\MediaJavascriptTestBase::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().

2 calls to MediaJavascriptTestBase::waitUntilVisible()
MediaViewsWizardTest::testMediaRevisionWizard in core/modules/media/tests/src/FunctionalJavascript/MediaViewsWizardTest.php
Tests adding a view of media revisions.
MediaViewsWizardTest::testMediaWizard in core/modules/media/tests/src/FunctionalJavascript/MediaViewsWizardTest.php
Tests adding a view of media.

File

core/modules/media/tests/src/FunctionalJavascript/MediaJavascriptTestBase.php, line 41

Class

MediaJavascriptTestBase
Base class for Media functional JavaScript tests.

Namespace

Drupal\Tests\media\FunctionalJavascript

Code

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