diff --git a/core/modules/system/src/Tests/Ajax/AjaxFormPageCacheTest.php b/core/tests/Drupal/FunctionalJavascriptTests/Ajax/AjaxFormPageCacheTest.php
similarity index 55%
rename from core/modules/system/src/Tests/Ajax/AjaxFormPageCacheTest.php
rename to core/tests/Drupal/FunctionalJavascriptTests/Ajax/AjaxFormPageCacheTest.php
index a537b73e81..088ae33e8f 100644
--- a/core/modules/system/src/Tests/Ajax/AjaxFormPageCacheTest.php
+++ b/core/tests/Drupal/FunctionalJavascriptTests/Ajax/AjaxFormPageCacheTest.php
@@ -1,13 +1,22 @@
 <?php
 
-namespace Drupal\system\Tests\Ajax;
+namespace Drupal\FunctionalJavascriptTests\Ajax;
+
+use Drupal\FunctionalJavascriptTests\JavascriptTestBase;
 
 /**
  * Performs tests on AJAX forms in cached pages.
  *
  * @group Ajax
  */
-class AjaxFormPageCacheTest extends AjaxTestBase {
+class AjaxFormPageCacheTest extends JavascriptTestBase {
+
+  /**
+   * Modules to enable.
+   *
+   * @var array
+   */
+  public static $modules = ['node', 'ajax_test', 'ajax_forms_test'];
 
   /**
    * {@inheritdoc}
@@ -26,7 +35,7 @@ protected function setUp() {
   protected function getFormBuildId() {
     $build_id_fields = $this->xpath('//input[@name="form_build_id"]');
     $this->assertEqual(count($build_id_fields), 1, 'One form build id field on the page');
-    return (string) $build_id_fields[0]['value'];
+    return (string) $build_id_fields[0]->getValue();
   }
 
   /**
@@ -37,27 +46,19 @@ public function testSimpleAJAXFormValue() {
     $this->assertEqual($this->drupalGetHeader('X-Drupal-Cache'), 'MISS', 'Page was not cached.');
     $build_id_initial = $this->getFormBuildId();
 
-    $edit = ['select' => 'green'];
-    $commands = $this->drupalPostAjaxForm(NULL, $edit, 'select');
+    $session = $this->getSession();
+    // Changing the value of a select input element, triggers a AJAX request/response.
+    $session->getPage()->selectFieldOption('select', 'green');
+    $this->assertSession()->assertWaitOnAjaxRequest();
+
     $build_id_first_ajax = $this->getFormBuildId();
-    $this->assertNotEqual($build_id_initial, $build_id_first_ajax, 'Build id is changed in the simpletest-DOM on first AJAX submission');
-    $expected = [
-      'command' => 'update_build_id',
-      'old' => $build_id_initial,
-      'new' => $build_id_first_ajax,
-    ];
-    $this->assertCommand($commands, $expected, 'Build id change command issued on first AJAX submission');
-
-    $edit = ['select' => 'red'];
-    $commands = $this->drupalPostAjaxForm(NULL, $edit, 'select');
+    $this->assertNotEqual($build_id_initial, $build_id_first_ajax, 'Build id is changed in the form_build_id element on first AJAX submission');
+
+    // Changing the value of a select input element, triggers a AJAX request/response.
+    $session->getPage()->selectFieldOption('select', 'red');
+    $this->assertSession()->assertWaitOnAjaxRequest();
     $build_id_second_ajax = $this->getFormBuildId();
     $this->assertNotEqual($build_id_first_ajax, $build_id_second_ajax, 'Build id changes on subsequent AJAX submissions');
-    $expected = [
-      'command' => 'update_build_id',
-      'old' => $build_id_first_ajax,
-      'new' => $build_id_second_ajax,
-    ];
-    $this->assertCommand($commands, $expected, 'Build id change command issued on subsequent AJAX submissions');
 
     // Repeat the test sequence but this time with a page loaded from the cache.
     $this->drupalGet('ajax_forms_test_get_form');
@@ -65,38 +66,30 @@ public function testSimpleAJAXFormValue() {
     $build_id_from_cache_initial = $this->getFormBuildId();
     $this->assertEqual($build_id_initial, $build_id_from_cache_initial, 'Build id is the same as on the first request');
 
-    $edit = ['select' => 'green'];
-    $commands = $this->drupalPostAjaxForm(NULL, $edit, 'select');
+    // Changing the value of a select input element, triggers a AJAX request/response.
+    $session->getPage()->selectFieldOption('select', 'green');
+    $this->assertSession()->assertWaitOnAjaxRequest();
     $build_id_from_cache_first_ajax = $this->getFormBuildId();
     $this->assertNotEqual($build_id_from_cache_initial, $build_id_from_cache_first_ajax, 'Build id is changed in the simpletest-DOM on first AJAX submission');
     $this->assertNotEqual($build_id_first_ajax, $build_id_from_cache_first_ajax, 'Build id from first user is not reused');
-    $expected = [
-      'command' => 'update_build_id',
-      'old' => $build_id_from_cache_initial,
-      'new' => $build_id_from_cache_first_ajax,
-    ];
-    $this->assertCommand($commands, $expected, 'Build id change command issued on first AJAX submission');
-
-    $edit = ['select' => 'red'];
-    $commands = $this->drupalPostAjaxForm(NULL, $edit, 'select');
+
+    // Changing the value of a select input element, triggers a AJAX request/response.
+    $session->getPage()->selectFieldOption('select', 'red');
+    $this->assertSession()->assertWaitOnAjaxRequest();
     $build_id_from_cache_second_ajax = $this->getFormBuildId();
     $this->assertNotEqual($build_id_from_cache_first_ajax, $build_id_from_cache_second_ajax, 'Build id changes on subsequent AJAX submissions');
-    $expected = [
-      'command' => 'update_build_id',
-      'old' => $build_id_from_cache_first_ajax,
-      'new' => $build_id_from_cache_second_ajax,
-    ];
-    $this->assertCommand($commands, $expected, 'Build id change command issued on subsequent AJAX submissions');
+
   }
 
   /**
-   * Tests a form that uses an #ajax callback.
+   * Tests that updating the text field trigger an AJAX request/response.
    *
    * @see \Drupal\system\Tests\Ajax\ElementValidationTest::testAjaxElementValidation()
    */
   public function testAjaxElementValidation() {
-    $edit = ['drivertext' => t('some dumb text')];
-    $this->drupalPostAjaxForm('ajax_validation_test', $edit, 'drivertext');
+    $this->drupalGet('ajax_validation_test');
+    $this->getSession()->getPage()->fillField('drivertext', 'some dumb test');
+    $this->assertSession()->assertWaitOnAjaxRequest();
   }
 
 }
diff --git a/core/tests/Drupal/Tests/Core/Ajax/AjaxCommandsTest.php b/core/tests/Drupal/Tests/Core/Ajax/AjaxCommandsTest.php
index 215d9224d9..4db1d02158 100644
--- a/core/tests/Drupal/Tests/Core/Ajax/AjaxCommandsTest.php
+++ b/core/tests/Drupal/Tests/Core/Ajax/AjaxCommandsTest.php
@@ -24,6 +24,7 @@
 use Drupal\Core\Ajax\SetDialogOptionCommand;
 use Drupal\Core\Ajax\SetDialogTitleCommand;
 use Drupal\Core\Ajax\RedirectCommand;
+use Drupal\Core\Ajax\UpdateBuildIdCommand;
 
 /**
  * Test coverage for various classes in the \Drupal\Core\Ajax namespace.
@@ -429,4 +430,20 @@ public function testRedirectCommand() {
     $this->assertEquals($expected, $command->render());
   }
 
+  /**
+   * @covers \Drupal\Core\Ajax\UpdateBuildIdCommand
+   */
+  public function testUpdateBuildIdCommand() {
+    $old = 'ThisStringisOld';
+    $new = 'ThisStringIsNew';
+    $command = new UpdateBuildIdCommand($old, $new);
+    $expected = [
+      'command' => 'update_build_id',
+      'old' => $old,
+      'new' => $new,
+    ];
+
+    $this->assertEquals($expected, $command->render());
+  }
+
 }
