diff --git a/core/modules/system/src/Tests/Ajax/AjaxFormCacheTest.php b/core/tests/Drupal/FunctionalJavascriptTests/Ajax/AjaxFormCacheTest.php
similarity index 63%
rename from core/modules/system/src/Tests/Ajax/AjaxFormCacheTest.php
rename to core/tests/Drupal/FunctionalJavascriptTests/Ajax/AjaxFormCacheTest.php
index 11a4044e07..2255ad6540 100644
--- a/core/modules/system/src/Tests/Ajax/AjaxFormCacheTest.php
+++ b/core/tests/Drupal/FunctionalJavascriptTests/Ajax/AjaxFormCacheTest.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\system\Tests\Ajax;
+namespace Drupal\FunctionalJavascriptTests\Ajax;
 
 use Drupal\Core\EventSubscriber\MainContentViewSubscriber;
 use Drupal\Core\Form\FormBuilderInterface;
@@ -47,11 +47,27 @@ public function testBlockForms() {
     $this->drupalPlaceBlock('ajax_forms_test_block');
 
     $this->drupalGet('');
-    $this->drupalPostAjaxForm(NULL, ['test1' => 'option1'], 'test1');
-    $this->assertOptionSelectedWithDrupalSelector('edit-test1', 'option1');
-    $this->assertOptionWithDrupalSelector('edit-test1', 'option3');
-    $this->drupalPostForm(NULL, ['test1' => 'option1'], 'Submit');
-    $this->assertText('Submission successful.');
+    $session = $this->getSession();
+
+    // Select first option and trigger ajax update.
+    $session->getPage()->selectFieldOption('edit-test1', 'option1');
+    $this->assertSession()->assertWaitOnAjaxRequest();
+
+    // Confirm option1 has been selected.
+    $page = $session->getPage();
+    $opt1_selector = $page->find('xpath', '//select[@data-drupal-selector="edit-test1"]//option[@value="option1"]');
+    $this->assertNotEmpty($opt1_selector);
+    $this->assertTrue($opt1_selector->isSelected());
+
+    // Confirm option 3 exists.
+    $opt3_selector = $page->find('xpath', '//select[@data-drupal-selector="edit-test1"]//option[@value="option3"]');
+    $this->assertNotEmpty($opt3_selector);
+
+    // Confirm success message appears after a submit.
+    $page->findButton('edit-submit')->click();
+    $this->assertSession()->waitForButton('edit-submit');
+    $updated_page = $session->getPage();
+    $updated_page->hasContent('Submission successful.');
   }
 
   /**
@@ -65,7 +81,12 @@ public function testQueryString() {
 
     $url = Url::fromRoute('entity.user.canonical', ['user' => $this->rootUser->id()], ['query' => ['foo' => 'bar']]);
     $this->drupalGet($url);
-    $this->drupalPostAjaxForm(NULL, ['test1' => 'option1'], 'test1');
+
+    $session = $this->getSession();
+    // Select first option and trigger ajax update.
+    $session->getPage()->selectFieldOption('edit-test1', 'option1');
+    $this->assertSession()->assertWaitOnAjaxRequest();
+
     $url->setOption('query', [
       'foo' => 'bar',
       FormBuilderInterface::AJAX_FORM_REQUEST => 1,
diff --git a/core/modules/system/src/Tests/Ajax/AjaxFormPageCacheTest.php b/core/tests/Drupal/FunctionalJavascriptTests/Ajax/AjaxFormPageCacheTest.php
similarity index 98%
rename from core/modules/system/src/Tests/Ajax/AjaxFormPageCacheTest.php
rename to core/tests/Drupal/FunctionalJavascriptTests/Ajax/AjaxFormPageCacheTest.php
index a537b73e81..dc9a570374 100644
--- a/core/modules/system/src/Tests/Ajax/AjaxFormPageCacheTest.php
+++ b/core/tests/Drupal/FunctionalJavascriptTests/Ajax/AjaxFormPageCacheTest.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\system\Tests\Ajax;
+namespace Drupal\FunctionalJavascriptTests\Ajax;
 
 /**
  * Performs tests on AJAX forms in cached pages.
diff --git a/core/modules/system/src/Tests/Ajax/AjaxInGroupTest.php b/core/tests/Drupal/FunctionalJavascriptTests/Ajax/AjaxInGroupTest.php
similarity index 94%
rename from core/modules/system/src/Tests/Ajax/AjaxInGroupTest.php
rename to core/tests/Drupal/FunctionalJavascriptTests/Ajax/AjaxInGroupTest.php
index 4116f5f892..cd86ae7e28 100644
--- a/core/modules/system/src/Tests/Ajax/AjaxInGroupTest.php
+++ b/core/tests/Drupal/FunctionalJavascriptTests/Ajax/AjaxInGroupTest.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\system\Tests\Ajax;
+namespace Drupal\FunctionalJavascriptTests\Ajax;
 
 /**
  * Tests that form elements in groups work correctly with AJAX.
diff --git a/core/modules/system/src/Tests/Ajax/AjaxTestBase.php b/core/tests/Drupal/FunctionalJavascriptTests/Ajax/AjaxTestBase.php
similarity index 93%
rename from core/modules/system/src/Tests/Ajax/AjaxTestBase.php
rename to core/tests/Drupal/FunctionalJavascriptTests/Ajax/AjaxTestBase.php
index 66e06c88a4..908864c03c 100644
--- a/core/modules/system/src/Tests/Ajax/AjaxTestBase.php
+++ b/core/tests/Drupal/FunctionalJavascriptTests/Ajax/AjaxTestBase.php
@@ -1,13 +1,13 @@
 <?php
 
-namespace Drupal\system\Tests\Ajax;
+namespace Drupal\FunctionalJavascriptTests\Ajax;
 
-use Drupal\simpletest\WebTestBase;
+use Drupal\FunctionalJavascriptTests\JavascriptTestBase;
 
 /**
  * Provides a base class for Ajax tests.
  */
