diff --git a/core/modules/simpletest/simpletest.module b/core/modules/simpletest/simpletest.module
index 751a729..1efabd6 100644
--- a/core/modules/simpletest/simpletest.module
+++ b/core/modules/simpletest/simpletest.module
@@ -351,6 +351,8 @@ function simpletest_phpunit_run_command(array $unescaped_test_classnames, $phpun
   // via the simpletest UI.
   $ret = exec(join($command, " "), $output, $status);
 
+  var_dump($output);
+
   chdir($old_cwd);
   putenv('SIMPLETEST_DB=');
   if ($base_url) {
@@ -380,7 +382,7 @@ function simpletest_phpunit_command() {
     $phpunit_bin = escapeshellarg($php) . ' -f ' . escapeshellarg($vendor_dir . '/phpunit/phpunit/composer/bin/phpunit') . ' --';
   }
   else {
-    $phpunit_bin = $vendor_dir . '/phpunit/phpunit/phpunit';
+    $phpunit_bin = $vendor_dir . '/phpunit/phpunit/phpunit --debug';
   }
   return $phpunit_bin;
 }
diff --git a/core/modules/toolbar/tests/src/FunctionalJavascript/ToolbarIntegrationTest.php b/core/modules/toolbar/tests/src/FunctionalJavascript/ToolbarIntegrationTest.php
index c3b3d9a..490d46f 100644
--- a/core/modules/toolbar/tests/src/FunctionalJavascript/ToolbarIntegrationTest.php
+++ b/core/modules/toolbar/tests/src/FunctionalJavascript/ToolbarIntegrationTest.php
@@ -28,6 +28,7 @@ public function testToolbarToggling() {
     $this->drupalLogin($admin_user);
 
     $this->drupalGet('<front>');
+    $web_assert = $this->assertSession();
     $page = $this->getSession()->getPage();
 
     // Test that it is possible to toggle the toolbar tray.
@@ -45,6 +46,8 @@ public function testToolbarToggling() {
     $this->assertTrue($tray->hasClass('toolbar-tray-vertical'), 'After toggling the orientation the toolbar tray is now displayed vertically.');
 
     $page->pressButton('Horizontal orientation');
+    // Changing orientation results in an AJAX request.
+    $web_assert->assertWaitOnAjaxRequest();
     $this->assertTrue($tray->hasClass('toolbar-tray-horizontal'), 'After toggling the orientation a second time the toolbar tray is displayed horizontally again.');
   }
 
diff --git a/core/phpunit.xml.dist b/core/phpunit.xml.dist
index 2b45c64..10b477a 100644
--- a/core/phpunit.xml.dist
+++ b/core/phpunit.xml.dist
@@ -11,7 +11,7 @@
 -->
 <phpunit bootstrap="tests/bootstrap.php" colors="true"
          beStrictAboutTestsThatDoNotTestAnything="true"
-         beStrictAboutOutputDuringTests="true"
+         beStrictAboutOutputDuringTests="false"
          beStrictAboutChangesToGlobalState="true"
          checkForUnintentionallyCoveredCode="false">
   <php>
diff --git a/core/scripts/run-tests.sh b/core/scripts/run-tests.sh
index 15e6e80..05fbbfe 100755
--- a/core/scripts/run-tests.sh
+++ b/core/scripts/run-tests.sh
@@ -102,7 +102,14 @@
   exit(SIMPLETEST_SCRIPT_EXIT_SUCCESS);
 }
 
-$test_list = simpletest_script_get_test_list();
+//$test_list = simpletest_script_get_test_list();
+if (in_array('PHPUnit-FunctionalJavascript', $args['types'], TRUE)) {
+  $test_list = ['Drupal\Tests\toolbar\FunctionalJavascript\ToolbarIntegrationTest'];
+}
+else {
+  $test_list = [];
+}
+$args['repeat'] = 30;
 
 // Try to allocate unlimited time to run the tests.
 drupal_set_time_limit(0);
diff --git a/core/tests/Drupal/Tests/WebAssert.php b/core/tests/Drupal/Tests/WebAssert.php
index ec31fdf..7c02a14 100644
--- a/core/tests/Drupal/Tests/WebAssert.php
+++ b/core/tests/Drupal/Tests/WebAssert.php
@@ -247,4 +247,23 @@ public function assert($condition, $message) {
     throw new ExpectationException($message, $this->session->getDriver());
   }
 
+  /**
+   * Waits for AJAX request to be completed.
+   *
+   * @param int $timeout
+   *   (Optional) Timeout in milliseconds, defaults to 10000.
+   * @param string $message
+   *   (optional) A message for exception.
+   *
+   * @throws \RuntimeException
+   *   When the request is not completed. If left blank, a default message will
+   *   be displayed.
+   */
+  public function assertWaitOnAjaxRequest($timeout = 10000, $message = 'Unable to complete AJAX request.') {
+    $result = $this->session->wait($timeout, '(typeof(jQuery)=="undefined" || (0 === jQuery.active && 0 === jQuery(\':animated\').length))');
+    if (!$result) {
+      throw new \RuntimeException($message);
+    }
+  }
+
 }
