$edit =
['edit-title-0-value' => 'Test inline form error with CKEditor 5'
];
$this->
submitForm($edit, 'Save'
);
$this->
assertSession()->
waitForElement('css', '#cke_edit-body-0-value'
);
// Add a bottom margin to the title field to be sure the body field is not
// visible.
$session->
executeScript("document.getElementById('edit-title-0-value').style.marginBottom = window.innerHeight*2 + 'px';"
);
// Check that the CKEditor5-enabled body field is currently not visible in
// the viewport.
$web_assert->
assertNotVisibleInViewport('css',
$ckeditor_class, 'topLeft', 'CKEditor5-enabled body field is not visible.'
);
// Check if we can find the error fragment link within the errors summary
// message.
$errors_link =
$this->
assertSession()->
waitForElementVisible('css', 'a[href$="#edit-body-0-value"]'
);
$this->
assertNotEmpty($errors_link, 'Error fragment link is visible.'
);
$errors_link->
click();
// Check that the CKEditor5-enabled body field is visible in the viewport.
// The hash change adds an ID to the CKEditor 5 instance so check its visibility using the ID now.