diff --git a/core/modules/comment/src/Tests/CommentTestBase.php b/core/modules/comment/src/Tests/CommentTestBase.php
index e15915f..7f9e3a2 100644
--- a/core/modules/comment/src/Tests/CommentTestBase.php
+++ b/core/modules/comment/src/Tests/CommentTestBase.php
@@ -2,6 +2,8 @@
 
 namespace Drupal\comment\Tests;
 
+@trigger_error('\Drupal\comment\Tests\CommentTestBase is deprecated in Drupal 8.4.0 and will be removed before Drupal 9.0.0. Instead, use \Drupal\Tests\comment\Functional\CommentTestBase', E_USER_DEPRECATED);
+
 use Drupal\comment\Entity\CommentType;
 use Drupal\comment\Entity\Comment;
 use Drupal\comment\CommentInterface;
@@ -12,6 +14,9 @@
 
 /**
  * Provides setup and helper methods for comment tests.
+ *
+ * @deprecated in Drupal 8.4.0 and will be removed before Drupal 9.0.0.
+ *   Use \Drupal\Tests\comment\Functional\CommentTestBase instead.
  */
 abstract class CommentTestBase extends WebTestBase {
 
diff --git a/core/modules/comment/src/Tests/Views/CommentTestBase.php b/core/modules/comment/src/Tests/Views/CommentTestBase.php
index d7bec04..2b3ae1d 100644
--- a/core/modules/comment/src/Tests/Views/CommentTestBase.php
+++ b/core/modules/comment/src/Tests/Views/CommentTestBase.php
@@ -2,13 +2,17 @@
 
 namespace Drupal\comment\Tests\Views;
 
+@trigger_error('\Drupal\comment\Tests\Views\CommentTestBase is deprecated in Drupal 8.4.0 and will be removed before Drupal 9.0.0. Instead, use \Drupal\Tests\comment\Functional\Views\CommentTestBase', E_USER_DEPRECATED);
+
 use Drupal\comment\Tests\CommentTestTrait;
-use Drupal\views\Tests\ViewTestBase;
 use Drupal\views\Tests\ViewTestData;
 use Drupal\comment\Entity\Comment;
 
 /**
  * Tests the argument_comment_user_uid handler.
+ *
+ * @deprecated in Drupal 8.4.0 and will be removed before Drupal 9.0.0.
+ *   Use \Drupal\Tests\comment\Functional\Views\CommentTestBase instead.
  */
 abstract class CommentTestBase extends ViewTestBase {
 
diff --git a/core/modules/comment/src/Tests/CommentActionsTest.php b/core/modules/comment/tests/src/Functional/CommentActionsTest.php
similarity index 97%
rename from core/modules/comment/src/Tests/CommentActionsTest.php
rename to core/modules/comment/tests/src/Functional/CommentActionsTest.php
index 56d34e4..79786fc 100644
--- a/core/modules/comment/src/Tests/CommentActionsTest.php
+++ b/core/modules/comment/tests/src/Functional/CommentActionsTest.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\comment\Tests;
+namespace Drupal\Tests\comment\Functional;
 
 use Drupal\comment\Entity\Comment;
 use Drupal\system\Entity\Action;
diff --git a/core/modules/comment/src/Tests/CommentAdminTest.php b/core/modules/comment/tests/src/Functional/CommentAdminTest.php
similarity index 99%
rename from core/modules/comment/src/Tests/CommentAdminTest.php
rename to core/modules/comment/tests/src/Functional/CommentAdminTest.php
index 7c4aae0..93cff3c 100644
--- a/core/modules/comment/src/Tests/CommentAdminTest.php
+++ b/core/modules/comment/tests/src/Functional/CommentAdminTest.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\comment\Tests;
+namespace Drupal\Tests\comment\Functional;
 
 use Drupal\Component\Render\FormattableMarkup;
 use Drupal\Component\Utility\Html;
diff --git a/core/modules/comment/src/Tests/CommentAnonymousTest.php b/core/modules/comment/tests/src/Functional/CommentAnonymousTest.php
similarity index 98%
rename from core/modules/comment/src/Tests/CommentAnonymousTest.php
rename to core/modules/comment/tests/src/Functional/CommentAnonymousTest.php
index d60c073..bd04537 100644
--- a/core/modules/comment/src/Tests/CommentAnonymousTest.php
+++ b/core/modules/comment/tests/src/Functional/CommentAnonymousTest.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\comment\Tests;
+namespace Drupal\Tests\comment\Functional;
 
 use Drupal\user\RoleInterface;
 
@@ -43,7 +43,7 @@ public function testAnonymous() {
     $edit['comment_body[0][value]'] = $body;
     $this->drupalPostForm($this->node->urlInfo(), $edit, t('Preview'));
     // Cannot use assertRaw here since both title and body are in the form.
-    $preview = (string) $this->cssSelect('.preview')[0]->asXML();
+    $preview = (string) $this->cssSelect('.preview')[0]->getHtml();
     $this->assertTrue(strpos($preview, $title) !== FALSE, 'Anonymous user can preview comment title.');
     $this->assertTrue(strpos($preview, $body) !== FALSE, 'Anonymous user can preview comment body.');
 
@@ -56,7 +56,7 @@ public function testAnonymous() {
     $edit['comment_body[0][value]'] = $body;
     $this->drupalPostForm($this->node->urlInfo(), $edit, t('Preview'));
     // Cannot use assertRaw here since both title and body are in the form.
-    $preview = (string) $this->cssSelect('.preview')[0]->asXML();
+    $preview = (string) $this->cssSelect('.preview')[0]->getHtml();
     $this->assertTrue(strpos($preview, $title) !== FALSE, 'Anonymous user can preview comment title.');
     $this->assertTrue(strpos($preview, $body) !== FALSE, 'Anonymous user can preview comment body.');
     user_role_grant_permissions(RoleInterface::ANONYMOUS_ID, ['skip comment approval']);
diff --git a/core/modules/comment/src/Tests/CommentBlockTest.php b/core/modules/comment/tests/src/Functional/CommentBlockTest.php
similarity index 98%
rename from core/modules/comment/src/Tests/CommentBlockTest.php
rename to core/modules/comment/tests/src/Functional/CommentBlockTest.php
index 37cc5de..db7d1bd 100644
--- a/core/modules/comment/src/Tests/CommentBlockTest.php
+++ b/core/modules/comment/tests/src/Functional/CommentBlockTest.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\comment\Tests;
+namespace Drupal\Tests\comment\Functional;
 
 use Drupal\Component\Utility\SafeMarkup;
 use Drupal\user\RoleInterface;
diff --git a/core/modules/comment/src/Tests/CommentBookTest.php b/core/modules/comment/tests/src/Functional/CommentBookTest.php
similarity index 92%
rename from core/modules/comment/src/Tests/CommentBookTest.php
rename to core/modules/comment/tests/src/Functional/CommentBookTest.php
index 4afd07e..45693b5 100644
--- a/core/modules/comment/src/Tests/CommentBookTest.php
+++ b/core/modules/comment/tests/src/Functional/CommentBookTest.php
@@ -1,10 +1,11 @@
 <?php
 
-namespace Drupal\comment\Tests;
+namespace Drupal\Tests\comment\Functional;
 
 use Drupal\comment\CommentInterface;
+use Drupal\comment\Tests\CommentTestTrait;
 use Drupal\node\Entity\Node;
-use Drupal\simpletest\WebTestBase;
+use Drupal\Tests\BrowserTestBase;
 use Drupal\comment\Entity\Comment;
 
 /**
@@ -12,7 +13,7 @@
  *
  * @group comment
  */
-class CommentBookTest extends WebTestBase {
+class CommentBookTest extends BrowserTestBase {
 
   use CommentTestTrait;
 
diff --git a/core/modules/comment/src/Tests/CommentCSSTest.php b/core/modules/comment/tests/src/Functional/CommentCSSTest.php
similarity index 97%
rename from core/modules/comment/src/Tests/CommentCSSTest.php
rename to core/modules/comment/tests/src/Functional/CommentCSSTest.php
index b50e952..e17534a 100644
--- a/core/modules/comment/src/Tests/CommentCSSTest.php
+++ b/core/modules/comment/tests/src/Functional/CommentCSSTest.php
@@ -1,11 +1,12 @@
 <?php
 
-namespace Drupal\comment\Tests;
+namespace Drupal\Tests\comment\Functional;
 
 use Drupal\Core\Language\LanguageInterface;
 use Drupal\comment\CommentInterface;
 use Drupal\user\RoleInterface;
 use Drupal\comment\Entity\Comment;
+use Drupal\Tests\Traits\Core\GeneratePermutationsTrait;
 
 /**
  * Tests CSS classes on comments.
@@ -14,6 +15,8 @@
  */
 class CommentCSSTest extends CommentTestBase {
 
+  use GeneratePermutationsTrait;
+
   protected function setUp() {
     parent::setUp();
 
diff --git a/core/modules/comment/src/Tests/CommentFieldsTest.php b/core/modules/comment/tests/src/Functional/CommentFieldsTest.php
similarity index 99%
rename from core/modules/comment/src/Tests/CommentFieldsTest.php
rename to core/modules/comment/tests/src/Functional/CommentFieldsTest.php
index a463314..2df9973 100644
--- a/core/modules/comment/src/Tests/CommentFieldsTest.php
+++ b/core/modules/comment/tests/src/Functional/CommentFieldsTest.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\comment\Tests;
+namespace Drupal\Tests\comment\Functional;
 
 use Drupal\comment\Plugin\Field\FieldType\CommentItemInterface;
 use Drupal\field\Entity\FieldStorageConfig;
diff --git a/core/modules/comment/src/Tests/CommentInterfaceTest.php b/core/modules/comment/tests/src/Functional/CommentInterfaceTest.php
similarity index 99%
rename from core/modules/comment/src/Tests/CommentInterfaceTest.php
rename to core/modules/comment/tests/src/Functional/CommentInterfaceTest.php
index 6f67ca8..7342633 100644
--- a/core/modules/comment/src/Tests/CommentInterfaceTest.php
+++ b/core/modules/comment/tests/src/Functional/CommentInterfaceTest.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\comment\Tests;
+namespace Drupal\Tests\comment\Functional;
 
 use Drupal\comment\CommentManagerInterface;
 use Drupal\comment\Plugin\Field\FieldType\CommentItemInterface;
diff --git a/core/modules/comment/src/Tests/CommentLanguageTest.php b/core/modules/comment/tests/src/Functional/CommentLanguageTest.php
similarity index 97%
rename from core/modules/comment/src/Tests/CommentLanguageTest.php
rename to core/modules/comment/tests/src/Functional/CommentLanguageTest.php
index eee0862..ce9a9ab 100644
--- a/core/modules/comment/src/Tests/CommentLanguageTest.php
+++ b/core/modules/comment/tests/src/Functional/CommentLanguageTest.php
@@ -1,18 +1,19 @@
 <?php
 
-namespace Drupal\comment\Tests;
+namespace Drupal\Tests\comment\Functional;
 
 use Drupal\comment\Entity\Comment;
 use Drupal\comment\Plugin\Field\FieldType\CommentItemInterface;
+use Drupal\comment\Tests\CommentTestTrait;
 use Drupal\field\Entity\FieldStorageConfig;
-use Drupal\simpletest\WebTestBase;
+use Drupal\Tests\BrowserTestBase;
 
 /**
  * Tests for comment language.
  *
  * @group comment
  */
-class CommentLanguageTest extends WebTestBase {
+class CommentLanguageTest extends BrowserTestBase {
 
   use CommentTestTrait;
 
diff --git a/core/modules/comment/src/Tests/CommentLinksAlterTest.php b/core/modules/comment/tests/src/Functional/CommentLinksAlterTest.php
similarity index 94%
rename from core/modules/comment/src/Tests/CommentLinksAlterTest.php
rename to core/modules/comment/tests/src/Functional/CommentLinksAlterTest.php
index 88e092f..e49361b 100644
--- a/core/modules/comment/src/Tests/CommentLinksAlterTest.php
+++ b/core/modules/comment/tests/src/Functional/CommentLinksAlterTest.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\comment\Tests;
+namespace Drupal\Tests\comment\Functional;
 
 /**
  * Tests comment links altering.
diff --git a/core/modules/comment/src/Tests/CommentLinksTest.php b/core/modules/comment/tests/src/Functional/CommentLinksTest.php
similarity index 94%
rename from core/modules/comment/src/Tests/CommentLinksTest.php
rename to core/modules/comment/tests/src/Functional/CommentLinksTest.php
index 589a355..3d79d96 100644
--- a/core/modules/comment/src/Tests/CommentLinksTest.php
+++ b/core/modules/comment/tests/src/Functional/CommentLinksTest.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\comment\Tests;
+namespace Drupal\Tests\comment\Functional;
 
 use Drupal\comment\Plugin\Field\FieldType\CommentItemInterface;
 use Drupal\Core\Language\LanguageInterface;
@@ -108,8 +108,8 @@ public function testCommentLinks() {
     $this->drupalGet($this->node->urlInfo());
     $element = $this->cssSelect('article.js-comment > div');
     // Get last child element.
-    $element = end($element[0]);
-    $this->assertIdentical($element[0]->getName(), 'div', 'Last element is comment body.');
+    $element = end($element);
+    $this->assertIdentical($element->getTagName(), 'div', 'Last element is comment body.');
 
     // Change weight to make links go after comment body.
     entity_get_display('comment', 'comment', 'default')
@@ -118,8 +118,8 @@ public function testCommentLinks() {
     $this->drupalGet($this->node->urlInfo());
     $element = $this->cssSelect('article.js-comment > div');
     // Get last child element.
-    $element = end($element[0]);
-    $this->assertIdentical($element[0]->getName(), 'ul', 'Last element is comment links.');
+    $element = end($element);
+    $this->assertNotEmpty($element->find('css', 'ul.links'), 'Last element is comment links.');
 
     // Make sure we can hide node links.
     entity_get_display('node', $this->node->bundle(), 'default')
diff --git a/core/modules/comment/src/Tests/CommentNodeAccessTest.php b/core/modules/comment/tests/src/Functional/CommentNodeAccessTest.php
similarity index 98%
rename from core/modules/comment/src/Tests/CommentNodeAccessTest.php
rename to core/modules/comment/tests/src/Functional/CommentNodeAccessTest.php
index ffbffa1..6842dc1 100644
--- a/core/modules/comment/src/Tests/CommentNodeAccessTest.php
+++ b/core/modules/comment/tests/src/Functional/CommentNodeAccessTest.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\comment\Tests;
+namespace Drupal\Tests\comment\Functional;
 
 use Drupal\comment\CommentManagerInterface;
 
diff --git a/core/modules/comment/src/Tests/CommentNodeChangesTest.php b/core/modules/comment/tests/src/Functional/CommentNodeChangesTest.php
similarity index 96%
rename from core/modules/comment/src/Tests/CommentNodeChangesTest.php
rename to core/modules/comment/tests/src/Functional/CommentNodeChangesTest.php
index 148198d..a63ce8b 100644
--- a/core/modules/comment/src/Tests/CommentNodeChangesTest.php
+++ b/core/modules/comment/tests/src/Functional/CommentNodeChangesTest.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\comment\Tests;
+namespace Drupal\Tests\comment\Functional;
 
 use Drupal\comment\Entity\Comment;
 use Drupal\field\Entity\FieldConfig;
diff --git a/core/modules/comment/src/Tests/CommentNonNodeTest.php b/core/modules/comment/tests/src/Functional/CommentNonNodeTest.php
similarity index 95%
rename from core/modules/comment/src/Tests/CommentNonNodeTest.php
rename to core/modules/comment/tests/src/Functional/CommentNonNodeTest.php
index c75da84..18e4d35 100644
--- a/core/modules/comment/src/Tests/CommentNonNodeTest.php
+++ b/core/modules/comment/tests/src/Functional/CommentNonNodeTest.php
@@ -1,16 +1,17 @@
 <?php
 
-namespace Drupal\comment\Tests;
+namespace Drupal\Tests\comment\Functional;
 
 use Drupal\comment\CommentInterface;
 use Drupal\comment\Entity\Comment;
 use Drupal\comment\Entity\CommentType;
 use Drupal\comment\Plugin\Field\FieldType\CommentItemInterface;
+use Drupal\comment\Tests\CommentTestTrait;
 use Drupal\entity_test\Entity\EntityTest;
 use Drupal\field\Entity\FieldConfig;
 use Drupal\field\Entity\FieldStorageConfig;
 use Drupal\field_ui\Tests\FieldUiTestTrait;
-use Drupal\simpletest\WebTestBase;
+use Drupal\Tests\BrowserTestBase;
 use Drupal\Core\Entity\EntityInterface;
 use Drupal\user\RoleInterface;
 
@@ -19,7 +20,7 @@
  *
  * @group comment
  */
-class CommentNonNodeTest extends WebTestBase {
+class CommentNonNodeTest extends BrowserTestBase {
 
   use FieldUiTestTrait;
   use CommentTestTrait;
@@ -273,7 +274,7 @@ public function testCommentFunctionality() {
     // Test breadcrumb on comment add page.
     $this->drupalGet('comment/reply/entity_test/' . $this->entity->id() . '/comment');
     $xpath = '//nav[@class="breadcrumb"]/ol/li[last()]/a';
-    $this->assertEqual(current($this->xpath($xpath)), $this->entity->label(), 'Last breadcrumb item is equal to node title on comment reply page.');
+    $this->assertEqual(current($this->xpath($xpath))->getText(), $this->entity->label(), 'Last breadcrumb item is equal to node title on comment reply page.');
 
     // Post a comment.
     /** @var \Drupal\comment\CommentInterface $comment1 */
@@ -283,17 +284,17 @@ public function testCommentFunctionality() {
     // Test breadcrumb on comment reply page.
     $this->drupalGet('comment/reply/entity_test/' . $this->entity->id() . '/comment/' . $comment1->id());
     $xpath = '//nav[@class="breadcrumb"]/ol/li[last()]/a';
-    $this->assertEqual(current($this->xpath($xpath)), $comment1->getSubject(), 'Last breadcrumb item is equal to comment title on comment reply page.');
+    $this->assertEqual(current($this->xpath($xpath))->getText(), $comment1->getSubject(), 'Last breadcrumb item is equal to comment title on comment reply page.');
 
     // Test breadcrumb on comment edit page.
     $this->drupalGet('comment/' . $comment1->id() . '/edit');
     $xpath = '//nav[@class="breadcrumb"]/ol/li[last()]/a';
-    $this->assertEqual(current($this->xpath($xpath)), $comment1->getSubject(), 'Last breadcrumb item is equal to comment subject on edit page.');
+    $this->assertEqual(current($this->xpath($xpath))->getText(), $comment1->getSubject(), 'Last breadcrumb item is equal to comment subject on edit page.');
 
     // Test breadcrumb on comment delete page.
     $this->drupalGet('comment/' . $comment1->id() . '/delete');
     $xpath = '//nav[@class="breadcrumb"]/ol/li[last()]/a';
-    $this->assertEqual(current($this->xpath($xpath)), $comment1->getSubject(), 'Last breadcrumb item is equal to comment subject on delete confirm page.');
+    $this->assertEqual(current($this->xpath($xpath))->getText(), $comment1->getSubject(), 'Last breadcrumb item is equal to comment subject on delete confirm page.');
 
     // Unpublish the comment.
     $this->performCommentOperation($comment1, 'unpublish');
diff --git a/core/modules/comment/src/Tests/CommentPreviewTest.php b/core/modules/comment/tests/src/Functional/CommentPreviewTest.php
similarity index 92%
rename from core/modules/comment/src/Tests/CommentPreviewTest.php
rename to core/modules/comment/tests/src/Functional/CommentPreviewTest.php
index 1b07fe6..89ac668 100644
--- a/core/modules/comment/src/Tests/CommentPreviewTest.php
+++ b/core/modules/comment/tests/src/Functional/CommentPreviewTest.php
@@ -1,11 +1,12 @@
 <?php
 
-namespace Drupal\comment\Tests;
+namespace Drupal\Tests\comment\Functional;
 
 use Drupal\comment\CommentManagerInterface;
 use Drupal\Component\Render\MarkupInterface;
 use Drupal\Core\Datetime\DrupalDateTime;
 use Drupal\comment\Entity\Comment;
+use Drupal\Tests\TestFileCreationTrait;
 
 /**
  * Tests comment preview.
@@ -14,6 +15,10 @@
  */
 class CommentPreviewTest extends CommentTestBase {
 
+  use TestFileCreationTrait {
+    getTestFiles as drupalGetTestFiles;
+  }
+
   /**
    * The profile to install as a basis for testing.
    *
@@ -105,16 +110,13 @@ public function testCommentPreviewDuplicateSubmission() {
     $this->assertFieldByName('comment_body[0][value]', $edit['comment_body[0][value]'], 'Comment field displayed.');
 
     // Store the content of this page.
-    $content = $this->getRawContent();
     $this->drupalPostForm(NULL, [], 'Save');
     $this->assertText('Your comment has been posted.');
     $elements = $this->xpath('//section[contains(@class, "comment-wrapper")]/article');
     $this->assertEqual(1, count($elements));
 
-    // Reset the content of the page to simulate the browser's back button, and
-    // re-submit the form.
-    $this->setRawContent($content);
-    $this->drupalPostForm(NULL, [], 'Save');
+    // Go back and re-submit the form.
+    $this->getSession()->getDriver()->back();
     $this->assertText('Your comment has been posted.');
     $elements = $this->xpath('//section[contains(@class, "comment-wrapper")]/article');
     $this->assertEqual(2, count($elements));
@@ -173,11 +175,11 @@ public function testCommentEditPreviewSave() {
 
     // Submit the form using the displayed values.
     $displayed = [];
-    $displayed['subject[0][value]'] = (string) current($this->xpath("//input[@id='edit-subject-0-value']/@value"));
-    $displayed['comment_body[0][value]'] = (string) current($this->xpath("//textarea[@id='edit-comment-body-0-value']"));
-    $displayed['uid'] = (string) current($this->xpath("//input[@id='edit-uid']/@value"));
-    $displayed['date[date]'] = (string) current($this->xpath("//input[@id='edit-date-date']/@value"));
-    $displayed['date[time]'] = (string) current($this->xpath("//input[@id='edit-date-time']/@value"));
+    $displayed['subject[0][value]'] = current($this->xpath("//input[@id='edit-subject-0-value']"))->getValue();
+    $displayed['comment_body[0][value]'] = current($this->xpath("//textarea[@id='edit-comment-body-0-value']"))->getValue();
+    $displayed['uid'] = current($this->xpath("//input[@id='edit-uid']"))->getValue();
+    $displayed['date[date]'] = current($this->xpath("//input[@id='edit-date-date']"))->getValue();
+    $displayed['date[time]'] = current($this->xpath("//input[@id='edit-date-time']"))->getValue();
     $this->drupalPostForm('comment/' . $comment->id() . '/edit', $displayed, t('Save'));
 
     // Check that the saved comment is still correct.
diff --git a/core/modules/comment/src/Tests/CommentRssTest.php b/core/modules/comment/tests/src/Functional/CommentRssTest.php
similarity index 97%
rename from core/modules/comment/src/Tests/CommentRssTest.php
rename to core/modules/comment/tests/src/Functional/CommentRssTest.php
index 35cad71..60708bd 100644
--- a/core/modules/comment/src/Tests/CommentRssTest.php
+++ b/core/modules/comment/tests/src/Functional/CommentRssTest.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\comment\Tests;
+namespace Drupal\Tests\comment\Functional;
 
 use Drupal\comment\Plugin\Field\FieldType\CommentItemInterface;
 use Drupal\Core\Cache\Cache;
diff --git a/core/modules/comment/src/Tests/CommentStatisticsTest.php b/core/modules/comment/tests/src/Functional/CommentStatisticsTest.php
similarity index 99%
rename from core/modules/comment/src/Tests/CommentStatisticsTest.php
rename to core/modules/comment/tests/src/Functional/CommentStatisticsTest.php
index 0d1ec3a..4a0eae0 100644
--- a/core/modules/comment/src/Tests/CommentStatisticsTest.php
+++ b/core/modules/comment/tests/src/Functional/CommentStatisticsTest.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\comment\Tests;
+namespace Drupal\Tests\comment\Functional;
 
 use Drupal\comment\CommentManagerInterface;
 use Drupal\comment\Entity\Comment;
diff --git a/core/modules/comment/src/Tests/CommentTestBase.php b/core/modules/comment/tests/src/Functional/CommentTestBase.php
similarity index 96%
copy from core/modules/comment/src/Tests/CommentTestBase.php
copy to core/modules/comment/tests/src/Functional/CommentTestBase.php
index e15915f..4dca721 100644
--- a/core/modules/comment/src/Tests/CommentTestBase.php
+++ b/core/modules/comment/tests/src/Functional/CommentTestBase.php
@@ -1,19 +1,20 @@
 <?php
 
-namespace Drupal\comment\Tests;
+namespace Drupal\Tests\comment\Functional;
 
 use Drupal\comment\Entity\CommentType;
 use Drupal\comment\Entity\Comment;
 use Drupal\comment\CommentInterface;
+use Drupal\comment\Tests\CommentTestTrait;
 use Drupal\field\Entity\FieldConfig;
 use Drupal\comment\Plugin\Field\FieldType\CommentItemInterface;
 use Drupal\node\Entity\NodeType;
-use Drupal\simpletest\WebTestBase;
+use Drupal\Tests\BrowserTestBase;
 
 /**
  * Provides setup and helper methods for comment tests.
  */
-abstract class CommentTestBase extends WebTestBase {
+abstract class CommentTestBase extends BrowserTestBase {
 
   use CommentTestTrait;
 
@@ -191,13 +192,13 @@ public function commentExists(CommentInterface $comment = NULL, $reply = FALSE)
         return FALSE;
       }
 
-      $comment_title = $comment_element[0]->xpath('div/h3/a');
-      if (empty($comment_title) || ((string)$comment_title[0]) !== $comment->getSubject()) {
+      $comment_title = $comment_element[0]->find('xpath', 'div/h3/a');
+      if (empty($comment_title) || $comment_title->getText() !== $comment->getSubject()) {
         return FALSE;
       }
 
-      $comment_body = $comment_element[0]->xpath('div/div/p');
-      if (empty($comment_body) || ((string)$comment_body[0]) !== $comment->comment_body->value) {
+      $comment_body = $comment_element[0]->find('xpath', 'div/div/p');
+      if (empty($comment_body) || $comment_body->getText() !== $comment->comment_body->value) {
         return FALSE;
       }
 
diff --git a/core/modules/comment/src/Tests/CommentThreadingTest.php b/core/modules/comment/tests/src/Functional/CommentThreadingTest.php
similarity index 99%
rename from core/modules/comment/src/Tests/CommentThreadingTest.php
rename to core/modules/comment/tests/src/Functional/CommentThreadingTest.php
index 8f412b2..cff22ba 100644
--- a/core/modules/comment/src/Tests/CommentThreadingTest.php
+++ b/core/modules/comment/tests/src/Functional/CommentThreadingTest.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\comment\Tests;
+namespace Drupal\Tests\comment\Functional;
 
 use Drupal\comment\CommentManagerInterface;
 
diff --git a/core/modules/comment/src/Tests/CommentTitleTest.php b/core/modules/comment/tests/src/Functional/CommentTitleTest.php
similarity index 96%
rename from core/modules/comment/src/Tests/CommentTitleTest.php
rename to core/modules/comment/tests/src/Functional/CommentTitleTest.php
index 1d24ad8..65c4937 100644
--- a/core/modules/comment/src/Tests/CommentTitleTest.php
+++ b/core/modules/comment/tests/src/Functional/CommentTitleTest.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\comment\Tests;
+namespace Drupal\Tests\comment\Functional;
 
 /**
  * Tests to ensure that appropriate and accessible markup is created for comment
@@ -73,7 +73,7 @@ public function testCommentPopulatedTitles() {
     $this->assertPattern('|<h3[^>]*><a[^>]*>' . $subject_text . '</a></h3>|', 'Comment title is rendered in h3 when title populated.');
     // Tests that the comment's title link is the permalink of the comment.
     $comment_permalink = $this->cssSelect('.permalink');
-    $comment_permalink = (string) $comment_permalink[0]['href'];
+    $comment_permalink = $comment_permalink[0]->getAttribute('href');
     // Tests that the comment's title link contains the url fragment.
     $this->assertTrue(strpos($comment_permalink, '#comment-' . $comment1->id()), "The comment's title link contains the url fragment.");
     $this->assertEqual($comment1->permalink()->toString(), $comment_permalink, "The comment's title has the correct link.");
diff --git a/core/modules/comment/src/Tests/CommentTokenReplaceTest.php b/core/modules/comment/tests/src/Functional/CommentTokenReplaceTest.php
similarity index 99%
rename from core/modules/comment/src/Tests/CommentTokenReplaceTest.php
rename to core/modules/comment/tests/src/Functional/CommentTokenReplaceTest.php
index 6caea17..a7fe6b5 100644
--- a/core/modules/comment/src/Tests/CommentTokenReplaceTest.php
+++ b/core/modules/comment/tests/src/Functional/CommentTokenReplaceTest.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\comment\Tests;
+namespace Drupal\Tests\comment\Functional;
 
 use Drupal\comment\Plugin\Field\FieldType\CommentItemInterface;
 use Drupal\Component\Render\FormattableMarkup;
diff --git a/core/modules/comment/src/Tests/CommentTranslationUITest.php b/core/modules/comment/tests/src/Functional/CommentTranslationUITest.php
similarity index 97%
rename from core/modules/comment/src/Tests/CommentTranslationUITest.php
rename to core/modules/comment/tests/src/Functional/CommentTranslationUITest.php
index 4613d66..daac938 100644
--- a/core/modules/comment/src/Tests/CommentTranslationUITest.php
+++ b/core/modules/comment/tests/src/Functional/CommentTranslationUITest.php
@@ -1,10 +1,11 @@
 <?php
 
-namespace Drupal\comment\Tests;
+namespace Drupal\Tests\comment\Functional;
 
 use Drupal\comment\Plugin\Field\FieldType\CommentItemInterface;
-use Drupal\content_translation\Tests\ContentTranslationUITestBase;
+use Drupal\comment\Tests\CommentTestTrait;
 use Drupal\language\Entity\ConfigurableLanguage;
+use Drupal\Tests\content_translation\Functional\ContentTranslationUITestBase;
 
 /**
  * Tests the Comment Translation UI.
diff --git a/core/modules/comment/src/Tests/CommentTypeTest.php b/core/modules/comment/tests/src/Functional/CommentTypeTest.php
similarity index 99%
rename from core/modules/comment/src/Tests/CommentTypeTest.php
rename to core/modules/comment/tests/src/Functional/CommentTypeTest.php
index 343bb91..e4ff2ea 100644
--- a/core/modules/comment/src/Tests/CommentTypeTest.php
+++ b/core/modules/comment/tests/src/Functional/CommentTypeTest.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\comment\Tests;
+namespace Drupal\Tests\comment\Functional;
 use Drupal\comment\Entity\Comment;
 use Drupal\comment\Entity\CommentType;
 use Drupal\comment\Plugin\Field\FieldType\CommentItemInterface;
diff --git a/core/modules/comment/src/Tests/CommentUninstallTest.php b/core/modules/comment/tests/src/Functional/CommentUninstallTest.php
similarity index 93%
rename from core/modules/comment/src/Tests/CommentUninstallTest.php
rename to core/modules/comment/tests/src/Functional/CommentUninstallTest.php
index 7873915..6e0c8a2 100644
--- a/core/modules/comment/src/Tests/CommentUninstallTest.php
+++ b/core/modules/comment/tests/src/Functional/CommentUninstallTest.php
@@ -1,17 +1,18 @@
 <?php
 
-namespace Drupal\comment\Tests;
+namespace Drupal\Tests\comment\Functional;
 
+use Drupal\comment\Tests\CommentTestTrait;
 use Drupal\field\Entity\FieldStorageConfig;
 use Drupal\Core\Extension\ModuleUninstallValidatorException;
-use Drupal\simpletest\WebTestBase;
+use Drupal\Tests\BrowserTestBase;
 
 /**
  * Tests comment module uninstallation.
  *
  * @group comment
  */
-class CommentUninstallTest extends WebTestBase {
+class CommentUninstallTest extends BrowserTestBase {
 
   use CommentTestTrait;
 
diff --git a/core/modules/comment/src/Tests/Views/ArgumentUserUIDTest.php b/core/modules/comment/tests/src/Functional/Views/ArgumentUserUIDTest.php
similarity index 96%
rename from core/modules/comment/src/Tests/Views/ArgumentUserUIDTest.php
rename to core/modules/comment/tests/src/Functional/Views/ArgumentUserUIDTest.php
index d3526dc..ad08f4f 100644
--- a/core/modules/comment/src/Tests/Views/ArgumentUserUIDTest.php
+++ b/core/modules/comment/tests/src/Functional/Views/ArgumentUserUIDTest.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\comment\Tests\Views;
+namespace Drupal\Tests\comment\Functional\Views;
 
 use Drupal\comment\Entity\Comment;
 use Drupal\user\Entity\User;
diff --git a/core/modules/comment/src/Tests/Views/CommentAdminTest.php b/core/modules/comment/tests/src/Functional/Views/CommentAdminTest.php
similarity index 97%
rename from core/modules/comment/src/Tests/Views/CommentAdminTest.php
rename to core/modules/comment/tests/src/Functional/Views/CommentAdminTest.php
index c834bca..0457ce7 100644
--- a/core/modules/comment/src/Tests/Views/CommentAdminTest.php
+++ b/core/modules/comment/tests/src/Functional/Views/CommentAdminTest.php
@@ -1,13 +1,13 @@
 <?php
 
-namespace Drupal\comment\Tests\Views;
+namespace Drupal\Tests\comment\Functional\Views;
 
 use Drupal\block_content\Entity\BlockContent;
 use Drupal\block_content\Entity\BlockContentType;
 use Drupal\comment\Entity\Comment;
 use Drupal\comment\Plugin\Field\FieldType\CommentItemInterface;
 use Drupal\Component\Render\FormattableMarkup;
-use Drupal\comment\Tests\CommentTestBase as CommentWebTestBase;
+use Drupal\Tests\comment\Functional\CommentTestBase as CommentBrowserTestBase;
 use Drupal\Component\Utility\Html;
 use Drupal\Component\Utility\Unicode;
 use Drupal\user\RoleInterface;
@@ -18,13 +18,13 @@
  *
  * @group comment
  */
-class CommentAdminTest extends CommentWebTestBase {
+class CommentAdminTest extends CommentBrowserTestBase {
 
   /**
    * {@inheritdoc}
    */
-  protected function setUp() {
-    parent::setUp();
+  protected function setUp($import_test_views = TRUE) {
+    parent::setUp($import_test_views);
     \Drupal::service('module_installer')->install(['views']);
     $view = Views::getView('comment');
     $view->storage->enable()->save();
diff --git a/core/modules/comment/src/Tests/Views/CommentEditTest.php b/core/modules/comment/tests/src/Functional/Views/CommentEditTest.php
similarity index 75%
rename from core/modules/comment/src/Tests/Views/CommentEditTest.php
rename to core/modules/comment/tests/src/Functional/Views/CommentEditTest.php
index 2a11ef9..fb5f736 100644
--- a/core/modules/comment/src/Tests/Views/CommentEditTest.php
+++ b/core/modules/comment/tests/src/Functional/Views/CommentEditTest.php
@@ -1,15 +1,15 @@
 <?php
 
-namespace Drupal\comment\Tests\Views;
+namespace Drupal\Tests\comment\Functional\Views;
 
-use Drupal\comment\Tests\CommentTestBase as CommentWebTestBase;
+use Drupal\Tests\comment\Functional\CommentTestBase as CommentBrowserTestBase;
 
 /**
  * Tests comment edit functionality.
  *
  * @group comment
  */
-class CommentEditTest extends CommentWebTestBase {
+class CommentEditTest extends CommentBrowserTestBase {
 
   /**
    * {@inheritdoc}
@@ -25,7 +25,7 @@ public function testCommentEdit() {
     $node_comment = $this->postComment($this->node, $this->randomMachineName(), $this->randomMachineName(), TRUE);
     $this->drupalGet('admin/content/comment');
     $this->assertText($this->adminUser->label());
-    $this->drupalGet($node_comment->toUrl('edit-form')->toString());
+    $this->drupalGet($node_comment->toUrl('edit-form'));
     $edit = [
       'comment_body[0][value]' => $this->randomMachineName(),
     ];
diff --git a/core/modules/comment/src/Tests/Views/CommentFieldFilterTest.php b/core/modules/comment/tests/src/Functional/Views/CommentFieldFilterTest.php
similarity index 96%
rename from core/modules/comment/src/Tests/Views/CommentFieldFilterTest.php
rename to core/modules/comment/tests/src/Functional/Views/CommentFieldFilterTest.php
index 48f7d6d..dabacc3 100644
--- a/core/modules/comment/src/Tests/Views/CommentFieldFilterTest.php
+++ b/core/modules/comment/tests/src/Functional/Views/CommentFieldFilterTest.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\comment\Tests\Views;
+namespace Drupal\Tests\comment\Functional\Views;
 
 use Drupal\language\Entity\ConfigurableLanguage;
 use Drupal\comment\Entity\Comment;
@@ -31,8 +31,8 @@ class CommentFieldFilterTest extends CommentTestBase {
    */
   public $commentTitles = [];
 
-  public function setUp() {
-    parent::setUp();
+  protected function setUp($import_test_views = TRUE) {
+    parent::setUp($import_test_views);
     $this->drupalLogin($this->drupalCreateUser(['access comments']));
 
     // Add two new languages.
diff --git a/core/modules/comment/src/Tests/Views/CommentFieldNameTest.php b/core/modules/comment/tests/src/Functional/Views/CommentFieldNameTest.php
similarity index 94%
rename from core/modules/comment/src/Tests/Views/CommentFieldNameTest.php
rename to core/modules/comment/tests/src/Functional/Views/CommentFieldNameTest.php
index 870a4f4..a5e25be 100644
--- a/core/modules/comment/src/Tests/Views/CommentFieldNameTest.php
+++ b/core/modules/comment/tests/src/Functional/Views/CommentFieldNameTest.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\comment\Tests\Views;
+namespace Drupal\Tests\comment\Functional\Views;
 
 use Drupal\comment\Entity\Comment;
 use Drupal\Core\Render\RenderContext;
@@ -39,8 +39,8 @@ class CommentFieldNameTest extends CommentTestBase {
   /**
    * {@inheritdoc}
    */
-  protected function setUp() {
-    parent::setUp();
+  protected function setUp($import_test_views = TRUE) {
+    parent::setUp($import_test_views);
     $this->addDefaultCommentField('node', 'page', $this->fieldName);
     $this->customComment = Comment::create([
       'entity_id' => $this->nodeUserCommented->id(),
diff --git a/core/modules/comment/src/Tests/Views/CommentOperationsTest.php b/core/modules/comment/tests/src/Functional/Views/CommentOperationsTest.php
similarity index 94%
rename from core/modules/comment/src/Tests/Views/CommentOperationsTest.php
rename to core/modules/comment/tests/src/Functional/Views/CommentOperationsTest.php
index 89dc364..4bef37e 100644
--- a/core/modules/comment/src/Tests/Views/CommentOperationsTest.php
+++ b/core/modules/comment/tests/src/Functional/Views/CommentOperationsTest.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\comment\Tests\Views;
+namespace Drupal\Tests\comment\Functional\Views;
 
 /**
  * Tests comment operations.
diff --git a/core/modules/comment/src/Tests/Views/CommentRestExportTest.php b/core/modules/comment/tests/src/Functional/Views/CommentRestExportTest.php
similarity index 85%
rename from core/modules/comment/src/Tests/Views/CommentRestExportTest.php
rename to core/modules/comment/tests/src/Functional/Views/CommentRestExportTest.php
index ed7ce55..17e04b5 100644
--- a/core/modules/comment/src/Tests/Views/CommentRestExportTest.php
+++ b/core/modules/comment/tests/src/Functional/Views/CommentRestExportTest.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\comment\Tests\Views;
+namespace Drupal\Tests\comment\Functional\Views;
 
 use Drupal\Component\Serialization\Json;
 use Drupal\comment\Entity\Comment;
@@ -24,8 +24,8 @@ class CommentRestExportTest extends CommentTestBase {
    */
   public static $modules = ['node', 'comment', 'comment_test_views', 'rest', 'hal'];
 
-  protected function setUp() {
-    parent::setUp();
+  protected function setUp($import_test_views = TRUE) {
+    parent::setUp($import_test_views);
     // Add another anonymous comment.
     $comment = [
       'uid' => 0,
@@ -51,7 +51,7 @@ protected function setUp() {
    * Test comment row.
    */
   public function testCommentRestExport() {
-    $this->drupalGetWithFormat(sprintf('node/%d/comments', $this->nodeUserCommented->id()), 'hal_json');
+    $this->drupalGet(sprintf('node/%d/comments', $this->nodeUserCommented->id()), ['query' => ['_format' => 'hal_json']]);
     $this->assertResponse(200);
     $contents = Json::decode($this->getRawContent());
     $this->assertEqual($contents[0]['subject'], 'How much wood would a woodchuck chuck');
diff --git a/core/modules/comment/src/Tests/Views/CommentRowTest.php b/core/modules/comment/tests/src/Functional/Views/CommentRowTest.php
similarity index 91%
rename from core/modules/comment/src/Tests/Views/CommentRowTest.php
rename to core/modules/comment/tests/src/Functional/Views/CommentRowTest.php
index d73811e..7cf3ef3 100644
--- a/core/modules/comment/src/Tests/Views/CommentRowTest.php
+++ b/core/modules/comment/tests/src/Functional/Views/CommentRowTest.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\comment\Tests\Views;
+namespace Drupal\Tests\comment\Functional\Views;
 
 /**
  * Tests the comment row plugin.
diff --git a/core/modules/comment/src/Tests/Views/CommentTestBase.php b/core/modules/comment/tests/src/Functional/Views/CommentTestBase.php
similarity index 91%
copy from core/modules/comment/src/Tests/Views/CommentTestBase.php
copy to core/modules/comment/tests/src/Functional/Views/CommentTestBase.php
index d7bec04..ca2d863 100644
--- a/core/modules/comment/src/Tests/Views/CommentTestBase.php
+++ b/core/modules/comment/tests/src/Functional/Views/CommentTestBase.php
@@ -1,9 +1,9 @@
 <?php
 
-namespace Drupal\comment\Tests\Views;
+namespace Drupal\Tests\comment\Functional\Views;
 
 use Drupal\comment\Tests\CommentTestTrait;
-use Drupal\views\Tests\ViewTestBase;
+use Drupal\Tests\views\Functional\ViewTestBase;
 use Drupal\views\Tests\ViewTestData;
 use Drupal\comment\Entity\Comment;
 
@@ -56,8 +56,8 @@
    */
   protected $comment;
 
-  protected function setUp() {
-    parent::setUp();
+  protected function setUp($import_test_views = TRUE) {
+    parent::setUp($import_test_views);
 
     ViewTestData::createTestViews(get_class($this), ['comment_test_views']);
 
diff --git a/core/modules/comment/src/Tests/Views/DefaultViewRecentCommentsTest.php b/core/modules/comment/tests/src/Functional/Views/DefaultViewRecentCommentsTest.php
similarity index 94%
rename from core/modules/comment/src/Tests/Views/DefaultViewRecentCommentsTest.php
rename to core/modules/comment/tests/src/Functional/Views/DefaultViewRecentCommentsTest.php
index 3e5f26b..c44f693 100644
--- a/core/modules/comment/src/Tests/Views/DefaultViewRecentCommentsTest.php
+++ b/core/modules/comment/tests/src/Functional/Views/DefaultViewRecentCommentsTest.php
@@ -1,12 +1,12 @@
 <?php
 
-namespace Drupal\comment\Tests\Views;
+namespace Drupal\Tests\comment\Functional\Views;
 
 use Drupal\comment\CommentInterface;
 use Drupal\comment\Entity\Comment;
 use Drupal\comment\Tests\CommentTestTrait;
 use Drupal\views\Views;
-use Drupal\views\Tests\ViewTestBase;
+use Drupal\Tests\views\Functional\ViewTestBase;
 
 /**
  * Tests results for the Recent Comments view shipped with the module.
@@ -59,8 +59,8 @@ class DefaultViewRecentCommentsTest extends ViewTestBase {
    */
   public $node;
 
-  protected function setUp() {
-    parent::setUp();
+  protected function setUp($import_test_views = TRUE) {
+    parent::setUp($import_test_views);
 
     // Create a new content type
     $content_type = $this->drupalCreateContentType();
diff --git a/core/modules/comment/src/Tests/Views/FilterUserUIDTest.php b/core/modules/comment/tests/src/Functional/Views/FilterUserUIDTest.php
similarity index 96%
rename from core/modules/comment/src/Tests/Views/FilterUserUIDTest.php
rename to core/modules/comment/tests/src/Functional/Views/FilterUserUIDTest.php
index 442a0e7..719c597 100644
--- a/core/modules/comment/src/Tests/Views/FilterUserUIDTest.php
+++ b/core/modules/comment/tests/src/Functional/Views/FilterUserUIDTest.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\comment\Tests\Views;
+namespace Drupal\Tests\comment\Functional\Views;
 
 use Drupal\comment\Entity\Comment;
 use Drupal\user\Entity\User;
diff --git a/core/modules/comment/src/Tests/Views/NodeCommentsTest.php b/core/modules/comment/tests/src/Functional/Views/NodeCommentsTest.php
similarity index 93%
rename from core/modules/comment/src/Tests/Views/NodeCommentsTest.php
rename to core/modules/comment/tests/src/Functional/Views/NodeCommentsTest.php
index b0ee315..e2c5d15 100644
--- a/core/modules/comment/src/Tests/Views/NodeCommentsTest.php
+++ b/core/modules/comment/tests/src/Functional/Views/NodeCommentsTest.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\comment\Tests\Views;
+namespace Drupal\Tests\comment\Functional\Views;
 
 /**
  * Tests comments on nodes.
diff --git a/core/modules/comment/src/Tests/Views/RowRssTest.php b/core/modules/comment/tests/src/Functional/Views/RowRssTest.php
similarity index 55%
rename from core/modules/comment/src/Tests/Views/RowRssTest.php
rename to core/modules/comment/tests/src/Functional/Views/RowRssTest.php
index 343b797..7d61852 100644
--- a/core/modules/comment/src/Tests/Views/RowRssTest.php
+++ b/core/modules/comment/tests/src/Functional/Views/RowRssTest.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\comment\Tests\Views;
+namespace Drupal\Tests\comment\Functional\Views;
 
 /**
  * Tests the comment rss row plugin.
@@ -23,10 +23,12 @@ class RowRssTest extends CommentTestBase {
   public function testRssRow() {
     $this->drupalGet('test-comment-rss');
 
-    $result = $this->xpath('//item');
+    // Because the response is XML we can't use the page which depends on an
+    // HTML tag being present.
+    $result = $this->getSession()->getDriver()->find('//item');
     $this->assertEqual(count($result), 1, 'Just one comment was found in the rss output.');
 
-    $this->assertEqual($result[0]->pubdate, gmdate('r', $this->comment->getCreatedTime()), 'The right pubDate appears in the rss output.');
+    $this->assertEqual($result[0]->find('xpath', '//pubDate')->getHtml(), gmdate('r', $this->comment->getCreatedTime()), 'The right pubDate appears in the rss output.');
   }
 
 }
diff --git a/core/modules/comment/src/Tests/Views/WizardTest.php b/core/modules/comment/tests/src/Functional/Views/WizardTest.php
similarity index 92%
rename from core/modules/comment/src/Tests/Views/WizardTest.php
rename to core/modules/comment/tests/src/Functional/Views/WizardTest.php
index a7f14c8..62fada9 100644
--- a/core/modules/comment/src/Tests/Views/WizardTest.php
+++ b/core/modules/comment/tests/src/Functional/Views/WizardTest.php
@@ -1,10 +1,10 @@
 <?php
 
-namespace Drupal\comment\Tests\Views;
+namespace Drupal\Tests\comment\Functional\Views;
 
 use Drupal\comment\Tests\CommentTestTrait;
 use Drupal\views\Views;
-use Drupal\views\Tests\Wizard\WizardTestBase;
+use Drupal\Tests\views\Functional\Wizard\WizardTestBase;
 
 /**
  * Tests the comment module integration into the wizard.
@@ -27,8 +27,8 @@ class WizardTest extends WizardTestBase {
   /**
    * {@inheritdoc}
    */
-  protected function setUp() {
-    parent::setUp();
+  protected function setUp($import_test_views = TRUE) {
+    parent::setUp($import_test_views);
     $this->drupalCreateContentType(['type' => 'page', 'name' => t('Basic page')]);
     // Add comment field to page node type.
     $this->addDefaultCommentField('node', 'page');
@@ -63,7 +63,7 @@ public function testCommentWizard() {
     foreach ($fields as $field) {
       $items = $this->getAllOptions($field);
       foreach ($items as $item) {
-        $options[] = $item->attributes()->value;
+        $options[] = $item->getValue();
       }
     }
     $expected_options = ['entity:comment', 'fields'];
diff --git a/core/modules/content_translation/tests/src/Functional/ContentTranslationUITestBase.php b/core/modules/content_translation/tests/src/Functional/ContentTranslationUITestBase.php
index c755ac4..f8b1756 100644
--- a/core/modules/content_translation/tests/src/Functional/ContentTranslationUITestBase.php
+++ b/core/modules/content_translation/tests/src/Functional/ContentTranslationUITestBase.php
@@ -227,10 +227,10 @@ protected function doTestTranslationOverview() {
         $language = new Language(['id' => $langcode]);
         $view_url = $entity->url('canonical', ['language' => $language]);
         $elements = $this->xpath('//table//a[@href=:href]', [':href' => $view_url]);
-        $this->assertEqual($elements[0]->getText(), $entity->getTranslation($langcode)->label(), new FormattableMarkup('Label correctly shown for %language translation.', ['%language' => $langcode]));
+        $this->assertEqual($elements[0]->getHtml(), $entity->getTranslation($langcode)->label(), new FormattableMarkup('Label correctly shown for %language translation.', ['%language' => $langcode]));
         $edit_path = $entity->url('edit-form', ['language' => $language]);
         $elements = $this->xpath('//table//ul[@class="dropbutton"]/li/a[@href=:href]', [':href' => $edit_path]);
-        $this->assertEqual($elements[0]->getText(), t('Edit'), new FormattableMarkup('Edit link correct for %language translation.', ['%language' => $langcode]));
+        $this->assertEqual($elements[0]->getHtml(), t('Edit'), new FormattableMarkup('Edit link correct for %language translation.', ['%language' => $langcode]));
       }
     }
   }
diff --git a/core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php b/core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php
index d11ef7686f..be1538785f 100644
--- a/core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php
+++ b/core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\FunctionalTests;
 
+use Behat\Mink\Element\NodeElement;
 use Behat\Mink\Exception\ExpectationException;
 use Behat\Mink\Selector\Xpath\Escaper;
 use Drupal\Component\Render\FormattableMarkup;
@@ -812,4 +813,21 @@ protected function getRawContent() {
     return $this->getSession()->getPage()->getContent();
   }
 
+  /**
+   * Get all option elements, including nested options, in a select.
+   *
+   * @param \Behat\Mink\Element\NodeElement $element
+   *   The element for which to get the options.
+   *
+   * @return \Behat\Mink\Element\NodeElement[]
+   *   Option elements in select.
+   *
+   * @deprecated Scheduled for removal in Drupal 9.0.0.
+   *   Use $element->findAll('xpath', 'option') instead.
+   */
+  protected function getAllOptions(NodeElement $element) {
+    @trigger_error('AssertLegacyTrait::getAllOptions() is scheduled for removal in Drupal 9.0.0. Use $element->findAll(\'xpath\', \'option\') instead.', E_USER_DEPRECATED);
+    return $element->findAll('xpath', '//option');
+  }
+
 }
