diff --git a/core/modules/comment/src/Tests/CommentPagerTest.php b/core/modules/comment/src/Tests/CommentPagerTest.php
index aa7d099..c782394 100644
--- a/core/modules/comment/src/Tests/CommentPagerTest.php
+++ b/core/modules/comment/src/Tests/CommentPagerTest.php
@@ -302,88 +302,6 @@ function testCommentNewPageIndicator() {
   }
 
   /**
-   * Confirms comment paging works correctly with two pagers.
-   */
-  function testTwoPagers() {
-    // Add another field to article content-type.
-    $this->addDefaultCommentField('node', 'article', 'comment_2');
-    // Set default to display comment list with unique pager id.
-    entity_get_display('node', 'article', 'default')
-      ->setComponent('comment_2', array(
-        'label' => 'hidden',
-        'type' => 'comment_default',
-        'weight' => 30,
-        'settings' => array(
-          'pager_id' => 1,
-          'view_mode' => 'default',
-        )
-      ))
-      ->save();
-
-    // Make sure pager appears in formatter summary and settings form.
-    $account = $this->drupalCreateUser(array('administer node display'));
-    $this->drupalLogin($account);
-    $this->drupalGet('admin/structure/types/manage/article/display');
-    $this->assertNoText(t('Pager ID: @id', array('@id' => 0)), 'No summary for standard pager');
-    $this->assertText(t('Pager ID: @id', array('@id' => 1)));
-    $this->drupalPostAjaxForm(NULL, array(), 'comment_settings_edit');
-    // Change default pager to 2.
-    $this->drupalPostForm(NULL, array('fields[comment][settings_edit_form][settings][pager_id]' => 2), t('Save'));
-    $this->assertText(t('Pager ID: @id', array('@id' => 2)));
-    // Revert the changes.
-    $this->drupalPostAjaxForm(NULL, array(), 'comment_settings_edit');
-    $this->drupalPostForm(NULL, array('fields[comment][settings_edit_form][settings][pager_id]' => 0), t('Save'));
-    $this->assertNoText(t('Pager ID: @id', array('@id' => 0)), 'No summary for standard pager');
-
-    $this->drupalLogin($this->adminUser);
-
-    // Add a new node with both comment fields open.
-    $node = $this->drupalCreateNode(array('type' => 'article', 'promote' => 1, 'uid' => $this->webUser->id()));
-    // Set comment options.
-    $comments = array();
-    foreach (array('comment', 'comment_2') as $field_name) {
-      $this->setCommentForm(TRUE, $field_name);
-      $this->setCommentPreview(DRUPAL_OPTIONAL, $field_name);
-      $this->setCommentSettings('default_mode', CommentManagerInterface::COMMENT_MODE_FLAT, 'Comment paging changed.', $field_name);
-
-      // Set comments to one per page so that we are able to test paging without
-      // needing to insert large numbers of comments.
-      $this->setCommentsPerPage(1, $field_name);
-      for ($i = 0; $i < 3; $i++) {
-        $comment = t('Comment @count on field @field', array(
-          '@count' => $i + 1,
-          '@field' => $field_name,
-        ));
-        $comments[] = $this->postComment($node, $comment, $comment, TRUE, $field_name);
-      }
-    }
-
-    // Check the first page of the node, and confirm the correct comments are
-    // shown.
-    $this->drupalGet('node/' . $node->id());
-    $this->assertRaw(t('next'), 'Paging links found.');
-    $this->assertRaw('Comment 1 on field comment');
-    $this->assertRaw('Comment 1 on field comment_2');
-    // Navigate to next page of field 1.
-    $this->clickLinkWithXPath('//h3/a[normalize-space(text())=:label]/ancestor::section[1]//a[@rel="next"]', array(':label' => 'Comment 1 on field comment'));
-    // Check only one pager updated.
-    $this->assertRaw('Comment 2 on field comment');
-    $this->assertRaw('Comment 1 on field comment_2');
-    // Return to page 1.
-    $this->drupalGet('node/' . $node->id());
-    // Navigate to next page of field 2.
-    $this->clickLinkWithXPath('//h3/a[normalize-space(text())=:label]/ancestor::section[1]//a[@rel="next"]', array(':label' => 'Comment 1 on field comment_2'));
-    // Check only one pager updated.
-    $this->assertRaw('Comment 1 on field comment');
-    $this->assertRaw('Comment 2 on field comment_2');
-    // Navigate to next page of field 1.
-    $this->clickLinkWithXPath('//h3/a[normalize-space(text())=:label]/ancestor::section[1]//a[@rel="next"]', array(':label' => 'Comment 1 on field comment'));
-    // Check only one pager updated.
-    $this->assertRaw('Comment 2 on field comment');
-    $this->assertRaw('Comment 2 on field comment_2');
-  }
-
-  /**
    * Follows a link found at a give xpath query.
    *
    * Will click the first link found with the given xpath query by default,
diff --git a/core/modules/comment/tests/src/FunctionalJavascript/CommentPagerTest.php b/core/modules/comment/tests/src/FunctionalJavascript/CommentPagerTest.php
new file mode 100644
index 0000000..dcc13e1
--- /dev/null
+++ b/core/modules/comment/tests/src/FunctionalJavascript/CommentPagerTest.php
@@ -0,0 +1,120 @@
+<?php
+
+namespace Drupal\Tests\comment\FunctionalJavascript;
+use Drupal\Core\Entity\Display\EntityViewDisplayInterface;
+
+/**
+ * Tests paging of comments and their settings.
+ *
+ * @group comment
+ */
+class CommentPagerTest extends CommentTestBase {
+
+  /**
+   * Confirms comment paging works correctly with two pagers.
+   */
+  function testTwoPagers() {
+    // Add another field to article content-type.
+    $this->addDefaultCommentField('node', 'article', 'comment_2');
+    // Set default to display comment list with unique pager id.
+
+    /** @var EntityViewDisplayInterface $display */
+    $display = \Drupal::entityTypeManager()->getStorage('entity_view_display')->load('node.article.default');
+    $display->setComponent('comment_2', array(
+        'label' => 'hidden',
+        'type' => 'comment_default',
+        'weight' => 30,
+        'settings' => array(
+          'pager_id' => 1,
+          'view_mode' => 'default',
+        )
+      ))
+      ->save();
+
+    // Make sure pager appears in formatter summary and settings form.
+    $account = $this->drupalCreateUser(array('administer node display'));
+    $this->drupalLogin($account);
+    $this->drupalGet('admin/structure/types/manage/article/display');
+
+    $session = $this->getSession();
+    $assert_session = $this->assertSession();
+    $page = $session->getPage();
+
+
+    $assert_session->responseNotContains(t('Pager ID: @id', array('@id' => 0)));
+    $assert_session->responseContains(t('Pager ID: @id', array('@id' => 1)));
+
+    $field_comment_settings_edit = $page->find('css', 'input[name="comment_settings_edit"]');
+    $field_comment_settings_edit->click();
+
+    $field_pager_id = $page->findField('fields[comment][settings_edit_form][settings][pager_id]');
+    $field_pager_id->setValue(2);
+    $page->findButton(t('Save'))->click();
+    $assert_session->assertWaitOnAjaxRequest();
+    $assert_session->responseContains(t('Pager ID: @id', array('@id' => 1)));
+
+    // Revert the changes.
+    $field_comment_settings_edit->click();
+    $field_pager_id->setValue('0');
+    $page->findButton(t('Save'))->click();
+    $assert_session->assertWaitOnAjaxRequest();
+    $assert_session->responseNotContains(t('Pager ID: @id', array('@id' => 0)));
+
+    $this->drupalLogin($this->adminUser);
+
+    // Add a new node with both comment fields open.
+    $node = $this->drupalCreateNode(array('type' => 'article', 'promote' => 1, 'uid' => $this->webUser->id()));
+    // Set comment options.
+    $comments = array();
+    foreach (array('comment', 'comment_2') as $field_name) {
+      $this->setCommentForm(TRUE, $field_name);
+      $this->setCommentPreview(DRUPAL_OPTIONAL, $field_name);
+      $this->setCommentSettings('default_mode', CommentManagerInterface::COMMENT_MODE_FLAT, 'Comment paging changed.', $field_name);
+
+      // Set comments to one per page so that we are able to test paging without
+      // needing to insert large numbers of comments.
+      $this->setCommentsPerPage(1, $field_name);
+      for ($i = 0; $i < 3; $i++) {
+        $comment = t('Comment @count on field @field', array(
+          '@count' => $i + 1,
+          '@field' => $field_name,
+        ));
+        $comments[] = $this->postComment($node, $comment, $comment, TRUE, $field_name);
+      }
+    }
+
+    // Check the first page of the node, and confirm the correct comments are
+    // shown.
+    $this->drupalGet('node/' . $node->id());
+    
+    $this->assertEquals('', $page->getHTML());
+    
+    $next_links = $page->findAll('named', t('next'));
+    $this->assertEquals(2, count($next_links), 'Paging links found.');
+    $assert_session->responseContains('Comment 1 on field comment');
+    $assert_session->responseContains('Comment 1 on field comment_2');
+
+    // Navigate to next page of field 1.
+    $field_1_next = $page->find('xpath', '//h3/a[normalize-space(text())=:label]/ancestor::section[1]//a[@rel="next"]');
+    $field_1_next->click();
+
+    // Check only one pager updated.
+    $assert_session->responseContains('Comment 2 on field comment');
+    $assert_session->responseContains('Comment 1 on field comment_2');
+
+    // Return to page 1.
+    $this->drupalGet('node/' . $node->id());
+    // Navigate to next page of field 2.
+    $field_2_next = $page->find('xpath', '//h3/a[normalize-space(text())=:label]/ancestor::section[1]//a[@rel="next"]');
+    $field_2_next->click();
+    // $this->clickLinkWithXPath('', array(':label' => 'Comment 1 on field comment_2'));
+    // Check only one pager updated.
+    $assert_session->responseContains('Comment 1 on field comment');
+    $assert_session->responseContains('Comment 2 on field comment_2');
+    // Navigate to next page of field 1.
+    $field_1_next->click();
+    // Check only one pager updated.
+    $assert_session->responseContains('Comment 2 on field comment');
+    $assert_session->responseContains('Comment 2 on field comment_2');
+  }
+}
diff --git a/core/modules/comment/tests/src/FunctionalJavascript/CommentTestBase.php b/core/modules/comment/tests/src/FunctionalJavascript/CommentTestBase.php
new file mode 100644
index 0000000..0b6ff07
--- /dev/null
+++ b/core/modules/comment/tests/src/FunctionalJavascript/CommentTestBase.php
@@ -0,0 +1,291 @@
+<?php
+
+namespace Drupal\Tests\comment\FunctionalJavascript;
+
+use Drupal\Core\Entity\Display\EntityFormDisplayInterface;
+use Drupal\FunctionalJavascriptTests\JavascriptTestBase;
+
+use Drupal\comment\Entity\Comment;
+use Drupal\field\Entity\FieldConfig;
+use Drupal\comment\Plugin\Field\FieldType\CommentItemInterface;
+use Drupal\node\Entity\NodeType;
+use Drupal\comment\Tests\CommentTestTrait;
+
+/**
+ * Provides setup and helper methods for comment tests.
+ */
+abstract class CommentTestBase extends JavascriptTestBase {
+
+  use CommentTestTrait;
+
+  /**
+   * Modules to install.
+   *
+   * @var array
+   */
+  public static $modules = ['block', 'comment', 'node', 'history', 'field_ui', 'datetime'];
+
+  /**
+   * An administrative user with permission to configure comment settings.
+   *
+   * @var \Drupal\user\UserInterface
+   */
+  protected $adminUser;
+
+  /**
+   * A normal user with permission to post comments.
+   *
+   * @var \Drupal\user\UserInterface
+   */
+  protected $webUser;
+
+  /**
+   * A test node to which comments will be posted.
+   *
+   * @var \Drupal\node\NodeInterface
+   */
+  protected $node;
+
+  protected function setUp() {
+    parent::setUp();
+
+    // Create an article content type only if it does not yet exist, so that
+    // child classes may specify the standard profile.
+    $types = NodeType::loadMultiple();
+    if (empty($types['article'])) {
+      $this->drupalCreateContentType(array('type' => 'article', 'name' => t('Article')));
+    }
+
+    // Create two test users.
+    $this->adminUser = $this->drupalCreateUser(array(
+      'administer content types',
+      'administer comments',
+      'administer comment types',
+      'administer comment fields',
+      'administer comment display',
+      'skip comment approval',
+      'post comments',
+      'access comments',
+      // Usernames aren't shown in comment edit form autocomplete unless this
+      // permission is granted.
+      'access user profiles',
+      'access content',
+     ));
+    $this->webUser = $this->drupalCreateUser(array(
+      'access comments',
+      'post comments',
+      'create article content',
+      'edit own comments',
+      'skip comment approval',
+      'access content',
+    ));
+
+    // Create comment field on article.
+    $this->addDefaultCommentField('node', 'article');
+
+    // Create a test node authored by the web user.
+    $this->node = $this->drupalCreateNode(array('type' => 'article', 'promote' => 1, 'uid' => $this->webUser->id()));
+    $this->drupalPlaceBlock('local_tasks_block');
+  }
+
+  /**
+   * Posts a comment.
+   *
+   * @param \Drupal\Core\Entity\EntityInterface|null $entity
+   *   Node to post comment on or NULL to post to the previously loaded page.
+   * @param string $comment
+   *   Comment body.
+   * @param string $subject
+   *   Comment subject.
+   * @param string $contact
+   *   Set to NULL for no contact info, TRUE to ignore success checking, and
+   *   array of values to set contact info.
+   * @param string $field_name
+   *   (optional) Field name through which the comment should be posted.
+   *   Defaults to 'comment'.
+   *
+   * @return \Drupal\comment\CommentInterface|null
+   *   The posted comment or NULL when posted comment was not found.
+   */
+  public function postComment($entity, $comment, $subject = '', $contact = NULL, $field_name = 'comment') {
+    $edit = array();
+    $edit['comment_body[0][value]'] = $comment;
+
+    if ($entity !== NULL) {
+      $field = FieldConfig::loadByName($entity->getEntityTypeId(), $entity->bundle(), $field_name);
+    }
+    else {
+      $field = FieldConfig::loadByName('node', 'article', $field_name);
+    }
+    $preview_mode = $field->getSetting('preview');
+
+    $this->drupalGet('comment/reply/' . $entity->getEntityTypeId() . '/' . $entity->id() . '/' . $field_name);
+
+    $session = $this->getSession();
+    $assert_session = $this->assertSession();
+    $page = $session->getPage();
+
+    // Determine the visibility of subject form field.
+    $field_subject = $page->findField('subject[0][value]');
+    /** @var EntityFormDisplayInterface $comment_form_display */
+    $comment_form_display = \Drupal::entityTypeManager()->getStorage('entity_form_display')->load('comment.comment.default');
+    if ($comment_form_display->getComponent('subject')) {
+      // Subject input allowed.
+      $this->assertTrue($field_subject->isVisible());
+      $field_subject->setValue($subject);
+    }
+    else {
+      $this->assertEmpty($field_subject, 'Subject field not found.');
+    }
+
+    if ($contact !== NULL && is_array($contact)) {
+      foreach ($contact as $contact_field_name => $contact_field_value) {
+        $element = $page->findField($contact_field_name);
+        $this->assertNotEmpty($element);
+        $element->setValue($contact_field_value);
+      }
+    }
+
+    switch ($preview_mode) {
+      case DRUPAL_REQUIRED:
+        // Preview required so no save button should be found.
+        $button_save = $page->findButton(t('Save'));
+        $button_preview = $page->findButton(t('Preview'));
+        $this->assertEmpty($button_save, 'Save button not found.');
+        $button_preview->click();
+        // Don't break here so that we can test post-preview field presence and
+        // function below.
+      case DRUPAL_OPTIONAL:
+        $button_save = $page->findButton(t('Save'));
+        $button_preview = $page->findButton(t('Preview'));
+        $this->assertNotEmpty($button_save, 'Preview button found.');
+        $this->assertNotEmpty($button_preview, 'Save button found.');
+
+        $button_save->click();
+        break;
+
+      case DRUPAL_DISABLED:
+        $button_save = $page->findButton(t('Save'));
+        $button_preview = $page->findButton(t('Preview'));
+        $this->assertEmpty($button_save, 'Preview button not found.');
+        $this->assertNotEmpty($button_preview, 'Save button found.');
+
+        $button_save->click();
+        break;
+    }
+    $match = array();
+    // Get comment ID
+    preg_match('/#comment-([0-9]+)/', $this->getURL(), $match);
+
+    // Get comment.
+    if ($contact !== TRUE) { // If true then attempting to find error message.
+      if ($subject) {
+
+        $assert_session->responseContains($subject);
+      }
+      $assert_session->responseContains($comment);
+      $this->assertTrue((!empty($match) && !empty($match[1])), 'Comment id found.');
+    }
+
+    if (isset($match[1])) {
+      $this->container->get('entity.manager')->getStorage('comment')->resetCache(array($match[1]));
+      return Comment::load($match[1]);
+    }
+  }
+
+  /**
+   * Sets the value governing whether the subject field should be enabled.
+   *
+   * @param bool $enabled
+   *   Boolean specifying whether the subject field should be enabled.
+   */
+  public function setCommentSubject($enabled) {
+    $form_display = entity_get_form_display('comment', 'comment', 'default');
+    if ($enabled) {
+      $form_display->setComponent('subject', array(
+        'type' => 'string_textfield',
+      ));
+    }
+    else {
+      $form_display->removeComponent('subject');
+    }
+    $form_display->save();
+    // Display status message.
+    $this->pass('Comment subject ' . ($enabled ? 'enabled' : 'disabled') . '.');
+  }
+
+  /**
+   * Sets the value governing the previewing mode for the comment form.
+   *
+   * @param int $mode
+   *   The preview mode: DRUPAL_DISABLED, DRUPAL_OPTIONAL or DRUPAL_REQUIRED.
+   * @param string $field_name
+   *   (optional) Field name through which the comment should be posted.
+   *   Defaults to 'comment'.
+   */
+  public function setCommentPreview($mode, $field_name = 'comment') {
+    switch ($mode) {
+      case DRUPAL_DISABLED:
+        $mode_text = 'disabled';
+        break;
+
+      case DRUPAL_OPTIONAL:
+        $mode_text = 'optional';
+        break;
+
+      case DRUPAL_REQUIRED:
+        $mode_text = 'required';
+        break;
+    }
+    $this->setCommentSettings('preview', $mode, format_string('Comment preview @mode_text.', array('@mode_text' => $mode_text)), $field_name);
+  }
+
+  /**
+   * Sets the value governing whether the comment form is on its own page.
+   *
+   * @param bool $enabled
+   *   TRUE if the comment form should be displayed on the same page as the
+   *   comments; FALSE if it should be displayed on its own page.
+   * @param string $field_name
+   *   (optional) Field name through which the comment should be posted.
+   *   Defaults to 'comment'.
+   */
+  public function setCommentForm($enabled, $field_name = 'comment') {
+    $this->setCommentSettings('form_location', ($enabled ? CommentItemInterface::FORM_BELOW : CommentItemInterface::FORM_SEPARATE_PAGE), 'Comment controls ' . ($enabled ? 'enabled' : 'disabled') . '.', $field_name);
+  }
+
+  /**
+   * Sets the value specifying the default number of comments per page.
+   *
+   * @param int $number
+   *   Comments per page value.
+   * @param string $field_name
+   *   (optional) Field name through which the comment should be posted.
+   *   Defaults to 'comment'.
+   */
+  public function setCommentsPerPage($number, $field_name = 'comment') {
+    $this->setCommentSettings('per_page', $number, format_string('Number of comments per page set to @number.', array('@number' => $number)), $field_name);
+  }
+
+  /**
+   * Sets a comment settings variable for the article content type.
+   *
+   * @param string $name
+   *   Name of variable.
+   * @param string $value
+   *   Value of variable.
+   * @param string $message
+   *   Status message to display.
+   * @param string $field_name
+   *   (optional) Field name through which the comment should be posted.
+   *   Defaults to 'comment'.
+   */
+  public function setCommentSettings($name, $value, $message, $field_name = 'comment') {
+    $field = FieldConfig::loadByName('node', 'article', $field_name);
+    $field->setSetting($name, $value);
+    $field->save();
+    // Display status message.
+    $this->pass($message);
+  }
+
+}
