diff --git a/core/drupalci.yml b/core/drupalci.yml
index 2085b9737b..db7f0dcc70 100644
--- a/core/drupalci.yml
+++ b/core/drupalci.yml
@@ -15,36 +15,9 @@ build:
         sniff-all-files: false
         halt-on-fail: false
     testing:
-      # run_tests task is executed several times in order of performance speeds.
-      # halt-on-fail can be set on the run_tests tasks in order to fail fast.
-      # suppress-deprecations is false in order to be alerted to usages of
-      # deprecated code.
-      run_tests.phpunit:
-        types: 'PHPUnit-Unit'
-        testgroups: '--all'
-        suppress-deprecations: false
-        halt-on-fail: false
-      run_tests.kernel:
-        types: 'PHPUnit-Kernel'
-        testgroups: '--all'
-        suppress-deprecations: false
-        halt-on-fail: false
-      run_tests.simpletest:
-         types: 'Simpletest'
-         testgroups: '--all'
-         suppress-deprecations: false
-         halt-on-fail: false
-      run_tests.functional:
-        types: 'PHPUnit-Functional'
-        testgroups: '--all'
-        suppress-deprecations: false
-        halt-on-fail: false
       run_tests.javascript:
         concurrency: 15
         types: 'PHPUnit-FunctionalJavascript'
         testgroups: '--all'
         suppress-deprecations: false
         halt-on-fail: false
