You are here

protected function MediaLibraryTestBase::waitForText in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/media_library/tests/src/FunctionalJavascript/MediaLibraryTestBase.php \Drupal\Tests\media_library\FunctionalJavascript\MediaLibraryTestBase::waitForText()

Asserts that text appears on page after a wait.

@todo replace with whatever gets added in https://www.drupal.org/node/3061852

Parameters

string $text: The text that should appear on the page.

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

13 calls to MediaLibraryTestBase::waitForText()
EntityReferenceWidgetTest::testWidget in core/modules/media_library/tests/src/FunctionalJavascript/EntityReferenceWidgetTest.php
Tests that the Media library's widget works as expected.
FieldUiIntegrationTest::testFieldUiIntegration in core/modules/media_library/tests/src/FunctionalJavascript/FieldUiIntegrationTest.php
Tests field UI integration for media library widget.
MediaLibraryTestBase::openMediaLibraryForField in core/modules/media_library/tests/src/FunctionalJavascript/MediaLibraryTestBase.php
Clicks a button that opens a media widget and confirms it is open.
MediaLibraryTestBase::pressInsertSelected in core/modules/media_library/tests/src/FunctionalJavascript/MediaLibraryTestBase.php
Presses the modal's "Insert selected" button.
MediaLibraryTestBase::switchToMediaLibraryGrid in core/modules/media_library/tests/src/FunctionalJavascript/MediaLibraryTestBase.php
Switches to the grid display of the widget view.

... See full list

File

core/modules/media_library/tests/src/FunctionalJavascript/MediaLibraryTestBase.php, line 63

Class

MediaLibraryTestBase
Base class for functional tests of Media Library functionality.

Namespace

Drupal\Tests\media_library\FunctionalJavascript

Code

protected function waitForText($text, $timeout = 10000) {
  $result = $this
    ->assertSession()
    ->waitForText($text, $timeout);
  $this
    ->assertNotEmpty($result, "\"{$text}\" not found");
}