You are here

protected function MediaLibraryTestBase::waitForFieldExists 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::waitForFieldExists()

Checks for the existence of a field on page after wait.

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

Parameters

string $field: The field to find.

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

Return value

\Behat\Mink\Element\NodeElement|null The element if found, otherwise null.

3 calls to MediaLibraryTestBase::waitForFieldExists()
MediaLibraryTestBase::addMediaFileToField in core/modules/media_library/tests/src/FunctionalJavascript/MediaLibraryTestBase.php
Waits for a file field to exist before uploading.
MediaOverviewTest::testAdministrationPage in core/modules/media_library/tests/src/FunctionalJavascript/MediaOverviewTest.php
Tests that the Media Library's administration page 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.

File

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

Class

MediaLibraryTestBase
Base class for functional tests of Media Library functionality.

Namespace

Drupal\Tests\media_library\FunctionalJavascript

Code

protected function waitForFieldExists($field, $timeout = 10000) {
  $assert_session = $this
    ->assertSession();
  $assert_session
    ->waitForField($field, $timeout);
  return $assert_session
    ->fieldExists($field);
}