diff --git a/core/tests/Drupal/FunctionalTests/AJAX/AjaxTestBase.php b/core/tests/Drupal/FunctionalTests/AJAX/AjaxTestBase.php
new file mode 100644
index 0000000000..967208e2ec
--- /dev/null
+++ b/core/tests/Drupal/FunctionalTests/AJAX/AjaxTestBase.php
@@ -0,0 +1,63 @@
+<?php
+
+namespace Drupal\FunctionalTests\AJAX;
+
+use Drupal\Tests\BrowserTestBase;
+
+/**
+ * Provides a base class for Ajax tests.
+ */
+abstract class AjaxTestBase extends BrowserTestBase {
+
+  /**
+   * Modules to enable.
+   *
+   * @var array
+   */
+  public static $modules = ['node', 'ajax_test', 'ajax_forms_test'];
+
+  /**
+   * Asserts the array of Ajax commands contains the searched command.
+   *
+   * An AjaxResponse object stores an array of Ajax commands. This array
+   * sometimes includes commands automatically provided by the framework in
+   * addition to commands returned by a particular controller. During testing,
+   * we're usually interested that a particular command is present, and don't
+   * care whether other commands precede or follow the one we're interested in.
+   * Additionally, the command we're interested in may include additional data
+   * that we're not interested in. Therefore, this function simply asserts that
+   * one of the commands in $haystack contains all of the keys and values in
+   * $needle. Furthermore, if $needle contains a 'settings' key with an array
+   * value, we simply assert that all keys and values within that array are
+   * present in the command we're checking, and do not consider it a failure if
+   * the actual command contains additional settings that aren't part of
+   * $needle.
+   *
+   * @param $haystack
+   *   An array of rendered Ajax commands returned by the server.
+   * @param $needle
+   *   Array of info we're expecting in one of those commands.
+   * @param $message
+   *   An assertion message.
+   */
+  public function assertCommand($haystack, $needle, $message) {
+    $found = FALSE;
+    foreach ($haystack as $command) {
+      // If the command has additional settings that we're not testing for, do
+      // not consider that a failure.
+      if (isset($command['settings']) && is_array($command['settings']) && isset($needle['settings']) && is_array($needle['settings'])) {
+        $command['settings'] = array_intersect_key($command['settings'], $needle['settings']);
+      }
+      // If the command has additional data that we're not testing for, do not
+      // consider that a failure. Also, == instead of ===, because we don't
+      // require the key/value pairs to be in any particular order
+      // (http://php.net/manual/language.operators.array.php).
+      if (array_intersect_key($command, $needle) == $needle) {
+        $found = TRUE;
+        break;
+      }
+    }
+    $this->assertTrue($found, $message);
+  }
+
+}
diff --git a/core/modules/system/src/Tests/Ajax/FrameworkTest.php b/core/tests/Drupal/FunctionalTests/AJAX/FrameworkTest.php
similarity index 97%
rename from core/modules/system/src/Tests/Ajax/FrameworkTest.php
rename to core/tests/Drupal/FunctionalTests/AJAX/FrameworkTest.php
index 14bae06442..acc8f7fe28 100644
--- a/core/modules/system/src/Tests/Ajax/FrameworkTest.php
+++ b/core/tests/Drupal/FunctionalTests/AJAX/FrameworkTest.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\system\Tests\Ajax;
+namespace Drupal\FunctionalTests\AJAX;
 
 use Drupal\Core\Ajax\AddCssCommand;
 use Drupal\Core\Ajax\AlertCommand;
@@ -9,6 +9,7 @@
 use Drupal\Core\Ajax\PrependCommand;
 use Drupal\Core\Ajax\SettingsCommand;
 use Drupal\Core\Asset\AttachedAssets;
+use Drupal\FunctionalTests\AJAX\AjaxTestBase;
 
 /**
  * Performs tests on AJAX framework functions.
@@ -16,6 +17,14 @@
  * @group Ajax
  */
 class FrameworkTest extends AjaxTestBase {
+
+  /**
+   * Modules to enable.
+   *
+   * @var array
+   */
+  public static $modules = ['node', 'ajax_test', 'ajax_forms_test'];
+
   /**
    * Verifies the Ajax rendering of a command in the settings.
    */
@@ -81,7 +90,7 @@ public function testAJAXRenderError() {
     $edit = [
       'message' => 'Custom error message.',
     ];
-    $commands = $this->drupalGetAjax('ajax-test/render-error', ['query' => $edit]);
+    $commands = $this->drupalGet('ajax-test/render-error', ['query' => $edit]);
     $expected = new AlertCommand($edit['message']);
     $this->assertCommand($commands, $expected->render(), 'Custom error message is output.');
   }
