Skip to content

Commit 09c8b08

Browse files
author
catch
committed
Issue #3389994 by mstrelan, quietone: [random test failure] MediaTest::testViewMode
1 parent de223a8 commit 09c8b08

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

modules/ckeditor5/tests/src/FunctionalJavascript/MediaTest.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -880,7 +880,7 @@ public function testViewMode(bool $with_alignment): void {
880880
// Test that setting the view mode back to the default removes the
881881
// `data-view-mode` attribute.
882882
$this->assertFalse($drupal_media_element->hasAttribute('data-view-mode'));
883-
$assert_session->elementExists('css', 'article.media--view-mode-view-mode-1');
883+
$this->assertNotEmpty($assert_session->waitForElement('css', 'article.media--view-mode-view-mode-1'));
884884

885885
// Check that the toolbar status matches "no view mode".
886886
$dropdown_button = $page->find('css', 'button.ck-dropdown__button > span.ck-button__label');
@@ -913,7 +913,7 @@ public function testViewMode(bool $with_alignment): void {
913913
$drupal_media_element = $editor_dom->getElementsByTagName('drupal-media')
914914
->item(0);
915915
$this->assertFalse($drupal_media_element->hasAttribute('data-view-mode'));
916-
$assert_session->waitForElement('css', 'article.media--view-mode-view-mode-1');
916+
$this->assertNotEmpty($assert_session->waitForElement('css', 'article.media--view-mode-view-mode-1'));
917917

918918
// Test that setting allowed_view_modes back to two items restores the
919919
// field.
@@ -949,7 +949,7 @@ public function testViewMode(bool $with_alignment): void {
949949
$this->host->save();
950950
$this->getSession()->reload();
951951
$this->waitForEditor();
952-
$assert_session->elementExists('css', 'article.media--view-mode-view-mode-1');
952+
$this->assertNotEmpty($assert_session->waitForElement('css', 'article.media--view-mode-view-mode-1'));
953953

954954
$this->assertEmpty($assert_session->waitForElementVisible('css', '.drupal-media figcaption'));
955955
$this->click('.ck-widget.drupal-media');
@@ -977,7 +977,7 @@ public function testViewMode(bool $with_alignment): void {
977977
// Reload page to get new configuration.
978978
$this->getSession()->reload();
979979
$this->waitForEditor();
980-
$assert_session->waitForElementVisible('css', 'article.media--view-mode-view-mode-1');
980+
$this->assertNotEmpty($assert_session->waitForElementVisible('css', 'article.media--view-mode-view-mode-1'));
981981

982982
// Test that having a default_view_mode that is not an allowed_view_mode
983983
// will still be added to the editor.

0 commit comments

Comments
 (0)