-abstract class AjaxTestBase extends WebTestBase {
+abstract class AjaxTestBase extends JavascriptTestBase {
 
   /**
    * Modules to enable.
diff --git a/core/modules/system/src/Tests/Ajax/CommandsTest.php b/core/tests/Drupal/FunctionalJavascriptTests/Ajax/CommandsTest.php
similarity index 99%
rename from core/modules/system/src/Tests/Ajax/CommandsTest.php
rename to core/tests/Drupal/FunctionalJavascriptTests/Ajax/CommandsTest.php
index 6970cc30df..f575e01f2e 100644
--- a/core/modules/system/src/Tests/Ajax/CommandsTest.php
+++ b/core/tests/Drupal/FunctionalJavascriptTests/Ajax/CommandsTest.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\system\Tests\Ajax;
+namespace Drupal\FunctionalJavascriptTests\Ajax;
 
 use Drupal\Core\Ajax\AddCssCommand;
 use Drupal\Core\Ajax\AfterCommand;
diff --git a/core/modules/system/src/Tests/Ajax/DialogTest.php b/core/tests/Drupal/FunctionalJavascriptTests/Ajax/DialogTest.php
similarity index 99%
rename from core/modules/system/src/Tests/Ajax/DialogTest.php
rename to core/tests/Drupal/FunctionalJavascriptTests/Ajax/DialogTest.php
index ec947825fe..258b9f68f4 100644
--- a/core/modules/system/src/Tests/Ajax/DialogTest.php
+++ b/core/tests/Drupal/FunctionalJavascriptTests/Ajax/DialogTest.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\system\Tests\Ajax;
+namespace Drupal\FunctionalJavascriptTests\Ajax;
 
 use Drupal\ajax_test\Controller\AjaxTestController;
 use Drupal\Core\EventSubscriber\MainContentViewSubscriber;
diff --git a/core/modules/system/src/Tests/Ajax/ElementValidationTest.php b/core/tests/Drupal/FunctionalJavascriptTests/Ajax/ElementValidationTest.php
similarity index 96%
rename from core/modules/system/src/Tests/Ajax/ElementValidationTest.php
rename to core/tests/Drupal/FunctionalJavascriptTests/Ajax/ElementValidationTest.php
index d20f453be4..c89d974389 100644
--- a/core/modules/system/src/Tests/Ajax/ElementValidationTest.php
+++ b/core/tests/Drupal/FunctionalJavascriptTests/Ajax/ElementValidationTest.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\system\Tests\Ajax;
+namespace Drupal\FunctionalJavascriptTests\Ajax;
 
 /**
  * Various tests of AJAX behavior.
diff --git a/core/modules/system/src/Tests/Ajax/FormValuesTest.php b/core/tests/Drupal/FunctionalJavascriptTests/Ajax/FormValuesTest.php
similarity index 97%
rename from core/modules/system/src/Tests/Ajax/FormValuesTest.php
rename to core/tests/Drupal/FunctionalJavascriptTests/Ajax/FormValuesTest.php
index 9f4b521752..d3f997aae3 100644
--- a/core/modules/system/src/Tests/Ajax/FormValuesTest.php
+++ b/core/tests/Drupal/FunctionalJavascriptTests/Ajax/FormValuesTest.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\system\Tests\Ajax;
+namespace Drupal\FunctionalJavascriptTests\Ajax;
 
 use Drupal\Core\Ajax\DataCommand;
 
diff --git a/core/modules/system/src/Tests/Ajax/FrameworkTest.php b/core/tests/Drupal/FunctionalJavascriptTests/Ajax/FrameworkTest.php
similarity index 99%
rename from core/modules/system/src/Tests/Ajax/FrameworkTest.php
rename to core/tests/Drupal/FunctionalJavascriptTests/Ajax/FrameworkTest.php
index 14bae06442..bf68eaa6cf 100644
--- a/core/modules/system/src/Tests/Ajax/FrameworkTest.php
+++ b/core/tests/Drupal/FunctionalJavascriptTests/Ajax/FrameworkTest.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\system\Tests\Ajax;
+namespace Drupal\FunctionalJavascriptTests\Ajax;
 
 use Drupal\Core\Ajax\AddCssCommand;
 use Drupal\Core\Ajax\AlertCommand;
diff --git a/core/modules/system/src/Tests/Ajax/MultiFormTest.php b/core/tests/Drupal/FunctionalJavascriptTests/Ajax/MultiFormTest.php
similarity index 98%
rename from core/modules/system/src/Tests/Ajax/MultiFormTest.php
rename to core/tests/Drupal/FunctionalJavascriptTests/Ajax/MultiFormTest.php
index 9ca2a66781..d874c564cc 100644
--- a/core/modules/system/src/Tests/Ajax/MultiFormTest.php
+++ b/core/tests/Drupal/FunctionalJavascriptTests/Ajax/MultiFormTest.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\system\Tests\Ajax;
+namespace Drupal\FunctionalJavascriptTests\Ajax;
 
 use Drupal\Core\Field\FieldStorageDefinitionInterface;
 use Drupal\field\Entity\FieldConfig;
