Issue #3317330 by Wim Leers, nod_: Random failure in ImageTest::testAltTextRequired

(cherry picked from commit e9d3e92f88)
merge-requests/2906/head
catch 2022-10-26 15:36:58 +01:00
parent 2c46b5a4ce
commit 29349880c6
2 changed files with 5 additions and 2 deletions

View File

@ -124,6 +124,8 @@ class ImageTest extends ImageTestBase {
$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 . '"]'));
}
/**

View File

@ -89,6 +89,8 @@ abstract class ImageTestBase extends CKEditor5TestBase {
$src_input = $panel->find('css', 'input[type=text]');
$src_input->setValue($src);
$panel->find('xpath', "//button[span[text()='Insert']]")->click();
// Wait for the image to be uploaded and rendered by CKEditor 5.
$this->assertNotEmpty($this->assertSession()->waitForElementVisible('css', '.ck-widget.image > img[src="' . $src . '"]'));
}
/**
@ -435,8 +437,7 @@ abstract class ImageTestBase extends CKEditor5TestBase {
$this->drupalGet($this->host->toUrl('edit-form'));
$this->waitForEditor();
$this->addImage();
$this->assertNotEmpty($assert_session->waitForElementVisible('css', '.ck-widget.image'));
$this->assertNotEmpty($assert_session->waitForElementVisible('css', '.ck-balloon-panel'));
$this->assertNotEmpty($assert_session->waitForElementVisible('css', '.ck-text-alternative-form'));
$this->assertVisibleBalloon('.ck-text-alternative-form');
}