function MediaLibraryTestBase::waitForElementTextContains
Same name in other branches
- 8.9.x core/modules/media_library/tests/src/FunctionalJavascript/MediaLibraryTestBase.php \Drupal\Tests\media_library\FunctionalJavascript\MediaLibraryTestBase::waitForElementTextContains()
- 10 core/modules/media_library/tests/src/FunctionalJavascript/MediaLibraryTestBase.php \Drupal\Tests\media_library\FunctionalJavascript\MediaLibraryTestBase::waitForElementTextContains()
- 11.x core/modules/media_library/tests/src/FunctionalJavascript/MediaLibraryTestBase.php \Drupal\Tests\media_library\FunctionalJavascript\MediaLibraryTestBase::waitForElementTextContains()
Asserts that text appears in an element after a wait.
@todo replace with whatever gets added in https://www.drupal.org/node/3061852
Parameters
string $selector: The CSS selector of the element to check.
string $text: The text that should appear in the element.
int $timeout: Timeout in milliseconds, defaults to 10000.
4 calls to MediaLibraryTestBase::waitForElementTextContains()
- EntityReferenceWidgetTest::testWidget in core/
modules/ media_library/ tests/ src/ FunctionalJavascript/ EntityReferenceWidgetTest.php - Tests that the Media library's widget works as expected.
- WidgetUploadTest::testWidgetUpload in core/
modules/ media_library/ tests/ src/ FunctionalJavascript/ WidgetUploadTest.php - Tests that uploads in the Media library's widget works as expected.
- WidgetUploadTest::testWidgetUploadAdvancedUi in core/
modules/ media_library/ tests/ src/ FunctionalJavascript/ WidgetUploadTest.php - Tests that uploads in the widget's advanced UI works as expected.
- WidgetViewsTest::testWidgetViews in core/
modules/ media_library/ tests/ src/ FunctionalJavascript/ WidgetViewsTest.php - Tests that the views in the Media library's widget work as expected.
File
-
core/
modules/ media_library/ tests/ src/ FunctionalJavascript/ MediaLibraryTestBase.php, line 133
Class
- MediaLibraryTestBase
- Base class for functional tests of Media Library functionality.
Namespace
Drupal\Tests\media_library\FunctionalJavascriptCode
protected function waitForElementTextContains($selector, $text, $timeout = 10000) {
$element = $this->assertSession()
->waitForElement('css', "{$selector}:contains('{$text}')", $timeout);
$this->assertNotEmpty($element);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.