// Assert the "editingDowncast" HTML before making changes.
$assert_session->elementExists('css', '.ck-content .ck-widget.drupal-media > [data-drupal-media-preview]');
// Assert the link button is present and not pressed.
$link_button = $this->getEditorButton('Link'); $this->assertSame('false', $link_button->getAttribute('aria-pressed'));
// Wait for the preview to load.
$preview = $assert_session->waitForElement('css', '.ck-content .ck-widget.drupal-media [data-drupal-media-preview="ready"]'); $this->assertNotEmpty($preview);
/**
* Clicks a CKEditor button.
*
* @param string $name
* The name of the button, such as `drupallink`, `source`, etc.
*/ protectedfunctionpressEditorButton($name){ $this->getEditorButton($name)->click(); }
/**
* Waits for a CKEditor button and returns it when available and visible.
*
* @param string $name
* The name of the button, such as `drupallink`, `source`, etc.
*
* @return \Behat\Mink\Element\NodeElement|null
* The page element node if found, NULL if not.
*/
$src = basename($this->imageAttributes()['src']); // Assert the "editingDowncast" HTML before making changes.
$assert_session->elementExists('css', '.ck-content .ck-widget.' . $expected_widget_class . ' > img[src*="' . $src . '"][alt="drupalimage test image"]');
// Assert the link button is present and not pressed.
$link_button = $this->getEditorButton('Link'); $this->assertSame('false', $link_button->getAttribute('aria-pressed'));