function CKEditor5TestTrait::getEditorButton
Same name in other branches
- 9 core/modules/ckeditor5/tests/src/Traits/CKEditor5TestTrait.php \Drupal\Tests\ckeditor5\Traits\CKEditor5TestTrait::getEditorButton()
- 10 core/modules/ckeditor5/tests/src/Traits/CKEditor5TestTrait.php \Drupal\Tests\ckeditor5\Traits\CKEditor5TestTrait::getEditorButton()
Waits for a CKEditor button and returns it when available and visible.
Parameters
string $name: The name of the button, such as `drupallink`, `source`, etc.
Return value
\Behat\Mink\Element\NodeElement|null The page element node if found, NULL if not.
3 calls to CKEditor5TestTrait::getEditorButton()
- CKEditor5TestTrait::assertEditorButtonDisabled in core/
modules/ ckeditor5/ tests/ src/ Traits/ CKEditor5TestTrait.php - Asserts a CKEditor button is disabled.
- CKEditor5TestTrait::assertEditorButtonEnabled in core/
modules/ ckeditor5/ tests/ src/ Traits/ CKEditor5TestTrait.php - Asserts a CKEditor button is enabled.
- MediaLinkabilityTest::testLinkability in core/
modules/ ckeditor5/ tests/ src/ FunctionalJavascript/ MediaLinkabilityTest.php - Tests linkability of the media CKEditor widget.
File
-
core/
modules/ ckeditor5/ tests/ src/ Traits/ CKEditor5TestTrait.php, line 76
Class
- CKEditor5TestTrait
- Provides methods to test CKEditor 5.
Namespace
Drupal\Tests\ckeditor5\TraitsCode
protected function getEditorButton($name) {
$button = $this->assertSession()
->waitForElementVisible('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.