-      # Run nightwatch testing.
-      # @see https://www.drupal.org/project/drupal/issues/2869825
-      nightwatchjs:
diff --git a/core/modules/layout_builder/tests/modules/layout_builder_test_css_transitions/css/layout_builder_test_css_transitions.test.css b/core/modules/layout_builder/tests/modules/layout_builder_test_css_transitions/css/layout_builder_test_css_transitions.test.css
deleted file mode 100644
index e36e723527..0000000000
--- a/core/modules/layout_builder/tests/modules/layout_builder_test_css_transitions/css/layout_builder_test_css_transitions.test.css
+++ /dev/null
@@ -1,7 +0,0 @@
-/**
- * Remove all transitions for testing.
- */
-* {
-  /* CSS transitions. */
-  transition: none !important;
-}
diff --git a/core/modules/layout_builder/tests/modules/layout_builder_test_css_transitions/layout_builder_test_css_transitions.info.yml b/core/modules/layout_builder/tests/modules/layout_builder_test_css_transitions/layout_builder_test_css_transitions.info.yml
deleted file mode 100644
index 9bce43b41d..0000000000
--- a/core/modules/layout_builder/tests/modules/layout_builder_test_css_transitions/layout_builder_test_css_transitions.info.yml
+++ /dev/null
@@ -1,7 +0,0 @@
-# @todo Remove this module & its usages in https://www.drupal.org/node/2901792.
-name: 'Layout Builder Test Disable Animations'
-type: module
-description: 'Disables CSS animations for tests '
-package: Testing
-version: VERSION
-core: 8.x
diff --git a/core/modules/layout_builder/tests/modules/layout_builder_test_css_transitions/layout_builder_test_css_transitions.libraries.yml b/core/modules/layout_builder/tests/modules/layout_builder_test_css_transitions/layout_builder_test_css_transitions.libraries.yml
deleted file mode 100644
index f010cdfb73..0000000000
--- a/core/modules/layout_builder/tests/modules/layout_builder_test_css_transitions/layout_builder_test_css_transitions.libraries.yml
+++ /dev/null
@@ -1,4 +0,0 @@
-layout_builder.disable_css_transitions:
-  css:
-    component:
-      css/layout_builder_test_css_transitions.test.css: {}
diff --git a/core/modules/layout_builder/tests/modules/layout_builder_test_css_transitions/layout_builder_test_css_transitions.module b/core/modules/layout_builder/tests/modules/layout_builder_test_css_transitions/layout_builder_test_css_transitions.module
deleted file mode 100644
index 293910f6d0..0000000000
--- a/core/modules/layout_builder/tests/modules/layout_builder_test_css_transitions/layout_builder_test_css_transitions.module
+++ /dev/null
@@ -1,16 +0,0 @@
-<?php
-
-/**
- * @file
- * Attaches CSS to disable animations.
- *
- * CSS animations cause intermittent errors in some tests.
- */
-
-/**
- * Implements hook_page_attachments().
- */
-function layout_builder_test_css_transitions_page_attachments(array &$attachments) {
-  // Unconditionally attach an asset to the page.
-  $attachments['#attached']['library'][] = 'layout_builder_test_css_transitions/layout_builder.disable_css_transitions';
-}
diff --git a/core/modules/layout_builder/tests/src/FunctionalJavascript/BlockFormMessagesTest.php b/core/modules/layout_builder/tests/src/FunctionalJavascript/BlockFormMessagesTest.php
index f8e01d2af9..e62fe19c11 100644
--- a/core/modules/layout_builder/tests/src/FunctionalJavascript/BlockFormMessagesTest.php
+++ b/core/modules/layout_builder/tests/src/FunctionalJavascript/BlockFormMessagesTest.php
@@ -38,6 +38,8 @@ protected function setUp() {
    * Tests that validation messages are shown on the block form.
    */
   public function testValidationMessage() {
+    // @todo work why and if this fixes random fails in this test.
+    $this->getSession()->resizeWindow(800, 1000);
     $assert_session = $this->assertSession();
     $page = $this->getSession()->getPage();
 
@@ -66,7 +68,11 @@ public function testValidationMessage() {
     $page->findField('Title')->setValue('New title');
     $page->pressButton('Add block');
     $block_css_locator = '#layout-builder .block-system-powered-by-block';
-    $this->assertNotEmpty($assert_session->waitForElementVisible('css', $block_css_locator));
+    // @todo remove debug.
+    $element = $assert_session->waitForElementVisible('css', $block_css_locator);
+    $this->htmlOutput($this->getSession()->getDriver()->getContent());
+    $this->assertNotEmpty($element);
+
     $this->waitForNoElement('#drupal-off-canvas');
     $assert_session->assertWaitOnAjaxRequest();
     $this->drupalGet($this->getUrl());
diff --git a/core/modules/layout_builder/tests/src/FunctionalJavascript/ContextualLinksTest.php b/core/modules/layout_builder/tests/src/FunctionalJavascript/ContextualLinksTest.php
index b6fe178b79..859805b354 100644
--- a/core/modules/layout_builder/tests/src/FunctionalJavascript/ContextualLinksTest.php
+++ b/core/modules/layout_builder/tests/src/FunctionalJavascript/ContextualLinksTest.php
@@ -23,7 +23,6 @@ class ContextualLinksTest extends WebDriverTestBase {
     'layout_builder',
     'layout_builder_views_test',
     'layout_test',
-    'layout_builder_test_css_transitions',
     'block',
     'node',
     'contextual',
diff --git a/core/modules/layout_builder/tests/src/FunctionalJavascript/InlineBlockPrivateFilesTest.php b/core/modules/layout_builder/tests/src/FunctionalJavascript/InlineBlockPrivateFilesTest.php
index f18ff580c4..1d4f32d447 100644
--- a/core/modules/layout_builder/tests/src/FunctionalJavascript/InlineBlockPrivateFilesTest.php
+++ b/core/modules/layout_builder/tests/src/FunctionalJavascript/InlineBlockPrivateFilesTest.php
@@ -81,6 +81,8 @@ public function testPrivateFiles() {
       'create and edit custom blocks',
     ]));
     $this->drupalGet('node/1/layout');
+    // @todo this doesn't feel right - there's nought happening on the page?!?!
+    $assert_session->assertWaitOnAjaxRequest();
     $file = $this->createPrivateFile('drupal.txt');
 
     $file_real_path = $this->fileSystem->realpath($file->getFileUri());
diff --git a/core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderDisableInteractionsTest.php b/core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderDisableInteractionsTest.php
index eb06364b3f..d7a05a7c70 100644
--- a/core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderDisableInteractionsTest.php
+++ b/core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderDisableInteractionsTest.php
@@ -31,7 +31,6 @@ class LayoutBuilderDisableInteractionsTest extends WebDriverTestBase {
     'node',
     'search',
     'contextual',
-    'layout_builder_test_css_transitions',
   ];
 
   /**
@@ -313,13 +312,8 @@ protected function movePointerTo($selector) {
    * @todo: Remove after https://www.drupal.org/project/drupal/issues/2892440
    */
   public function assertNoElementAfterWait($selector, $timeout = 10000, $message = '') {
-    $page = $this->getSession()->getPage();
-    if ($message === '') {
-      $message = "Element '$selector' was not on the page after wait.";
-    }
-    $this->assertTrue($page->waitFor($timeout / 1000, function () use ($page, $selector) {
-      return empty($page->find('css', $selector));
-    }), $message);
+    $condition = "(typeof jQuery !== 'undefined' && jQuery('$selector').length === 0)";
+    $this->assertJsCondition($condition, $timeout, $message);
   }
 
 }
diff --git a/core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderQuickEditTest.php b/core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderQuickEditTest.php
index 4609aa4d66..0f85fcc5b4 100644
--- a/core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderQuickEditTest.php
+++ b/core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderQuickEditTest.php
@@ -26,7 +26,6 @@ class LayoutBuilderQuickEditTest extends QuickEditJavascriptTestBase {
   public static $modules = [
     'node',
     'layout_builder',
-    'layout_builder_test_css_transitions',
   ];
 
   /**
diff --git a/core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderUiTest.php b/core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderUiTest.php
index 0540296540..d2f94920a2 100644
--- a/core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderUiTest.php
+++ b/core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderUiTest.php
@@ -29,7 +29,6 @@ class LayoutBuilderUiTest extends WebDriverTestBase {
     'block_content',
     'contextual',
     'views',
-    'layout_builder_test_css_transitions',
   ];
 
   /**
diff --git a/core/modules/layout_builder/tests/src/FunctionalJavascript/TestMultiWidthLayoutsTest.php b/core/modules/layout_builder/tests/src/FunctionalJavascript/TestMultiWidthLayoutsTest.php
index 86b3e3de86..996170128a 100644
--- a/core/modules/layout_builder/tests/src/FunctionalJavascript/TestMultiWidthLayoutsTest.php
+++ b/core/modules/layout_builder/tests/src/FunctionalJavascript/TestMultiWidthLayoutsTest.php
@@ -20,7 +20,6 @@ class TestMultiWidthLayoutsTest extends WebDriverTestBase {
 
   public static $modules = [
     'layout_builder',
-    'layout_builder_test_css_transitions',
     'block',
     'node',
   ];
diff --git a/core/modules/media_library/tests/src/FunctionalJavascript/MediaLibraryTest.php b/core/modules/media_library/tests/src/FunctionalJavascript/MediaLibraryTest.php
index 6f79ed965e..d3999f1a03 100644
--- a/core/modules/media_library/tests/src/FunctionalJavascript/MediaLibraryTest.php
+++ b/core/modules/media_library/tests/src/FunctionalJavascript/MediaLibraryTest.php
@@ -1052,6 +1052,8 @@ public function testWidgetUpload() {
     $page->uncheckField("Select $existing_media_name");
     $page->fillField('Alternative text', $this->randomString());
     $assert_session->hiddenFieldValueEquals('current_selection', '');
+    // Close the details element so that clicking the Save and select works.
+    $this->click('details.media-library-add-form__selected-media summary');
     $assert_session->elementExists('css', '.ui-dialog-buttonpane')->pressButton('Save and select');
     $assert_session->assertWaitOnAjaxRequest();
     $media_items = Media::loadMultiple();
@@ -1325,6 +1327,8 @@ public function testWidgetOEmbed() {
     $assert_session->checkboxChecked("Select $vimeo_title", $selection_area);
     $page->uncheckField("Select $vimeo_title");
     $assert_session->hiddenFieldValueEquals('current_selection', '');
+    // Close the details element so that clicking the Save and select works.
+    $this->click('details.media-library-add-form__selected-media summary');
     $assert_session->elementExists('css', '.ui-dialog-buttonpane')->pressButton('Save and select');
     $assert_session->assertWaitOnAjaxRequest();
     $media_items = Media::loadMultiple();
diff --git a/core/modules/settings_tray/tests/modules/settings_tray_test_css/css/css_fix.theme.css b/core/modules/settings_tray/tests/modules/settings_tray_test_css/css/css_fix.theme.css
index e07c95194e..58ef85ec6a 100644
--- a/core/modules/settings_tray/tests/modules/settings_tray_test_css/css/css_fix.theme.css
+++ b/core/modules/settings_tray/tests/modules/settings_tray_test_css/css/css_fix.theme.css
@@ -2,26 +2,3 @@
 .dialog-off-canvas-main-canvas.js-settings-tray-edit-mode input {
   pointer-events: inherit !important;
 }
-/**
- * Remove all transitions for testing.
- */
-* {
-  /* CSS transitions. */
-  -o-transition-property: none !important;
-  -moz-transition-property: none !important;
-  -ms-transition-property: none !important;
-  -webkit-transition-property: none !important;
-  transition-property: none !important;
-  /* CSS transforms. */
-  -o-transform: none !important;
-  -moz-transform: none !important;
-  -ms-transform: none !important;
-  -webkit-transform: none !important;
-  transform: none !important;
-  /* CSS animations. */
-  -webkit-animation: none !important;
-  -moz-animation: none !important;
-  -o-animation: none !important;
-  -ms-animation: none !important;
-  animation: none !important;
-}
diff --git a/core/modules/settings_tray/tests/modules/settings_tray_test_css/css/css_fix.theme.css b/core/modules/system/tests/modules/css_disable_transitions_test/css/disable_transitions.theme.css
similarity index 61%
copy from core/modules/settings_tray/tests/modules/settings_tray_test_css/css/css_fix.theme.css
copy to core/modules/system/tests/modules/css_disable_transitions_test/css/disable_transitions.theme.css
index e07c95194e..9307437a87 100644
--- a/core/modules/settings_tray/tests/modules/settings_tray_test_css/css/css_fix.theme.css
+++ b/core/modules/system/tests/modules/css_disable_transitions_test/css/disable_transitions.theme.css
@@ -1,12 +1,13 @@
-.dialog-off-canvas-main-canvas.js-settings-tray-edit-mode a,
-.dialog-off-canvas-main-canvas.js-settings-tray-edit-mode input {
-  pointer-events: inherit !important;
-}
 /**
- * Remove all transitions for testing.
+ * Remove CSS animation effects that can cause random test failures.
  */
 * {
   /* CSS transitions. */
+  -o-transition: none !important;
+  -moz-transition: none !important;
+  -ms-transition: none !important;
+  -webkit-transition: none !important;
+  transition: none !important;
   -o-transition-property: none !important;
   -moz-transition-property: none !important;
   -ms-transition-property: none !important;
@@ -25,3 +26,11 @@
   -ms-animation: none !important;
   animation: none !important;
 }
+
+/**
+ * Prevent youtube and third party content in iFrames from affecting tests.
+ */
+iframe.media-oembed-content {
+  width: 0 !important;
+  height: 0 !important;
+}
diff --git a/core/modules/system/tests/modules/css_disable_transitions_test/css_disable_transitions_test.info.yml b/core/modules/system/tests/modules/css_disable_transitions_test/css_disable_transitions_test.info.yml
new file mode 100644
index 0000000000..436b022dba
--- /dev/null
+++ b/core/modules/system/tests/modules/css_disable_transitions_test/css_disable_transitions_test.info.yml
@@ -0,0 +1,6 @@
+name: 'Test disable CSS animations'
+type: module
+description: 'Disables CSS animations for tests.'
+package: Testing
+version: VERSION
+core: 8.x
diff --git a/core/modules/system/tests/modules/css_disable_transitions_test/css_disable_transitions_test.libraries.yml b/core/modules/system/tests/modules/css_disable_transitions_test/css_disable_transitions_test.libraries.yml
new file mode 100644
index 0000000000..b1cb9f56e0
--- /dev/null
+++ b/core/modules/system/tests/modules/css_disable_transitions_test/css_disable_transitions_test.libraries.yml
@@ -0,0 +1,7 @@
+testing.css_disable_transitions_test:
+  version: VERSION
+  css:
+    theme:
+      css/disable_transitions.theme.css: { weight: 100 }
+  js:
+    js/disable_transitions.theme.js: {}
diff --git a/core/modules/system/tests/modules/css_disable_transitions_test/css_disable_transitions_test.module b/core/modules/system/tests/modules/css_disable_transitions_test/css_disable_transitions_test.module
new file mode 100644
index 0000000000..4b915f3f34
--- /dev/null
+++ b/core/modules/system/tests/modules/css_disable_transitions_test/css_disable_transitions_test.module
@@ -0,0 +1,14 @@
+<?php
+
+/**
+ * @file
+ * Helper module for disabling animations in tests.
+ */
+
+/**
+ * Implements hook_page_attachments().
+ */
+function css_disable_transitions_test_page_attachments(array &$attachments) {
+  // Unconditionally attach an asset to the page.
+  $attachments['#attached']['library'][] = 'css_disable_transitions_test/testing.css_disable_transitions_test';
+}
diff --git a/core/modules/system/tests/modules/css_disable_transitions_test/js/disable_transitions.theme.es6.js b/core/modules/system/tests/modules/css_disable_transitions_test/js/disable_transitions.theme.es6.js
new file mode 100644
index 0000000000..c496f53d1a
--- /dev/null
+++ b/core/modules/system/tests/modules/css_disable_transitions_test/js/disable_transitions.theme.es6.js
@@ -0,0 +1,3 @@
+if (window.jQuery) {
+  jQuery.fx.off = true;
+}
diff --git a/core/modules/system/tests/modules/css_disable_transitions_test/js/disable_transitions.theme.js b/core/modules/system/tests/modules/css_disable_transitions_test/js/disable_transitions.theme.js
new file mode 100644
index 0000000000..d8040df5b0
--- /dev/null
+++ b/core/modules/system/tests/modules/css_disable_transitions_test/js/disable_transitions.theme.js
@@ -0,0 +1,10 @@
+/**
+* DO NOT EDIT THIS FILE.
+* See the following change record for more information,
+* https://www.drupal.org/node/2815083
+* @preserve
+**/
+
+if (window.jQuery) {
+  jQuery.fx.off = true;
+}
\ No newline at end of file
diff --git a/core/tests/Drupal/FunctionalJavascriptTests/WebDriverTestBase.php b/core/tests/Drupal/FunctionalJavascriptTests/WebDriverTestBase.php
index 8a9065168f..f54b334106 100644
--- a/core/tests/Drupal/FunctionalJavascriptTests/WebDriverTestBase.php
+++ b/core/tests/Drupal/FunctionalJavascriptTests/WebDriverTestBase.php
@@ -4,6 +4,7 @@
 
 use Behat\Mink\Exception\DriverException;
 use Drupal\Tests\BrowserTestBase;
+use Symfony\Component\DependencyInjection\ContainerInterface;
 use Zumba\GastonJS\Exception\DeadClient;
 use Zumba\Mink\Driver\PhantomJSDriver;
 
@@ -16,6 +17,14 @@
  */
 abstract class WebDriverTestBase extends BrowserTestBase {
 
+  /**
+   * Disables CSS animations in tests for more reliable testing.
+   *
+   * CSS animations are disabled by installing the css_disable_transitions_test
+   * module. Set to FALSE to test CSS animations.
+   */
+  protected $disableCssAnimations = TRUE;
+
   /**
    * {@inheritdoc}
    *
@@ -61,6 +70,16 @@ protected function initMink() {
     }
   }
 
+  /**
+   * {@inheritdoc}
+   */
+  protected function installModulesFromClassProperty(ContainerInterface $container) {
+    if ($this->disableCssAnimations) {
+      self::$modules = ['css_disable_transitions_test'];
+    }
+    parent::installModulesFromClassProperty($container);
+  }
+
   /**
    * {@inheritdoc}
    */
