diff -u b/core/modules/ckeditor/tests/src/FunctionalJavascript/CKEditorIntegrationTest.php b/core/modules/ckeditor/tests/src/FunctionalJavascript/CKEditorIntegrationTest.php --- b/core/modules/ckeditor/tests/src/FunctionalJavascript/CKEditorIntegrationTest.php +++ b/core/modules/ckeditor/tests/src/FunctionalJavascript/CKEditorIntegrationTest.php @@ -235,26 +235,30 @@ } /** - * Tests if the CKEditor Inserts empty tags into DOM. - */ + * Tests if the CKEditor Inserts empty tags into DOM. + */ public function testDrupalEmptyInsert() { - $assert_session = $this->assertSession(); - // navigate to the page - $this->drupalGet('node/add/page'); - $this->waitForEditor(); - // issue occurs on several clicks of the source button, when this happens the ckeditor text area increases - // so to check if the error has been fixed we toggle the source button and compare the first height to the last height - $this->pressEditorButton('source'); - $this->assertNotEmpty($assert_session->waitForElement('css', '.cke__contents > textarea')); - $first_height = $this->getSession()->evaluateScript('document.getElementById(cke_edit-body-0-value).clientHeight'); - $this->pressEditorButton('source'); - $this->assertNotEmpty($assert_session->waitForElement('css', '.cke__contents > span')); - $this->pressEditorButton('source'); - $this->assertNotEmpty($assert_session->waitForElement('css', '.cke__contents > textarea')); - $last_height = $this->getSession()->evaluateScript('document.getElementById(cke_edit-body-0-value).clientHeight'); - // if the height is different then empty tag has been entered into the DOM - $this->assertEquals($first_height, $last_height); + $assert_session = $this->assertSession(); + // Navigate to the page + $this->drupalGet('node/add/page'); + $this->waitForEditor(); + + // Issue occurs on several clicks of the source button, when this happens + // the ckeditor text area increases. + // So to check if the error has been fixed we toggle the source button and + // compare the first height to the last height. + $this->pressEditorButton('source'); + $this->assertNotEmpty($assert_session->waitForElement('css', '.cke__contents > textarea')); + $first_height = $this->getSession()->evaluateScript('document.getElementById(cke_edit-body-0-value).clientHeight'); + $this->pressEditorButton('source'); + $this->assertNotEmpty($assert_session->waitForElement('css', '.cke__contents > span')); + $this->pressEditorButton('source'); + $this->assertNotEmpty($assert_session->waitForElement('css', '.cke__contents > textarea')); + $last_height = $this->getSession()->evaluateScript('document.getElementById(cke_edit-body-0-value).clientHeight'); + + // If the height is different then empty tag has been entered into the DOM. + $this->assertEquals($first_height, $last_height); } }