function CKEditor5TestTrait::assertVisibleBalloon

Same name and namespace in other branches
  1. 11.x core/modules/ckeditor5/tests/src/Traits/CKEditor5TestTrait.php \Drupal\Tests\ckeditor5\Traits\CKEditor5TestTrait::assertVisibleBalloon()
  2. 10 core/modules/ckeditor5/tests/src/Traits/CKEditor5TestTrait.php \Drupal\Tests\ckeditor5\Traits\CKEditor5TestTrait::assertVisibleBalloon()

Asserts a particular balloon is visible.

Parameters

string $balloon_content_selector: A CSS selector.

Return value

\Behat\Mink\Element\NodeElement The asserted balloon.

File

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

Class

CKEditor5TestTrait
Provides methods to test CKEditor 5.

Namespace

Drupal\Tests\ckeditor5\Traits

Code

protected function assertVisibleBalloon(string $balloon_content_selector) : NodeElement {
  $this->assertSession()
    ->elementExists('css', '.ck-balloon-panel_visible');
  $selector = ".ck-balloon-panel_visible .ck-balloon-rotator__content > .ck{$balloon_content_selector}";
  $this->assertSession()
    ->elementExists('css', $selector);
  return $this->getSession()
    ->getPage()
    ->find('css', $selector);
}

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