function CKEditor5TestTrait::getBalloonButton

Same name in other branches
  1. 9 core/modules/ckeditor5/tests/src/Traits/CKEditor5TestTrait.php \Drupal\Tests\ckeditor5\Traits\CKEditor5TestTrait::getBalloonButton()
  2. 10 core/modules/ckeditor5/tests/src/Traits/CKEditor5TestTrait.php \Drupal\Tests\ckeditor5\Traits\CKEditor5TestTrait::getBalloonButton()

Gets a button from the currently visible balloon.

Parameters

string $name: The label of the button to find.

Return value

\Behat\Mink\Element\NodeElement The requested button.

6 calls to CKEditor5TestTrait::getBalloonButton()
MediaLinkabilityTest::testLinkability in core/modules/ckeditor5/tests/src/FunctionalJavascript/MediaLinkabilityTest.php
Tests linkability of the media CKEditor widget.
MediaTest::testAltDisabled in core/modules/ckeditor5/tests/src/FunctionalJavascript/MediaTest.php
Tests that the image media source's alt_field being disabled is respected.
MediaTest::testDrupalMediaStyleInDropdown in core/modules/ckeditor5/tests/src/FunctionalJavascript/MediaTest.php
Ensures that Drupal Media Styles can be displayed in a dropdown.
MediaTest::testEditableCaption in core/modules/ckeditor5/tests/src/FunctionalJavascript/MediaTest.php
Tests caption editing in the CKEditor widget.
MediaTest::testViewMode in core/modules/ckeditor5/tests/src/FunctionalJavascript/MediaTest.php
Tests view mode integration.

... See full list

File

core/modules/ckeditor5/tests/src/Traits/CKEditor5TestTrait.php, line 131

Class

CKEditor5TestTrait
Provides methods to test CKEditor 5.

Namespace

Drupal\Tests\ckeditor5\Traits

Code

protected function getBalloonButton(string $name) : NodeElement {
    $button = $this->getSession()
        ->getPage()
        ->find('css', '.ck-balloon-panel_visible .ck-balloon-rotator__content')
        ->find('xpath', "//button[span[text()='{$name}']]");
    $this->assertNotEmpty($button);
    return $button;
}

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