function MediaTest::assertContextMenuItemExists

Asserts that a context menu item exists by aria-label attribute.

@internal

Parameters

string $label: The `aria-label` attribute value of the context menu item.

1 call to MediaTest::assertContextMenuItemExists()
MediaTest::testLinkability in core/modules/ckeditor/tests/src/FunctionalJavascript/MediaTest.php
Tests linkability of the CKEditor widget.

File

core/modules/ckeditor/tests/src/FunctionalJavascript/MediaTest.php, line 1541

Class

MediaTest
@coversDefaultClass \Drupal\ckeditor\Plugin\CKEditorPlugin\DrupalMedia @group ckeditor @group legacy

Namespace

Drupal\Tests\ckeditor\FunctionalJavascript

Code

protected function assertContextMenuItemExists(string $label) : void {
    $this->assertSession()
        ->elementExists('xpath', '//a[@aria-label="' . $label . '"]');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.