function ImageTest::addImage
Add an image to the CKEditor 5 editable zone.
Overrides ImageTestBase::addImage
File
- 
              core/
modules/ ckeditor5/ tests/ src/ FunctionalJavascript/ ImageTest.php, line 122  
Class
- ImageTest
 - @coversDefaultClass \Drupal\ckeditor5\Plugin\CKEditor5Plugin\Image[[api-linebreak]] @group ckeditor5 @internal
 
Namespace
Drupal\Tests\ckeditor5\FunctionalJavascriptCode
protected function addImage() {
  $page = $this->getSession()
    ->getPage();
  $this->assertNotEmpty($image_upload_field = $page->find('css', '.ck-file-dialog-button input[type="file"]'));
  $image = $this->getTestFiles('image')[0];
  $image_upload_field->attachFile($this->container
    ->get('file_system')
    ->realpath($image->uri));
  // Wait for the image to be uploaded and rendered by CKEditor 5.
  $this->assertNotEmpty($this->assertSession()
    ->waitForElementVisible('css', '.ck-widget.image > img[src*="' . $image->filename . '"]'));
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.