Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / modules / inline_form_errors / tests / src / FunctionalJavascript / FormErrorHandlerCKEditorTest.php
index 2007e1e266329d7b467421672b61460d05e74ce0..7c9a74ab503488f95d5255c3e308dc554ea255f3 100644 (file)
@@ -7,7 +7,7 @@ use Drupal\editor\Entity\Editor;
 use Drupal\field\Entity\FieldConfig;
 use Drupal\field\Entity\FieldStorageConfig;
 use Drupal\filter\Entity\FilterFormat;
-use Drupal\FunctionalJavascriptTests\JavascriptTestBase;
+use Drupal\FunctionalJavascriptTests\WebDriverTestBase;
 use Drupal\node\Entity\NodeType;
 
 /**
@@ -15,7 +15,7 @@ use Drupal\node\Entity\NodeType;
  *
  * @group ckeditor
  */
-class FormErrorHandlerCKEditorTest extends JavascriptTestBase {
+class FormErrorHandlerCKEditorTest extends WebDriverTestBase {
 
   /**
    * {@inheritdoc}
@@ -87,9 +87,10 @@ class FormErrorHandlerCKEditorTest extends JavascriptTestBase {
 
     $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. PhantomJS runs with a resolution of 1024x768px.
-    $session->executeScript("document.getElementById('edit-title-0-value').style.marginBottom = '800px';");
+    // visible.
+    $session->executeScript("document.getElementById('edit-title-0-value').style.marginBottom = window.innerHeight*2 + 'px';");
 
     // Check that the CKEditor-enabled body field is currently not visible in
     // the viewport.