diff --git a/core/modules/action/tests/src/Functional/ConfigurationTest.php b/core/modules/action/tests/src/Functional/ConfigurationTest.php
index 98b79c55eb7c613adedfedfadd95ca67ec54db57..2a8d1b4219809fdb323f9041043cfcb896bd1659 100644
--- a/core/modules/action/tests/src/Functional/ConfigurationTest.php
+++ b/core/modules/action/tests/src/Functional/ConfigurationTest.php
@@ -71,7 +71,7 @@ public function testActionConfiguration() {
     // Make sure that the action updated properly.
     $this->assertSession()->pageTextContains('The action has been successfully saved.');
     // The old action label does NOT appear on the configuration page.
-    $this->assertNoText($action_label);
+    $this->assertSession()->pageTextNotContains($action_label);
     // The action label appears on the configuration page after we've updated
     // the complex action.
     $this->assertSession()->pageTextContains($new_action_label);
@@ -93,7 +93,7 @@ public function testActionConfiguration() {
     $this->drupalGet('admin/config/system/actions');
     $this->assertSession()->statusCodeEquals(200);
     // The action label does not appear on the overview page.
-    $this->assertNoText($new_action_label);
+    $this->assertSession()->pageTextNotContains($new_action_label);
 
     $action = Action::load($action_id);
     $this->assertNull($action, 'Make sure the action is gone after being deleted.');
diff --git a/core/modules/aggregator/tests/src/Functional/AggregatorRenderingTest.php b/core/modules/aggregator/tests/src/Functional/AggregatorRenderingTest.php
index ecf7e5e15be5b6152905609102ab9dcd5d8e1fac..f5bc4d77660c37031980a3f9b1b0ef06c2c37ead 100644
--- a/core/modules/aggregator/tests/src/Functional/AggregatorRenderingTest.php
+++ b/core/modules/aggregator/tests/src/Functional/AggregatorRenderingTest.php
@@ -80,7 +80,7 @@ public function testBlockLinks() {
     $block->save();
     // Check that the block is no longer displayed.
     $this->drupalGet('test-page');
-    $this->assertNoText($block->label());
+    $this->assertSession()->pageTextNotContains($block->label());
   }
 
   /**
diff --git a/core/modules/aggregator/tests/src/Functional/FeedAdminDisplayTest.php b/core/modules/aggregator/tests/src/Functional/FeedAdminDisplayTest.php
index 6cb4a774736ef1189fdf77b60d5215b669803173..91650bda2aba9d4c9c4f430837a5dd689c7697f1 100644
--- a/core/modules/aggregator/tests/src/Functional/FeedAdminDisplayTest.php
+++ b/core/modules/aggregator/tests/src/Functional/FeedAdminDisplayTest.php
@@ -28,16 +28,16 @@ public function testFeedUpdateFields() {
     // scheduled.
     $this->assertSession()->pageTextContains('never');
     $this->assertSession()->pageTextContains('imminently');
-    $this->assertNoText('ago');
-    $this->assertNoText('left');
+    $this->assertSession()->pageTextNotContains('ago');
+    $this->assertSession()->pageTextNotContains('left');
 
     $this->updateFeedItems($scheduled_feed);
     $this->drupalGet('admin/config/services/aggregator');
 
     // After the update, an interval should be displayed on both last updated
     // and next update.
-    $this->assertNoText('never');
-    $this->assertNoText('imminently');
+    $this->assertSession()->pageTextNotContains('never');
+    $this->assertSession()->pageTextNotContains('imminently');
     $this->assertSession()->pageTextContains('ago');
     $this->assertSession()->pageTextContains('left');
 
@@ -50,9 +50,9 @@ public function testFeedUpdateFields() {
     $this->drupalGet('admin/config/services/aggregator');
     // The non scheduled feed shows that it has not been updated yet.
     $this->assertSession()->pageTextContains('never');
-    $this->assertNoText('imminently');
-    $this->assertNoText('ago');
-    $this->assertNoText('left');
+    $this->assertSession()->pageTextNotContains('imminently');
+    $this->assertSession()->pageTextNotContains('ago');
+    $this->assertSession()->pageTextNotContains('left');
 
     $this->updateFeedItems($non_scheduled_feed);
     $this->drupalGet('admin/config/services/aggregator');
@@ -60,9 +60,9 @@ public function testFeedUpdateFields() {
     // After the feed update, we still need to see "never" as next update label.
     // Last update will show an interval.
     $this->assertSession()->pageTextContains('never');
-    $this->assertNoText('imminently');
+    $this->assertSession()->pageTextNotContains('imminently');
     $this->assertSession()->pageTextContains('ago');
-    $this->assertNoText('left');
+    $this->assertSession()->pageTextNotContains('left');
   }
 
   /**
diff --git a/core/modules/basic_auth/tests/src/Functional/BasicAuthTest.php b/core/modules/basic_auth/tests/src/Functional/BasicAuthTest.php
index 7a2f13fb3a8d7cd2febd46a192caace81c90e40e..39eddebf86d2bac41fd34ef683c04aa86f09df2f 100644
--- a/core/modules/basic_auth/tests/src/Functional/BasicAuthTest.php
+++ b/core/modules/basic_auth/tests/src/Functional/BasicAuthTest.php
@@ -57,7 +57,7 @@ public function testBasicAuth() {
 
     // Ensure that invalid authentication details give access denied.
     $this->basicAuthGet($url, $account->getAccountName(), $this->randomMachineName());
-    $this->assertNoText($account->getAccountName());
+    $this->assertSession()->pageTextNotContains($account->getAccountName());
     $this->assertSession()->statusCodeEquals(403);
     $this->mink->resetSessions();
 
@@ -179,7 +179,7 @@ public function testUnauthorizedErrorMessage() {
     // unauthorized message is displayed.
     $this->drupalGet($url);
     $this->assertSession()->statusCodeEquals(401);
-    $this->assertNoText('Exception');
+    $this->assertSession()->pageTextNotContains('Exception');
     $this->assertSession()->pageTextContains('Please log in to access this page.');
 
     // Case when empty credentials are passed, a user friendly access denied
diff --git a/core/modules/block/tests/src/Functional/BlockCacheTest.php b/core/modules/block/tests/src/Functional/BlockCacheTest.php
index 9ed66f3ed6276862cd6a9227507ec0f873dda702..827c13ab0ed7c11522ec5040c451196d4df80038 100644
--- a/core/modules/block/tests/src/Functional/BlockCacheTest.php
+++ b/core/modules/block/tests/src/Functional/BlockCacheTest.php
@@ -97,7 +97,7 @@ public function testCachePerRole() {
     // Clear the cache and verify that the stale data is no longer there.
     Cache::invalidateTags(['block_view']);
     $this->drupalGet('');
-    $this->assertNoText($old_content);
+    $this->assertSession()->pageTextNotContains($old_content);
     // Fresh block content is displayed after clearing the cache.
     $this->assertSession()->pageTextContains($current_content);
 
@@ -108,7 +108,7 @@ public function testCachePerRole() {
     $this->drupalLogout();
     $this->drupalGet('');
     // Anonymous user does not see content cached per-role for normal user.
-    $this->assertNoText($old_content);
+    $this->assertSession()->pageTextNotContains($old_content);
 
     // User with the same roles sees per-role cached content.
     $this->drupalLogin($this->normalUserAlt);
@@ -118,7 +118,7 @@ public function testCachePerRole() {
     // Admin user does not see content cached per-role for normal user.
     $this->drupalLogin($this->adminUser);
     $this->drupalGet('');
-    $this->assertNoText($old_content);
+    $this->assertSession()->pageTextNotContains($old_content);
 
     // Block is served from the per-role cache.
     $this->drupalLogin($this->normalUser);
@@ -227,7 +227,7 @@ public function testCachePerPage() {
     $this->assertSession()->statusCodeEquals(200);
     // Verify that block content cached for the test page does not show up
     // for the user page.
-    $this->assertNoText($old_content);
+    $this->assertSession()->pageTextNotContains($old_content);
     $this->drupalGet('test-page');
     $this->assertSession()->statusCodeEquals(200);
     // Verify that the block content is cached for the test page.
diff --git a/core/modules/block/tests/src/Functional/BlockInstallTest.php b/core/modules/block/tests/src/Functional/BlockInstallTest.php
index ad79cb59fdbc25ec4c5ec51dbe1f284012efcf31..32b6855a1dab042f2b4f0ae043e4b8e1b35b1fbe 100644
--- a/core/modules/block/tests/src/Functional/BlockInstallTest.php
+++ b/core/modules/block/tests/src/Functional/BlockInstallTest.php
@@ -19,7 +19,7 @@ class BlockInstallTest extends BrowserTestBase {
   public function testCacheTagInvalidationUponInstallation() {
     // Warm the page cache.
     $this->drupalGet('');
-    $this->assertNoText('Powered by Drupal');
+    $this->assertSession()->pageTextNotContains('Powered by Drupal');
     $this->assertSession()->responseHeaderNotContains('X-Drupal-Cache-Tags', 'config:block_list');
 
     // Install the block module, and place the "Powered by Drupal" block.
diff --git a/core/modules/block/tests/src/Functional/BlockLanguageTest.php b/core/modules/block/tests/src/Functional/BlockLanguageTest.php
index c8ec72d0b879b95b0461f417e2f7a2d03f89289d..a55a0f47b716853fc4adb7a6363517db00f65e4d 100644
--- a/core/modules/block/tests/src/Functional/BlockLanguageTest.php
+++ b/core/modules/block/tests/src/Functional/BlockLanguageTest.php
@@ -84,7 +84,7 @@ public function testLanguageBlockVisibility() {
 
     // Check that a page doesn't has a block for the current language anymore.
     $this->drupalGet('fr');
-    $this->assertNoText('Powered by Drupal');
+    $this->assertSession()->pageTextNotContains('Powered by Drupal');
   }
 
   /**
@@ -162,7 +162,7 @@ public function testMultipleLanguageTypes() {
 
     // Interface negotiation depends on request arguments.
     $this->drupalGet('node', ['query' => ['language' => 'en']]);
-    $this->assertNoText('Powered by Drupal');
+    $this->assertSession()->pageTextNotContains('Powered by Drupal');
     $this->drupalGet('node', ['query' => ['language' => 'fr']]);
     $this->assertSession()->pageTextContains('Powered by Drupal');
 
@@ -174,9 +174,9 @@ public function testMultipleLanguageTypes() {
     // Content language does not depend on session/request arguments.
     // It will fall back on English (site default) and not display the block.
     $this->drupalGet('en');
-    $this->assertNoText('Powered by Drupal');
+    $this->assertSession()->pageTextNotContains('Powered by Drupal');
     $this->drupalGet('fr');
-    $this->assertNoText('Powered by Drupal');
+    $this->assertSession()->pageTextNotContains('Powered by Drupal');
 
     // Change visibility to now depend on content language for this block.
     $edit = [
@@ -188,13 +188,13 @@ public function testMultipleLanguageTypes() {
     // Content language negotiation does not depend on request arguments.
     // It will fall back on English (site default) and not display the block.
     $this->drupalGet('node', ['query' => ['language' => 'en']]);
-    $this->assertNoText('Powered by Drupal');
+    $this->assertSession()->pageTextNotContains('Powered by Drupal');
     $this->drupalGet('node', ['query' => ['language' => 'fr']]);
-    $this->assertNoText('Powered by Drupal');
+    $this->assertSession()->pageTextNotContains('Powered by Drupal');
 
     // Content language negotiation depends on path prefix.
     $this->drupalGet('en');
-    $this->assertNoText('Powered by Drupal');
+    $this->assertSession()->pageTextNotContains('Powered by Drupal');
     $this->drupalGet('fr');
     $this->assertSession()->pageTextContains('Powered by Drupal');
   }
diff --git a/core/modules/block/tests/src/Functional/BlockTest.php b/core/modules/block/tests/src/Functional/BlockTest.php
index 262985eff01be5a34be33d883ffe92e81284f797..dce57b896d3edb46c50127d6343afd93e35d2425 100644
--- a/core/modules/block/tests/src/Functional/BlockTest.php
+++ b/core/modules/block/tests/src/Functional/BlockTest.php
@@ -56,15 +56,15 @@ public function testBlockVisibility() {
     // Confirm that the block is not displayed according to block visibility
     // rules.
     $this->drupalGet('user');
-    $this->assertNoText($title);
+    $this->assertSession()->pageTextNotContains($title);
 
     // Confirm that the block is not displayed to anonymous users.
     $this->drupalLogout();
     $this->drupalGet('');
-    $this->assertNoText($title);
+    $this->assertSession()->pageTextNotContains($title);
 
     // Confirm that an empty block is not displayed.
-    $this->assertNoText('Powered by Drupal');
+    $this->assertSession()->pageTextNotContains('Powered by Drupal');
     $this->assertNoRaw('sidebar-first');
   }
 
@@ -129,17 +129,17 @@ public function testBlockVisibilityListedEmpty() {
     // Confirm that block was not displayed according to block visibility
     // rules.
     $this->drupalGet('user');
-    $this->assertNoText($title);
+    $this->assertSession()->pageTextNotContains($title);
 
     // Confirm that block was not displayed according to block visibility
     // rules regardless of path case.
     $this->drupalGet('USER');
-    $this->assertNoText($title);
+    $this->assertSession()->pageTextNotContains($title);
 
     // Confirm that the block is not displayed to anonymous users.
     $this->drupalLogout();
     $this->drupalGet('');
-    $this->assertNoText($title);
+    $this->assertSession()->pageTextNotContains($title);
   }
 
   /**
@@ -235,7 +235,7 @@ public function testBlock() {
 
     // Confirm that the block instance title and markup are not displayed.
     $this->drupalGet('node');
-    $this->assertNoText($block['settings[label]']);
+    $this->assertSession()->pageTextNotContains($block['settings[label]']);
     // Check for <div id="block-my-block-instance-name"> if the machine name
     // is my_block_instance_name.
     $xpath = $this->assertSession()->buildXPathQuery('//div[@id=:id]/*', [':id' => 'block-' . str_replace('_', '-', strtolower($block['id']))]);
@@ -324,7 +324,7 @@ public function testHideBlockTitle() {
 
     // Confirm that the block is not displayed by default.
     $this->drupalGet('user');
-    $this->assertNoText($title);
+    $this->assertSession()->pageTextNotContains($title);
 
     $edit = [
       'settings[label_display]' => TRUE,
@@ -532,7 +532,7 @@ public function testBlockAccess() {
     $this->drupalPlaceBlock('test_access', ['region' => 'help']);
 
     $this->drupalGet('<front>');
-    $this->assertNoText('Hello test world');
+    $this->assertSession()->pageTextNotContains('Hello test world');
 
     \Drupal::state()->set('test_block_access', TRUE);
     $this->drupalGet('<front>');
diff --git a/core/modules/block/tests/src/Functional/BlockUiTest.php b/core/modules/block/tests/src/Functional/BlockUiTest.php
index c55d62fd41ef0c8d551cd0fbb257f07857962d42..a8d0b5c2982e1631d4133d9c2c1aa51276616881 100644
--- a/core/modules/block/tests/src/Functional/BlockUiTest.php
+++ b/core/modules/block/tests/src/Functional/BlockUiTest.php
@@ -216,7 +216,7 @@ public function testContextAwareUnsatisfiedBlocks() {
   public function testContextAwareBlocks() {
     $expected_text = '<div id="test_context_aware--username">' . \Drupal::currentUser()->getAccountName() . '</div>';
     $this->drupalGet('');
-    $this->assertNoText('Test context-aware block');
+    $this->assertSession()->pageTextNotContains('Test context-aware block');
     $this->assertNoRaw($expected_text);
 
     $block_url = 'admin/structure/block/add/test_context_aware/classy';
@@ -260,7 +260,7 @@ public function testContextAwareBlocks() {
     $this->submitForm($edit, 'Save block');
     $this->drupalGet('');
     $this->assertSession()->pageTextContains('No context mapping selected.');
-    $this->assertNoText('User context found.');
+    $this->assertSession()->pageTextNotContains('User context found.');
 
     // Tests that conditions with missing context are not displayed.
     $this->drupalGet('admin/structure/block/manage/testcontextawareblock');
diff --git a/core/modules/block_content/tests/src/Functional/BlockContentCreationTest.php b/core/modules/block_content/tests/src/Functional/BlockContentCreationTest.php
index b6f4398cfdf6b5df4da2e1011d9f8f8473646c93..ebe9fcd98887ddfe7de6a72b3df8108641f9d0d3 100644
--- a/core/modules/block_content/tests/src/Functional/BlockContentCreationTest.php
+++ b/core/modules/block_content/tests/src/Functional/BlockContentCreationTest.php
@@ -285,7 +285,7 @@ public function testBlockDelete() {
 
     // Show the delete confirm form.
     $this->drupalGet('block/3/delete');
-    $this->assertNoText('This will also remove');
+    $this->assertSession()->pageTextNotContains('This will also remove');
   }
 
   /**
diff --git a/core/modules/block_content/tests/src/Functional/BlockContentRevisionsTest.php b/core/modules/block_content/tests/src/Functional/BlockContentRevisionsTest.php
index 7762fc1e4c40b77cf405c9867f6fc496f59a91c2..59c556ca5b1346dc8494a5ac0d620265ae163609 100644
--- a/core/modules/block_content/tests/src/Functional/BlockContentRevisionsTest.php
+++ b/core/modules/block_content/tests/src/Functional/BlockContentRevisionsTest.php
@@ -98,7 +98,7 @@ public function testRevisions() {
     // Confirm that revision body text is not present on default version of
     // block.
     $this->drupalGet('block/' . $loaded->id());
-    $this->assertNoText($loaded->body->value);
+    $this->assertSession()->pageTextNotContains($loaded->body->value);
 
     // Verify that the non-default revision id is greater than the default
     // revision id.
diff --git a/core/modules/block_content/tests/src/Functional/BlockContentTypeTest.php b/core/modules/block_content/tests/src/Functional/BlockContentTypeTest.php
index 937a63c488f43ba4e7c3154b79e1bbbf9bb207d1..44fff904e0c93fbbcb94cbc16d66be814212e788 100644
--- a/core/modules/block_content/tests/src/Functional/BlockContentTypeTest.php
+++ b/core/modules/block_content/tests/src/Functional/BlockContentTypeTest.php
@@ -178,7 +178,7 @@ public function testBlockContentTypeDeletion() {
     $this->assertRaw(
       t('%label is used by 1 custom block on your site. You can not remove this block type until you have removed all of the %label blocks.', ['%label' => $type->label()])
     );
-    $this->assertNoText('This action cannot be undone.');
+    $this->assertSession()->pageTextNotContains('This action cannot be undone.');
 
     // Delete the block.
     $block->delete();
diff --git a/core/modules/book/tests/src/Functional/BookTest.php b/core/modules/book/tests/src/Functional/BookTest.php
index da9ee82ec0a599508eb2dd6b384bccb5718423df..5160ce30313824b3ac028ff65629dd7bf34cf7d3 100644
--- a/core/modules/book/tests/src/Functional/BookTest.php
+++ b/core/modules/book/tests/src/Functional/BookTest.php
@@ -310,7 +310,7 @@ public function testBookNavigationBlock() {
     // Link to book root.
     $this->assertSession()->pageTextContains($this->book->label());
     // No links to individual book pages.
-    $this->assertNoText($nodes[0]->label());
+    $this->assertSession()->pageTextNotContains($nodes[0]->label());
 
     // Ensure that an unpublished node does not appear in the navigation for a
     // user without access. By unpublishing a parent page, child pages should
@@ -419,7 +419,7 @@ public function testNavigationBlockOnAccessModuleInstalled() {
 
     // Test the 'book pages' block_mode setting.
     $this->drupalGet('<front>');
-    $this->assertNoText($block->label());
+    $this->assertSession()->pageTextNotContains($block->label());
   }
 
   /**
diff --git a/core/modules/comment/tests/src/Functional/CommentAdminTest.php b/core/modules/comment/tests/src/Functional/CommentAdminTest.php
index cb0ef684945fb5f3ef24a6e2239785dd201028ca..cbc3991f7032d399aaea8697d9c2090c7a77551b 100644
--- a/core/modules/comment/tests/src/Functional/CommentAdminTest.php
+++ b/core/modules/comment/tests/src/Functional/CommentAdminTest.php
@@ -116,7 +116,7 @@ public function testApprovalAdminInterface() {
     $this->assertSession()->pageTextContains(Html::escape($this->node->label()));
     $this->node->setUnpublished()->save();
     $this->drupalGet('admin/content/comment');
-    $this->assertNoText(Html::escape($this->node->label()));
+    $this->assertSession()->pageTextNotContains(Html::escape($this->node->label()));
   }
 
   /**
diff --git a/core/modules/comment/tests/src/Functional/CommentBlockTest.php b/core/modules/comment/tests/src/Functional/CommentBlockTest.php
index 29ebe8f9c87b0f94bf21e920401b648b7994330c..1392b0556e9a61e9da4d270d9152c45a613f294c 100644
--- a/core/modules/comment/tests/src/Functional/CommentBlockTest.php
+++ b/core/modules/comment/tests/src/Functional/CommentBlockTest.php
@@ -60,7 +60,7 @@ public function testRecentCommentBlock() {
     $this->drupalLogout();
     user_role_revoke_permissions(RoleInterface::ANONYMOUS_ID, ['access comments']);
     $this->drupalGet('');
-    $this->assertNoText('Recent comments');
+    $this->assertSession()->pageTextNotContains('Recent comments');
     user_role_grant_permissions(RoleInterface::ANONYMOUS_ID, ['access comments']);
 
     // Test that a user with the 'access comments' permission can see the
@@ -70,7 +70,7 @@ public function testRecentCommentBlock() {
     $this->assertSession()->pageTextContains('Recent comments');
 
     // Test the only the 10 latest comments are shown and in the proper order.
-    $this->assertNoText($comments[10]->getSubject());
+    $this->assertSession()->pageTextNotContains($comments[10]->getSubject());
     for ($i = 0; $i < 10; $i++) {
       $this->assertSession()->pageTextContains($comments[$i]->getSubject());
       if ($i > 1) {
diff --git a/core/modules/comment/tests/src/Functional/CommentBookTest.php b/core/modules/comment/tests/src/Functional/CommentBookTest.php
index b9be39d688e18df0a8a6e24ec1e4f3e5e78f6fcb..cb66313edd8252b30c4ac05841eac098da9c471e 100644
--- a/core/modules/comment/tests/src/Functional/CommentBookTest.php
+++ b/core/modules/comment/tests/src/Functional/CommentBookTest.php
@@ -81,7 +81,7 @@ public function testBookCommentPrint() {
     $this->assertSession()->pageTextContains($comment_subject);
     $this->assertSession()->pageTextContains($comment_body);
 
-    $this->assertNoText('Add new comment');
+    $this->assertSession()->pageTextNotContains('Add new comment');
     // Verify that the comment form subject field is not found.
     $this->assertSession()->fieldNotExists('subject[0][value]');
   }
diff --git a/core/modules/comment/tests/src/Functional/CommentFieldsTest.php b/core/modules/comment/tests/src/Functional/CommentFieldsTest.php
index 63da6fba76d026d864949e0b597e47e0e4696843..71780ada8786d5e8bac95a48dfc361bb324f63ca 100644
--- a/core/modules/comment/tests/src/Functional/CommentFieldsTest.php
+++ b/core/modules/comment/tests/src/Functional/CommentFieldsTest.php
@@ -183,7 +183,7 @@ public function testCommentFieldCreate() {
     $this->drupalGet('admin/config/people/accounts/fields/user.user.field_user_comment/storage');
     $this->submitForm($edit, 'Save field settings');
     // We shouldn't get an error message.
-    $this->assertNoText('An illegal choice has been detected. Please contact the site administrator.');
+    $this->assertSession()->pageTextNotContains('An illegal choice has been detected. Please contact the site administrator.');
   }
 
   /**
diff --git a/core/modules/comment/tests/src/Functional/CommentInterfaceTest.php b/core/modules/comment/tests/src/Functional/CommentInterfaceTest.php
index 8be8687d1c63d84e02076ccf5a01602816dcb0b8..ceb2108c1334401835f54ef6d54b68af9c64e4d3 100644
--- a/core/modules/comment/tests/src/Functional/CommentInterfaceTest.php
+++ b/core/modules/comment/tests/src/Functional/CommentInterfaceTest.php
@@ -198,7 +198,7 @@ public function testCommentInterface() {
     $this->node = $this->drupalCreateNode(['type' => 'article', 'promote' => 1, 'comment' => [['status' => CommentItemInterface::OPEN]]]);
     $this->assertNotNull($this->node, 'Article node created.');
     $this->drupalGet('comment/reply/node/' . $this->node->id() . '/comment');
-    $this->assertNoText('This discussion is closed');
+    $this->assertSession()->pageTextNotContains('This discussion is closed');
     // Ensure that the comment body field exists.
     $this->assertSession()->fieldExists('edit-comment-body-0-value');
 
diff --git a/core/modules/comment/tests/src/Functional/CommentNonNodeTest.php b/core/modules/comment/tests/src/Functional/CommentNonNodeTest.php
index 68ab4a9af72723f0de561109dbad6bb46895c801..6f9a9691bf938cb3f4bcaeee31a55c661e143bb8 100644
--- a/core/modules/comment/tests/src/Functional/CommentNonNodeTest.php
+++ b/core/modules/comment/tests/src/Functional/CommentNonNodeTest.php
@@ -341,7 +341,7 @@ public function testCommentFunctionality() {
     ]);
     $this->drupalLogin($limited_user);
     $this->drupalGet('admin/content/comment');
-    $this->assertNoText($this->entity->label());
+    $this->assertSession()->pageTextNotContains($this->entity->label());
 
     $this->drupalLogout();
 
@@ -396,7 +396,7 @@ public function testCommentFunctionality() {
 
     $this->drupalGet('comment/reply/entity_test/' . $this->entity->id() . '/comment/' . $comment1->id());
     $this->assertSession()->statusCodeEquals(403);
-    $this->assertNoText($comment1->getSubject());
+    $this->assertSession()->pageTextNotContains($comment1->getSubject());
 
     // Test comment field widget changes.
     $limited_user = $this->drupalCreateUser([
diff --git a/core/modules/comment/tests/src/Functional/CommentPagerTest.php b/core/modules/comment/tests/src/Functional/CommentPagerTest.php
index 9c11fef7a3eb4e573bfae406180a256ed60874bb..cca715da3e74d30d100bb098c7ffc42422b2513f 100644
--- a/core/modules/comment/tests/src/Functional/CommentPagerTest.php
+++ b/core/modules/comment/tests/src/Functional/CommentPagerTest.php
@@ -344,7 +344,7 @@ public function testTwoPagers() {
     $this->drupalLogin($account);
     $this->drupalGet('admin/structure/types/manage/article/display');
     // No summary for standard pager.
-    $this->assertNoText('Pager ID: 0');
+    $this->assertSession()->pageTextNotContains('Pager ID: 0');
     $this->assertSession()->pageTextContains('Pager ID: 1');
     $this->submitForm([], 'comment_settings_edit');
     // Change default pager to 2.
@@ -354,7 +354,7 @@ public function testTwoPagers() {
     $this->submitForm([], 'comment_settings_edit');
     $this->submitForm(['fields[comment][settings_edit_form][settings][pager_id]' => 0], 'Save');
     // No summary for standard pager.
-    $this->assertNoText('Pager ID: 0');
+    $this->assertSession()->pageTextNotContains('Pager ID: 0');
 
     $this->drupalLogin($this->adminUser);
 
diff --git a/core/modules/comment/tests/src/Functional/CommentTypeTest.php b/core/modules/comment/tests/src/Functional/CommentTypeTest.php
index 2b9bc2efd2a10d5c9a92cc6334efb45899fdd5d9..a4a72a90183309ee50e1cb52ce066191d7827aa4 100644
--- a/core/modules/comment/tests/src/Functional/CommentTypeTest.php
+++ b/core/modules/comment/tests/src/Functional/CommentTypeTest.php
@@ -170,7 +170,7 @@ public function testCommentTypeDeletion() {
         '%field' => 'node.foo',
       ])
     );
-    $this->assertNoText('This action cannot be undone.');
+    $this->assertSession()->pageTextNotContains('This action cannot be undone.');
 
     // Delete the comment and the field.
     $comment->delete();
diff --git a/core/modules/comment/tests/src/Functional/Views/CommentAdminTest.php b/core/modules/comment/tests/src/Functional/Views/CommentAdminTest.php
index f754e84c7de222051ecf47b4bdbbd02bd5e1d718..9dd27c14bbb69e241c16708d352adbe7da735f8d 100644
--- a/core/modules/comment/tests/src/Functional/Views/CommentAdminTest.php
+++ b/core/modules/comment/tests/src/Functional/Views/CommentAdminTest.php
@@ -170,7 +170,7 @@ public function testApprovalAdminInterface() {
     $this->assertFalse($this->node->isPublished(), 'Node is unpublished now.');
     $this->drupalGet('admin/content/comment');
     // Verify that comment admin cannot see the title of an unpublished node.
-    $this->assertNoText(Html::escape($this->node->label()));
+    $this->assertSession()->pageTextNotContains(Html::escape($this->node->label()));
     $this->drupalLogout();
     $node_access_user = $this->drupalCreateUser([
       'administer comments',
diff --git a/core/modules/comment/tests/src/Functional/Views/CommentRestExportTest.php b/core/modules/comment/tests/src/Functional/Views/CommentRestExportTest.php
index eb327eb036e6ec5bc20750dbdefd22f200d3d0e1..8253dcb43b9006e195836378bdb153cc3022ac6c 100644
--- a/core/modules/comment/tests/src/Functional/Views/CommentRestExportTest.php
+++ b/core/modules/comment/tests/src/Functional/Views/CommentRestExportTest.php
@@ -70,8 +70,8 @@ public function testCommentRestExport() {
 
     // Ensure field-level access is respected - user shouldn't be able to see
     // mail or hostname fields.
-    $this->assertNoText('someone@example.com');
-    $this->assertNoText('public.example.com');
+    $this->assertSession()->responseNotContains('someone@example.com');
+    $this->assertSession()->responseNotContains('public.example.com');
   }
 
 }
diff --git a/core/modules/config/tests/src/Functional/CacheabilityMetadataConfigOverrideIntegrationTest.php b/core/modules/config/tests/src/Functional/CacheabilityMetadataConfigOverrideIntegrationTest.php
index e3aa2b7215c444092c2f23f5d21535cb4806e5ca..81a70d1b2d415557f5979c7439f98137289debc0 100644
--- a/core/modules/config/tests/src/Functional/CacheabilityMetadataConfigOverrideIntegrationTest.php
+++ b/core/modules/config/tests/src/Functional/CacheabilityMetadataConfigOverrideIntegrationTest.php
@@ -48,7 +48,7 @@ public function testConfigOverride() {
     // Check the default (disabled) state of the cache context. The block label
     // should not be overridden.
     $this->drupalGet('<front>');
-    $this->assertNoText('Overridden block label');
+    $this->assertSession()->pageTextNotContains('Overridden block label');
 
     // Both the cache context and tag should be present.
     $this->assertCacheContext('config_override_integration_test');
diff --git a/core/modules/config/tests/src/Functional/ConfigDependencyWebTest.php b/core/modules/config/tests/src/Functional/ConfigDependencyWebTest.php
index 578d1270024599543569f6b764de4c6cca84c456..9007de192dfaf217b3f56ab2d7cb7d6b7a9e71a5 100644
--- a/core/modules/config/tests/src/Functional/ConfigDependencyWebTest.php
+++ b/core/modules/config/tests/src/Functional/ConfigDependencyWebTest.php
@@ -66,10 +66,10 @@ public function testConfigDependencyDeleteFormTrait() {
     $entity2->save();
 
     $this->drupalGet($entity2->toUrl('delete-form'));
-    $this->assertNoText('Configuration updates');
-    $this->assertNoText('Configuration deletions');
+    $this->assertSession()->pageTextNotContains('Configuration updates');
+    $this->assertSession()->pageTextNotContains('Configuration deletions');
     $this->drupalGet($entity1->toUrl('delete-form'));
-    $this->assertNoText('Configuration updates');
+    $this->assertSession()->pageTextNotContains('Configuration updates');
     $this->assertSession()->pageTextContains('Configuration deletions');
     $this->assertSession()->pageTextContains($entity2->id());
     $this->drupalGet($entity1->toUrl('delete-form'));
@@ -119,10 +119,10 @@ public function testConfigDependencyDeleteFormTrait() {
 
     $this->drupalGet($entity1->toUrl('delete-form'));
     $this->assertSession()->pageTextContains('Configuration updates');
-    $this->assertNoText('Configuration deletions');
-    $this->assertNoText($entity2->id());
+    $this->assertSession()->pageTextNotContains('Configuration deletions');
+    $this->assertSession()->pageTextNotContains($entity2->id());
     $this->assertSession()->pageTextContains($entity2->label());
-    $this->assertNoText($entity3->id());
+    $this->assertSession()->pageTextNotContains($entity3->id());
     $this->drupalGet($entity1->toUrl('delete-form'));
     $this->submitForm([], 'Delete');
     $storage->resetCache();
diff --git a/core/modules/config/tests/src/Functional/ConfigEntityFormOverrideTest.php b/core/modules/config/tests/src/Functional/ConfigEntityFormOverrideTest.php
index a363649a4965ef12911889aaff671a88dfa58949..bd2fcdece8f0a8b48e5b62b0e418eb98ec41e5f6 100644
--- a/core/modules/config/tests/src/Functional/ConfigEntityFormOverrideTest.php
+++ b/core/modules/config/tests/src/Functional/ConfigEntityFormOverrideTest.php
@@ -48,12 +48,12 @@ public function testFormsWithOverrides() {
     // Test that the original label on the listing page is intact.
     $this->drupalGet('admin/structure/config_test');
     $this->assertSession()->pageTextContains($original_label);
-    $this->assertNoText($overridden_label);
+    $this->assertSession()->pageTextNotContains($overridden_label);
 
     // Test that the original label on the editing page is intact.
     $this->drupalGet('admin/structure/config_test/manage/dotted.default');
     $this->assertSession()->fieldValueEquals('label', $original_label);
-    $this->assertNoText($overridden_label);
+    $this->assertSession()->pageTextNotContains($overridden_label);
 
     // Change to a new label and test that the listing now has the edited label.
     $edit = [
@@ -61,7 +61,7 @@ public function testFormsWithOverrides() {
     ];
     $this->submitForm($edit, 'Save');
     $this->drupalGet('admin/structure/config_test');
-    $this->assertNoText($overridden_label);
+    $this->assertSession()->pageTextNotContains($overridden_label);
     $this->assertSession()->pageTextContains($edited_label);
 
     // Test that the editing page now has the edited label.
diff --git a/core/modules/config/tests/src/Functional/ConfigEntityTest.php b/core/modules/config/tests/src/Functional/ConfigEntityTest.php
index e170c3e14c1ce2de01af6824f58bb5c5ef495afe..0520b205263477c24399b0d67f24498fb89f2d89 100644
--- a/core/modules/config/tests/src/Functional/ConfigEntityTest.php
+++ b/core/modules/config/tests/src/Functional/ConfigEntityTest.php
@@ -273,7 +273,7 @@ public function testCRUDUI() {
     $this->assertSession()->statusCodeEquals(200);
     $this->assertNoRaw($message_update);
     $this->assertRaw($message_delete);
-    $this->assertNoText($label1);
+    $this->assertSession()->pageTextNotContains($label1);
     $this->assertSession()->linkByHrefNotExists("admin/structure/config_test/manage/$id");
 
     // Re-create a configuration entity.
@@ -297,8 +297,8 @@ public function testCRUDUI() {
     $this->submitForm($edit, 'Save');
     $this->assertSession()->addressEquals('admin/structure/config_test');
     $this->assertSession()->statusCodeEquals(200);
-    $this->assertNoText($label1);
-    $this->assertNoText($label2);
+    $this->assertSession()->pageTextNotContains($label1);
+    $this->assertSession()->pageTextNotContains($label2);
     $this->assertSession()->pageTextContains($label3);
     $this->assertSession()->linkByHrefNotExists("admin/structure/config_test/manage/$id");
     $id = $edit['id'];
diff --git a/core/modules/config/tests/src/Functional/ConfigExportImportUITest.php b/core/modules/config/tests/src/Functional/ConfigExportImportUITest.php
index 7f4553f18f7199903591768777a92de69e422295..73858fd7aaeee6aab852079a6684f748dcc458b8 100644
--- a/core/modules/config/tests/src/Functional/ConfigExportImportUITest.php
+++ b/core/modules/config/tests/src/Functional/ConfigExportImportUITest.php
@@ -91,7 +91,7 @@ protected function setUp(): void {
   public function testExportImport() {
     // After installation there is no snapshot and nothing to import.
     $this->drupalGet('admin/config/development/configuration');
-    $this->assertNoText('Warning message');
+    $this->assertSession()->pageTextNotContains('Warning message');
     $this->assertSession()->pageTextContains('There are no configuration changes to import.');
 
     $this->originalSlogan = $this->config('system.site')->get('slogan');
@@ -170,13 +170,13 @@ public function testExportImport() {
     $this->drupalGet('admin/config/development/configuration/full/import');
     $this->submitForm(['files[import_tarball]' => $filename], 'Upload');
     // There is no snapshot yet because an import has never run.
-    $this->assertNoText('Warning message');
-    $this->assertNoText('There are no configuration changes to import.');
+    $this->assertSession()->pageTextNotContains('Warning message');
+    $this->assertSession()->pageTextNotContains('There are no configuration changes to import.');
     $this->assertSession()->pageTextContains($this->contentType->label());
 
     $this->submitForm([], 'Import all');
     // After importing the snapshot has been updated and there are no warnings.
-    $this->assertNoText('Warning message');
+    $this->assertSession()->pageTextNotContains('Warning message');
     $this->assertSession()->pageTextContains('There are no configuration changes to import.');
 
     $this->assertEquals($this->newSlogan, $this->config('system.site')->get('slogan'));
@@ -197,8 +197,8 @@ public function testExportImport() {
     // active and snapshot should no longer exist.
     \Drupal::service('config.storage.sync')->deleteAll();
     $this->drupalGet('admin/config/development/configuration');
-    $this->assertNoText('Warning message');
-    $this->assertNoText('The following items in your active configuration have changes since the last import that may be lost on the next import.');
+    $this->assertSession()->pageTextNotContains('Warning message');
+    $this->assertSession()->pageTextNotContains('The following items in your active configuration have changes since the last import that may be lost on the next import.');
     $this->assertSession()->pageTextContains('There are no configuration changes to import.');
     // Write a file to sync. The warning about differences between the active
     // and snapshot should now exist.
@@ -282,7 +282,7 @@ public function testExportImportCollections() {
     $this->submitForm(['files[import_tarball]' => $filename], 'Upload');
     // Verify that there are configuration differences to import.
     $this->drupalGet('admin/config/development/configuration');
-    $this->assertNoText('There are no configuration changes to import.');
+    $this->assertSession()->pageTextNotContains('There are no configuration changes to import.');
     $this->assertSession()->pageTextContains('collection.test1 configuration collection');
     $this->assertSession()->pageTextContains('collection.test2 configuration collection');
     $this->assertSession()->pageTextContains('config_test.create');
diff --git a/core/modules/config/tests/src/Functional/ConfigImportUITest.php b/core/modules/config/tests/src/Functional/ConfigImportUITest.php
index c4a60fdef00ae620a47c5ae682497d9006e592ff..dd89f258307cadd5941912b5cb13c3876d1075d1 100644
--- a/core/modules/config/tests/src/Functional/ConfigImportUITest.php
+++ b/core/modules/config/tests/src/Functional/ConfigImportUITest.php
@@ -236,7 +236,7 @@ public function testImportLock() {
 
     // Verify that there are configuration differences to import.
     $this->drupalGet('admin/config/development/configuration');
-    $this->assertNoText('There are no configuration changes to import.');
+    $this->assertSession()->pageTextNotContains('There are no configuration changes to import.');
 
     // Acquire a fake-lock on the import mechanism.
     $config_importer = $this->configImporter();
@@ -360,7 +360,7 @@ public function testImportValidation() {
     $this->prepareSiteNameUpdate($new_site_name);
 
     $this->drupalGet('admin/config/development/configuration');
-    $this->assertNoText('There are no configuration changes to import.');
+    $this->assertSession()->pageTextNotContains('There are no configuration changes to import.');
     $this->submitForm([], 'Import all');
 
     // Verify that the validation messages appear.
@@ -437,13 +437,13 @@ public function testImportErrorLog() {
     $sync->write($name_secondary, $values_secondary);
     // Verify that there are configuration differences to import.
     $this->drupalGet('admin/config/development/configuration');
-    $this->assertNoText('There are no configuration changes to import.');
+    $this->assertSession()->pageTextNotContains('There are no configuration changes to import.');
 
     // Attempt to import configuration and verify that an error message appears.
     $this->submitForm([], 'Import all');
     $this->assertSession()->pageTextContains('Deleted and replaced configuration entity "' . $name_secondary . '"');
     $this->assertSession()->pageTextContains('The configuration was imported with errors.');
-    $this->assertNoText('The configuration was imported successfully.');
+    $this->assertSession()->pageTextNotContains('The configuration was imported successfully.');
     $this->assertSession()->pageTextContains('There are no configuration changes to import.');
   }
 
@@ -484,11 +484,11 @@ public function testEntityBundleDelete() {
     $this->submitForm([], 'Import all');
     $this->assertNoRaw($validation_message);
     $this->assertSession()->pageTextContains('There are no configuration changes to import.');
-    $this->assertNoText('node.type.' . $node_type->id());
-    $this->assertNoText('field.field.node.' . $node_type->id() . '.body');
-    $this->assertNoText('core.entity_view_display.node.' . $node_type->id() . '.teaser');
-    $this->assertNoText('core.entity_view_display.node.' . $node_type->id() . '.default');
-    $this->assertNoText('core.entity_form_display.node.' . $node_type->id() . '.default');
+    $this->assertSession()->pageTextNotContains('node.type.' . $node_type->id());
+    $this->assertSession()->pageTextNotContains('field.field.node.' . $node_type->id() . '.body');
+    $this->assertSession()->pageTextNotContains('core.entity_view_display.node.' . $node_type->id() . '.teaser');
+    $this->assertSession()->pageTextNotContains('core.entity_view_display.node.' . $node_type->id() . '.default');
+    $this->assertSession()->pageTextNotContains('core.entity_form_display.node.' . $node_type->id() . '.default');
   }
 
   /**
diff --git a/core/modules/config/tests/src/Functional/ConfigLanguageOverrideWebTest.php b/core/modules/config/tests/src/Functional/ConfigLanguageOverrideWebTest.php
index 7e6507b8fd8b5e22d00eef281e38ae1dd7b8a967..48df2cdfb09c674bc041afb8575c044f191c45c5 100644
--- a/core/modules/config/tests/src/Functional/ConfigLanguageOverrideWebTest.php
+++ b/core/modules/config/tests/src/Functional/ConfigLanguageOverrideWebTest.php
@@ -69,7 +69,7 @@ public function testSiteNameTranslation() {
 
     // The home page in English should not have the override.
     $this->drupalGet('');
-    $this->assertNoText('XX site name');
+    $this->assertSession()->pageTextNotContains('XX site name');
 
     // During path resolution the system.site configuration object is used to
     // determine the front page. This occurs before language negotiation causing
diff --git a/core/modules/config/tests/src/Functional/TransformedConfigExportImportUITest.php b/core/modules/config/tests/src/Functional/TransformedConfigExportImportUITest.php
index c60850f61a9ed60f4ad40d8f8c1573f29b705ea7..e42a5888e632110935dd81e5b41d5af1e9151b9a 100644
--- a/core/modules/config/tests/src/Functional/TransformedConfigExportImportUITest.php
+++ b/core/modules/config/tests/src/Functional/TransformedConfigExportImportUITest.php
@@ -48,8 +48,8 @@ protected function setUp(): void {
   public function testTransformedExportImport() {
     // After installation there is no snapshot but a new site name.
     $this->drupalGet('admin/config/development/configuration');
-    $this->assertNoText('Warning message');
-    $this->assertNoText('There are no configuration changes to import.');
+    $this->assertSession()->pageTextNotContains('Warning message');
+    $this->assertSession()->pageTextNotContains('There are no configuration changes to import.');
 
     // Tests changes of system.site.
     $this->drupalGet('admin/config/development/configuration/sync/diff/system.site');
diff --git a/core/modules/config_translation/tests/src/Functional/ConfigTranslationOverviewTest.php b/core/modules/config_translation/tests/src/Functional/ConfigTranslationOverviewTest.php
index 0a8dc7959e9645cd1e44cfadd388fec4699bac56..535f7e4e33dadbff8120609685bf2306c2fe81e4 100644
--- a/core/modules/config_translation/tests/src/Functional/ConfigTranslationOverviewTest.php
+++ b/core/modules/config_translation/tests/src/Functional/ConfigTranslationOverviewTest.php
@@ -173,7 +173,7 @@ public function testListingPageWithOverrides() {
     // Test that the original label on the listing page is intact.
     $this->drupalGet('admin/config/regional/config-translation/config_test');
     $this->assertSession()->pageTextContains($original_label);
-    $this->assertNoText($overridden_label);
+    $this->assertSession()->pageTextNotContains($overridden_label);
   }
 
   /**
diff --git a/core/modules/config_translation/tests/src/Functional/ConfigTranslationUiTest.php b/core/modules/config_translation/tests/src/Functional/ConfigTranslationUiTest.php
index 79f676676ae8844bae5f8b03277da89a0bef3449..ddf6500921b54d4bd21a8ea8a078c70360c09a69 100644
--- a/core/modules/config_translation/tests/src/Functional/ConfigTranslationUiTest.php
+++ b/core/modules/config_translation/tests/src/Functional/ConfigTranslationUiTest.php
@@ -217,18 +217,18 @@ public function testSiteInformationTranslationUi() {
     // Ensure that the label is in French (and not in English).
     $this->drupalGet("fr/$translation_base_url/fr/edit");
     $this->assertSession()->pageTextContains($fr_site_name_label);
-    $this->assertNoText($site_name_label);
+    $this->assertSession()->pageTextNotContains($site_name_label);
 
     // Ensure that the label is also in French (and not in English)
     // when editing another language with the interface in French.
     $this->drupalGet("fr/$translation_base_url/ta/edit");
     $this->assertSession()->pageTextContains($fr_site_name_label);
-    $this->assertNoText($site_name_label);
+    $this->assertSession()->pageTextNotContains($site_name_label);
 
     // Ensure that the label is not translated when the interface is in English.
     $this->drupalGet("$translation_base_url/fr/edit");
     $this->assertSession()->pageTextContains($site_name_label);
-    $this->assertNoText($fr_site_name_label);
+    $this->assertSession()->pageTextNotContains($fr_site_name_label);
   }
 
   /**
@@ -267,8 +267,8 @@ public function testSourceValueDuplicateSave() {
     $this->drupalGet("$translation_base_url/fr/edit");
     // Assert that the language configuration does not leak outside of the
     // translation form into the actual site name and slogan.
-    $this->assertNoText('FR ' . $site_name);
-    $this->assertNoText('FR ' . $site_slogan);
+    $this->assertSession()->pageTextNotContains('FR ' . $site_name);
+    $this->assertSession()->pageTextNotContains('FR ' . $site_slogan);
     $edit = [
       'translation[config_names][system.site][name]' => $site_name,
       'translation[config_names][system.site][slogan]' => 'FR ' . $site_slogan,
@@ -283,7 +283,7 @@ public function testSourceValueDuplicateSave() {
 
     // Case 3: Keep default value for site name and slogan.
     $this->drupalGet("$translation_base_url/fr/edit");
-    $this->assertNoText('FR ' . $site_slogan);
+    $this->assertSession()->pageTextNotContains('FR ' . $site_slogan);
     $edit = [
       'translation[config_names][system.site][name]' => $site_name,
       'translation[config_names][system.site][slogan]' => $site_slogan,
@@ -911,8 +911,8 @@ public function testAlterInfo() {
     // Check if the translation page does not have the altered out settings.
     $this->drupalGet('admin/config/people/accounts/translate/fr/add');
     $this->assertSession()->pageTextContains('Name');
-    $this->assertNoText('Account cancellation confirmation');
-    $this->assertNoText('Password recovery');
+    $this->assertSession()->pageTextNotContains('Account cancellation confirmation');
+    $this->assertSession()->pageTextNotContains('Password recovery');
   }
 
   /**
diff --git a/core/modules/contact/tests/src/Functional/ContactPersonalTest.php b/core/modules/contact/tests/src/Functional/ContactPersonalTest.php
index f8a50dd2ab10c99451efcf39eae07a1ce3c13bcd..90b1583643a18f00b3bf4c046a2ff7c372a57a39 100644
--- a/core/modules/contact/tests/src/Functional/ContactPersonalTest.php
+++ b/core/modules/contact/tests/src/Functional/ContactPersonalTest.php
@@ -277,7 +277,7 @@ public function testPersonalContactFlood() {
     // Test that the admin user can still access the contact form even though
     // the flood limit was reached.
     $this->drupalLogin($this->adminUser);
-    $this->assertNoText('Try again later.');
+    $this->assertSession()->pageTextNotContains('Try again later.');
   }
 
   /**
diff --git a/core/modules/contact/tests/src/Functional/ContactSitewideTest.php b/core/modules/contact/tests/src/Functional/ContactSitewideTest.php
index 586e6203edd672bdfb05d2044c3fdcdc6422d3da..336b7b78ad3965ea65269fa17344f4c1a2b9d2cb 100644
--- a/core/modules/contact/tests/src/Functional/ContactSitewideTest.php
+++ b/core/modules/contact/tests/src/Functional/ContactSitewideTest.php
@@ -214,7 +214,7 @@ public function testSiteWideContact() {
     $this->drupalLogout();
     $this->drupalGet('contact');
     $this->assertSession()->pageTextContains('Your email address');
-    $this->assertNoText('Form');
+    $this->assertSession()->pageTextNotContains('Form');
     $this->drupalLogin($admin_user);
 
     // Add more forms.
@@ -226,7 +226,7 @@ public function testSiteWideContact() {
 
     // Try adding a form that already exists.
     $this->addContactForm($name, $label, '', '', FALSE);
-    $this->assertNoText("Contact form $label has been added.");
+    $this->assertSession()->pageTextNotContains("Contact form $label has been added.");
     $this->assertRaw(t('The machine-readable name is already in use. It must be unique.'));
 
     $this->drupalLogout();
@@ -489,7 +489,7 @@ public function testAutoReply() {
       ->removeComponent('mail')
       ->save();
     $this->submitContact($this->randomMachineName(16), $email, $this->randomString(64), 'foo', $this->randomString(128));
-    $this->assertNoText('Unable to send email. Contact the site administrator if the problem persists.');
+    $this->assertSession()->pageTextNotContains('Unable to send email. Contact the site administrator if the problem persists.');
     $captured_emails = $this->getMails(['id' => 'contact_page_autoreply', 'to' => $email]);
     $this->assertCount(0, $captured_emails);
     $this->drupalLogin($admin_user);
diff --git a/core/modules/contact/tests/src/Functional/ContactStorageTest.php b/core/modules/contact/tests/src/Functional/ContactStorageTest.php
index a2671caf15d8a2c6071f23792329f2d574fe8a3b..ae67387b77583c264d63125af4b3952689a7bca8 100644
--- a/core/modules/contact/tests/src/Functional/ContactStorageTest.php
+++ b/core/modules/contact/tests/src/Functional/ContactStorageTest.php
@@ -61,7 +61,7 @@ public function testContactStorage() {
     $this->drupalLogout();
     $this->drupalGet('contact');
     $this->assertSession()->pageTextContains('Your email address');
-    $this->assertNoText('Form');
+    $this->assertSession()->pageTextNotContains('Form');
     $this->submitContact($name = $this->randomMachineName(16), $mail, $subject = $this->randomMachineName(16), $id, $message = $this->randomMachineName(64));
     $this->assertSession()->pageTextContains('Your message has been sent.');
 
diff --git a/core/modules/content_moderation/tests/src/Functional/ModerationFormTest.php b/core/modules/content_moderation/tests/src/Functional/ModerationFormTest.php
index 109dcc1fa2477ce3a54f0095b3229dfe437fd53b..391d3a0e51e5e229b4c8e37c56e117754d8c1bf9 100644
--- a/core/modules/content_moderation/tests/src/Functional/ModerationFormTest.php
+++ b/core/modules/content_moderation/tests/src/Functional/ModerationFormTest.php
@@ -215,7 +215,7 @@ public function testNonBundleModerationForm() {
     // default revision.
     $this->drupalGet('entity_test_mulrevpub/manage/1');
     $this->assertSession()->statusCodeEquals(200);
-    $this->assertNoText('Status');
+    $this->assertSession()->pageTextNotContains('Status');
 
     // The latest version page should not show, because there is still no
     // pending revision.
@@ -230,7 +230,7 @@ public function testNonBundleModerationForm() {
     // default revision.
     $this->drupalGet('entity_test_mulrevpub/manage/1');
     $this->assertSession()->statusCodeEquals(200);
-    $this->assertNoText('Status');
+    $this->assertSession()->pageTextNotContains('Status');
 
     // The latest version page should show the moderation form and have "Draft"
     // status, because the pending revision is in "Draft".
diff --git a/core/modules/content_moderation/tests/src/Functional/ModerationStateNodeTest.php b/core/modules/content_moderation/tests/src/Functional/ModerationStateNodeTest.php
index ab8ed697f4eb0c67a8da2403ec012942097ee3fa..6b39d4ea67f4b5dcd9c333d68592cfccd3669853 100644
--- a/core/modules/content_moderation/tests/src/Functional/ModerationStateNodeTest.php
+++ b/core/modules/content_moderation/tests/src/Functional/ModerationStateNodeTest.php
@@ -53,7 +53,7 @@ public function testCreatingContent() {
     $this->assertEquals('published', $node->moderation_state->value);
 
     // Verify that the state field is not shown.
-    $this->assertNoText('Published');
+    $this->assertSession()->pageTextNotContains('Published');
 
     // Delete the node.
     $this->drupalGet('node/' . $node->id() . '/delete');
diff --git a/core/modules/content_moderation/tests/src/Functional/WorkspaceContentModerationIntegrationTest.php b/core/modules/content_moderation/tests/src/Functional/WorkspaceContentModerationIntegrationTest.php
index 9ee3d2434e747a53f4a201accb69ca5ddf29c686..4a292e5f9c66e559548823aae82f673ecbb453b5 100644
--- a/core/modules/content_moderation/tests/src/Functional/WorkspaceContentModerationIntegrationTest.php
+++ b/core/modules/content_moderation/tests/src/Functional/WorkspaceContentModerationIntegrationTest.php
@@ -67,8 +67,8 @@ public function testModerationInWorkspace() {
     // Check that neither of them are visible in Live.
     $this->switchToLive();
     $this->drupalGet('<front>');
-    $this->assertNoText('First article');
-    $this->assertNoText('Second article');
+    $this->assertSession()->pageTextNotContains('First article');
+    $this->assertSession()->pageTextNotContains('Second article');
 
     // Switch back to Stage.
     $this->switchToWorkspace($stage);
diff --git a/core/modules/content_translation/tests/src/Functional/ContentTranslationSettingsTest.php b/core/modules/content_translation/tests/src/Functional/ContentTranslationSettingsTest.php
index 91ec56987aa6659c132182e4edb7590d9476721f..8a0ac44701ff938dbf4aed2b1160b6fbecc1ae33 100644
--- a/core/modules/content_translation/tests/src/Functional/ContentTranslationSettingsTest.php
+++ b/core/modules/content_translation/tests/src/Functional/ContentTranslationSettingsTest.php
@@ -302,7 +302,7 @@ public function testFieldTranslatableSettingsUI() {
     $this->drupalGet($path);
     $this->assertSession()->fieldEnabled('edit-translatable');
     $this->assertSession()->checkboxChecked('edit-translatable');
-    $this->assertNoText('To enable translation of this field, enable language support for this type.');
+    $this->assertSession()->pageTextNotContains('To enable translation of this field, enable language support for this type.');
   }
 
   /**
diff --git a/core/modules/content_translation/tests/src/Functional/ContentTranslationUITestBase.php b/core/modules/content_translation/tests/src/Functional/ContentTranslationUITestBase.php
index ea90c595f5b8d151e202adef3074c96d5f4a88a4..c0e6b5837c489dc1cc78156d734a70ccaa137fcd 100644
--- a/core/modules/content_translation/tests/src/Functional/ContentTranslationUITestBase.php
+++ b/core/modules/content_translation/tests/src/Functional/ContentTranslationUITestBase.php
@@ -90,7 +90,7 @@ protected function doTestBasicTranslation() {
     $this->assertCacheContexts($this->defaultCacheContexts);
 
     $this->drupalGet($entity->toUrl('drupal:content-translation-overview'));
-    $this->assertNoText('Source language');
+    $this->assertSession()->pageTextNotContains('Source language');
 
     $translation = $this->getTranslation($entity, $default_langcode);
     foreach ($values[$default_langcode] as $property => $value) {
@@ -164,7 +164,7 @@ protected function doTestBasicTranslation() {
     $storage->resetCache([$this->entityId]);
     $entity = $storage->load($this->entityId);
     $this->drupalGet($entity->toUrl('drupal:content-translation-overview'));
-    $this->assertNoText('Source language');
+    $this->assertSession()->pageTextNotContains('Source language');
 
     // Switch the source language.
     $langcode = 'fr';
diff --git a/core/modules/field/tests/src/Functional/Boolean/BooleanFieldTest.php b/core/modules/field/tests/src/Functional/Boolean/BooleanFieldTest.php
index 8d33d364e9a429e831adcec5324e5ec5b9dd1b8c..ef4efa8774296536a2335bde9e9d9daf33e6999f 100644
--- a/core/modules/field/tests/src/Functional/Boolean/BooleanFieldTest.php
+++ b/core/modules/field/tests/src/Functional/Boolean/BooleanFieldTest.php
@@ -137,7 +137,7 @@ public function testBooleanField() {
     $this->drupalGet('entity_test/add');
     $this->assertSession()->fieldValueEquals("{$field_name}[value]", '');
     $this->assertRaw($on);
-    $this->assertNoText($this->field->label());
+    $this->assertSession()->pageTextNotContains($this->field->label());
 
     // Test if we can change the on label.
     $on = $this->randomMachineName();
diff --git a/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceFieldTranslatedReferenceViewTest.php b/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceFieldTranslatedReferenceViewTest.php
index 51e633cb472790d86d770896beac88e4871f0fd2..58b51dc7e0b7c76542f96acd28fcda049609784a 100644
--- a/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceFieldTranslatedReferenceViewTest.php
+++ b/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceFieldTranslatedReferenceViewTest.php
@@ -183,10 +183,10 @@ protected function assertEntityReferenceDisplay() {
     $this->drupalGet($url);
     $this->assertSession()->pageTextContains($this->labelOfNotTranslatedReference);
     $this->assertSession()->pageTextContains($this->originalLabel);
-    $this->assertNoText($this->translatedLabel);
+    $this->assertSession()->pageTextNotContains($this->translatedLabel);
     $this->drupalGet($translation_url);
     $this->assertSession()->pageTextContains($this->labelOfNotTranslatedReference);
-    $this->assertNoText($this->originalLabel);
+    $this->assertSession()->pageTextNotContains($this->originalLabel);
     $this->assertSession()->pageTextContains($this->translatedLabel);
   }
 
diff --git a/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceXSSTest.php b/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceXSSTest.php
index 2f001036033886efefb61432321d5094f08930c3..e45a903dad362617dfc4a3ca462c6e9c465d9c79 100644
--- a/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceXSSTest.php
+++ b/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceXSSTest.php
@@ -77,7 +77,7 @@ public function testEntityReferenceXSS() {
     $this->drupalGet('node/add/article');
     $this->assertSession()->assertEscaped($referenced_node->getTitle());
     // options_buttons does not support optgroups.
-    $this->assertNoText('bundle with markup');
+    $this->assertSession()->pageTextNotContains('bundle with markup');
   }
 
 }
diff --git a/core/modules/field/tests/src/Functional/FieldAccessTest.php b/core/modules/field/tests/src/Functional/FieldAccessTest.php
index ee3a469419f2da67e800dc887edc9b7e93ed2ac6..d96eb4f681a392f94ffd907b6c0f4caf89ada4ae 100644
--- a/core/modules/field/tests/src/Functional/FieldAccessTest.php
+++ b/core/modules/field/tests/src/Functional/FieldAccessTest.php
@@ -92,7 +92,7 @@ public function testFieldAccess() {
     // specifically target the 'test_view_field' field.
     $this->drupalLogout();
     $this->drupalGet('node/' . $this->node->id());
-    $this->assertNoText($this->testViewFieldValue);
+    $this->assertSession()->pageTextNotContains($this->testViewFieldValue);
   }
 
 }
diff --git a/core/modules/field/tests/src/Functional/FieldImportDeleteUninstallUiTest.php b/core/modules/field/tests/src/Functional/FieldImportDeleteUninstallUiTest.php
index c2f9a51ba24d8662d35759c15f63c477d7128f14..38ed9b0d7fa6704f1de7b614007b2f63b93ff8a4 100644
--- a/core/modules/field/tests/src/Functional/FieldImportDeleteUninstallUiTest.php
+++ b/core/modules/field/tests/src/Functional/FieldImportDeleteUninstallUiTest.php
@@ -117,7 +117,7 @@ public function testImportDeleteUninstall() {
     // This will purge all the data, delete the field and uninstall the
     // Telephone and Text modules.
     $this->submitForm([], 'Import all');
-    $this->assertNoText('Field data will be deleted by this synchronization.');
+    $this->assertSession()->pageTextNotContains('Field data will be deleted by this synchronization.');
     $this->rebuildContainer();
     $this->assertFalse(\Drupal::moduleHandler()->moduleExists('telephone'));
     $this->assertNull(\Drupal::service('entity.repository')->loadEntityByUuid('field_storage_config', $field_storage->uuid()), 'The telephone field has been deleted by the configuration synchronization');
diff --git a/core/modules/field/tests/src/Functional/FormTest.php b/core/modules/field/tests/src/Functional/FormTest.php
index c1eeb7f2f16ceb2faab5fd5b8e5706b9cfafcd1a..ed5e9983530edf1c22ff6bc0b1b92cf17138031e 100644
--- a/core/modules/field/tests/src/Functional/FormTest.php
+++ b/core/modules/field/tests/src/Functional/FormTest.php
@@ -128,10 +128,10 @@ public function testFieldFormSingle() {
 
     // Check that hook_field_widget_single_element_form_alter() does not believe
     // this is the default value form.
-    $this->assertNoText('From hook_field_widget_single_element_form_alter(): Default form is true.');
+    $this->assertSession()->pageTextNotContains('From hook_field_widget_single_element_form_alter(): Default form is true.');
     // Check that hook_field_widget_single_element_form_alter() does not believe
     // this is the default value form.
-    $this->assertNoText('From hook_field_widget_complete_form_alter(): Default form is true.');
+    $this->assertSession()->pageTextNotContains('From hook_field_widget_complete_form_alter(): Default form is true.');
 
     // Submit with invalid value (field-level validation).
     $edit = [
diff --git a/core/modules/field/tests/src/Functional/ReEnableModuleFieldTest.php b/core/modules/field/tests/src/Functional/ReEnableModuleFieldTest.php
index 0225e4ff91d543418ea0848696a96b67c647b295..7c30d465e5fd11c040569b845b55a1e80c0a9248 100644
--- a/core/modules/field/tests/src/Functional/ReEnableModuleFieldTest.php
+++ b/core/modules/field/tests/src/Functional/ReEnableModuleFieldTest.php
@@ -129,8 +129,8 @@ public function testReEnabledField() {
     $this->drupalGet('admin/modules/uninstall');
     $this->assertSession()->pageTextContains('Fields pending deletion');
     $this->cronRun();
-    $this->assertNoText("The Telephone number field type is used in the following field: node.field_telephone");
-    $this->assertNoText('Fields pending deletion');
+    $this->assertSession()->pageTextNotContains("The Telephone number field type is used in the following field: node.field_telephone");
+    $this->assertSession()->pageTextNotContains('Fields pending deletion');
   }
 
 }
diff --git a/core/modules/field_ui/tests/src/Functional/FieldUIDeleteTest.php b/core/modules/field_ui/tests/src/Functional/FieldUIDeleteTest.php
index 1feba737135e3283c8f9770f3cc91ce9d609d07e..00746fc6e41a9d8de62465074ae196d6e750ae1f 100644
--- a/core/modules/field_ui/tests/src/Functional/FieldUIDeleteTest.php
+++ b/core/modules/field_ui/tests/src/Functional/FieldUIDeleteTest.php
@@ -107,9 +107,9 @@ public function testDeleteField() {
     // Check the config dependencies of the first field, the field storage must
     // not be shown as being deleted yet.
     $this->drupalGet("$bundle_path1/fields/node.$type_name1.$field_name/delete");
-    $this->assertNoText('The listed configuration will be deleted.');
-    $this->assertNoText('View');
-    $this->assertNoText('test_view_field_delete');
+    $this->assertSession()->pageTextNotContains('The listed configuration will be deleted.');
+    $this->assertSession()->elementNotExists('xpath', '//ul[@data-drupal-selector="edit-view"]');
+    $this->assertSession()->pageTextNotContains('test_view_field_delete');
 
     // Delete the first field.
     $this->fieldUIDeleteField($bundle_path1, "node.$type_name1.$field_name", $field_label, $type_name1);
@@ -122,8 +122,7 @@ public function testDeleteField() {
     // Check the config dependencies of the first field.
     $this->drupalGet("$bundle_path2/fields/node.$type_name2.$field_name/delete");
     $this->assertSession()->pageTextContains('The listed configuration will be updated.');
-    $this->assertSession()->pageTextContains('View');
-    $this->assertSession()->pageTextContains('test_view_field_delete');
+    $this->assertSession()->elementTextEquals('xpath', '//ul[@data-drupal-selector="edit-view"]', 'test_view_field_delete');
 
     $xml = $this->cssSelect('#edit-entity-deletes');
     // Test that nothing is scheduled for deletion.
diff --git a/core/modules/field_ui/tests/src/Functional/ManageDisplayTest.php b/core/modules/field_ui/tests/src/Functional/ManageDisplayTest.php
index 8397d28d0c59b76b3bd21a3e5b034d21cdb11aa6..b64ca43fb7697aa787f7e6e9cc9bab28cdb1c202 100644
--- a/core/modules/field_ui/tests/src/Functional/ManageDisplayTest.php
+++ b/core/modules/field_ui/tests/src/Functional/ManageDisplayTest.php
@@ -193,7 +193,7 @@ public function testNonInitializedFields() {
    */
   public function testSingleViewMode() {
     $this->drupalGet('admin/structure/taxonomy/manage/' . $this->vocabulary . '/display');
-    $this->assertNoText('Use custom display settings for the following view modes');
+    $this->assertSession()->pageTextNotContains('Use custom display settings for the following view modes');
 
     // This may not trigger a notice when 'view_modes_custom' isn't available.
     $this->drupalGet('admin/structure/taxonomy/manage/' . $this->vocabulary . '/overview/display');
diff --git a/core/modules/file/tests/src/Functional/FileFieldAnonymousSubmissionTest.php b/core/modules/file/tests/src/Functional/FileFieldAnonymousSubmissionTest.php
index af12289bbc2e51ec180b41d1d47b3304fadd6e88..3fada0cc8d6a5e1d8eda92847c609eb1506829a7 100644
--- a/core/modules/file/tests/src/Functional/FileFieldAnonymousSubmissionTest.php
+++ b/core/modules/file/tests/src/Functional/FileFieldAnonymousSubmissionTest.php
@@ -148,7 +148,7 @@ protected function doTestNodeWithFileWithoutTitle() {
     $this->submitForm($edit, $label);
     $this->assertSession()->statusCodeEquals(200);
     $t_args = ['@type' => $bundle_label, '%title' => $node_title];
-    $this->assertNoText(strip_tags(t('@type %title has been created.', $t_args)));
+    $this->assertSession()->pageTextNotContains(strip_tags(t('@type %title has been created.', $t_args)));
     $this->assertSession()->pageTextContains('Title field is required.');
 
     // Submit the form again but this time with the missing title field. This
diff --git a/core/modules/file/tests/src/Functional/FileFieldDisplayTest.php b/core/modules/file/tests/src/Functional/FileFieldDisplayTest.php
index ec960527e238d4d0e95090044b50a0be20d348bf..4299fff0410e3567156be4a0f0c55edf86ca9469 100644
--- a/core/modules/file/tests/src/Functional/FileFieldDisplayTest.php
+++ b/core/modules/file/tests/src/Functional/FileFieldDisplayTest.php
@@ -57,7 +57,7 @@ public function testNodeDisplay() {
       $this->submitForm($edit, 'Save');
       $this->drupalGet('node/' . $node->id());
       // Verify that the field label is hidden when no file is attached.
-      $this->assertNoText($field_name);
+      $this->assertSession()->pageTextNotContains($field_name);
     }
 
     $this->generateFile('escaped-&-text', 64, 10, 'text');
diff --git a/core/modules/file/tests/src/Functional/FileFieldValidateTest.php b/core/modules/file/tests/src/Functional/FileFieldValidateTest.php
index fc16645a984a628e4d27911827d6e13b2a04f951..97884b6a8b7d8eeab4a16c097d32303da11ae54e 100644
--- a/core/modules/file/tests/src/Functional/FileFieldValidateTest.php
+++ b/core/modules/file/tests/src/Functional/FileFieldValidateTest.php
@@ -191,7 +191,7 @@ public function testFileRemoval() {
 
     // Check that the file can still be removed.
     $this->removeNodeFile($nid);
-    $this->assertNoText('Only files with the following extensions are allowed: txt.');
+    $this->assertSession()->pageTextNotContains('Only files with the following extensions are allowed: txt.');
     $this->assertSession()->pageTextContains('Article ' . $node->getTitle() . ' has been updated.');
   }
 
diff --git a/core/modules/file/tests/src/Functional/FileManagedFileElementTest.php b/core/modules/file/tests/src/Functional/FileManagedFileElementTest.php
index 95cce218c77a9a876707c5b822a8f8f2898dd6f8..91390dc165fab7b159d51caa776043bd021e1f60 100644
--- a/core/modules/file/tests/src/Functional/FileManagedFileElementTest.php
+++ b/core/modules/file/tests/src/Functional/FileManagedFileElementTest.php
@@ -215,7 +215,7 @@ public function testUnusedPermanentFileValidation() {
     // allowed to reference an unused file.
     $this->drupalGet('file/test/1/0/1/' . $file->id());
     $this->submitForm([], 'Save');
-    $this->assertNoText('The file used in the Managed file &amp; butter field may not be referenced.');
+    $this->assertSession()->pageTextNotContains('The file used in the Managed file & butter field may not be referenced.');
     $this->assertSession()->pageTextContains('The file ids are ' . $file->id());
 
     // Enable marking unused files as temporary, unused permanent files must not
@@ -226,7 +226,7 @@ public function testUnusedPermanentFileValidation() {
     $this->drupalGet('file/test/1/0/1/' . $file->id());
     $this->submitForm([], 'Save');
     $this->assertSession()->pageTextContains('The file used in the Managed file & butter field may not be referenced.');
-    $this->assertNoText('The file ids are ' . $file->id());
+    $this->assertSession()->pageTextNotContains('The file ids are ' . $file->id());
 
     // Make the file temporary, now using it is allowed.
     $file->setTemporary();
@@ -234,7 +234,7 @@ public function testUnusedPermanentFileValidation() {
 
     $this->drupalGet('file/test/1/0/1/' . $file->id());
     $this->submitForm([], 'Save');
-    $this->assertNoText('The file used in the Managed file &amp; butter field may not be referenced.');
+    $this->assertSession()->pageTextNotContains('The file used in the Managed file & butter field may not be referenced.');
     $this->assertSession()->pageTextContains('The file ids are ' . $file->id());
 
     // Make the file permanent again and add a usage from itself, referencing is
@@ -248,7 +248,7 @@ public function testUnusedPermanentFileValidation() {
 
     $this->drupalGet('file/test/1/0/1/' . $file->id());
     $this->submitForm([], 'Save');
-    $this->assertNoText('The file used in the Managed file &amp; butter field may not be referenced.');
+    $this->assertSession()->pageTextNotContains('The file used in the Managed file & butter field may not be referenced.');
     $this->assertSession()->pageTextContains('The file ids are ' . $file->id());
   }
 
diff --git a/core/modules/file/tests/src/Functional/SaveUploadFormTest.php b/core/modules/file/tests/src/Functional/SaveUploadFormTest.php
index 9c0e7f5e193f3267e393bd34c84da7b458047449..82646348e6c5e03c04788d6c053de8450e324e58 100644
--- a/core/modules/file/tests/src/Functional/SaveUploadFormTest.php
+++ b/core/modules/file/tests/src/Functional/SaveUploadFormTest.php
@@ -536,7 +536,7 @@ public function testErrorMessagesAreNotChanged() {
 
     // Ensure the error message is not present and the counts before and after
     // calling _file_save_upload_from_form() are correct.
-    $this->assertNoText($error);
+    $this->assertSession()->pageTextNotContains($error);
     $this->assertRaw('Number of error messages before _file_save_upload_from_form(): 0');
     $this->assertRaw('Number of error messages after _file_save_upload_from_form(): 0');
   }
diff --git a/core/modules/filter/tests/src/Functional/FilterAdminTest.php b/core/modules/filter/tests/src/Functional/FilterAdminTest.php
index 84a2f4daec423e887ee174259fa97b02aecb998a..2643881ab0f9942989088d8d15cf82fd08e0182c 100644
--- a/core/modules/filter/tests/src/Functional/FilterAdminTest.php
+++ b/core/modules/filter/tests/src/Functional/FilterAdminTest.php
@@ -457,7 +457,7 @@ public function testDisabledFormat() {
     $this->drupalGet($node->toUrl());
 
     // The format is not used anymore.
-    $this->assertNoText('filtered text');
+    $this->assertSession()->pageTextNotContains('filtered text');
     // The text is not displayed unfiltered or escaped.
     $this->assertNoRaw($body_value);
     $this->assertSession()->assertNoEscaped($body_value);
diff --git a/core/modules/filter/tests/src/Functional/FilterFormatAccessTest.php b/core/modules/filter/tests/src/Functional/FilterFormatAccessTest.php
index 4d2284b80256e23b16a936cd91f98cde0c7909e2..f3c513b2373eefeb795c4fee2d7fbf94303d0277 100644
--- a/core/modules/filter/tests/src/Functional/FilterFormatAccessTest.php
+++ b/core/modules/filter/tests/src/Functional/FilterFormatAccessTest.php
@@ -241,7 +241,7 @@ public function testFormatWidgetPermissions() {
     // Save and verify that only the title was changed.
     $this->drupalGet('node/' . $node->id() . '/edit');
     $this->submitForm($new_edit, 'Save');
-    $this->assertNoText($edit['title[0][value]']);
+    $this->assertSession()->pageTextNotContains($edit['title[0][value]']);
     $this->assertSession()->pageTextContains($new_edit['title[0][value]']);
     $this->assertSession()->pageTextContains($edit[$body_value_key]);
 
@@ -285,7 +285,7 @@ public function testFormatWidgetPermissions() {
     $this->assertSession()->pageTextContains('Text format field is required.');
     $this->drupalGet('node/' . $node->id());
     $this->assertSession()->pageTextContains($old_title);
-    $this->assertNoText($new_title);
+    $this->assertSession()->pageTextNotContains($new_title);
 
     // Now select a new text format and make sure the node can be saved.
     $edit[$body_format_key] = filter_fallback_format();
@@ -293,7 +293,7 @@ public function testFormatWidgetPermissions() {
     $this->submitForm($edit, 'Save');
     $this->assertSession()->addressEquals('node/' . $node->id());
     $this->assertSession()->pageTextContains($new_title);
-    $this->assertNoText($old_title);
+    $this->assertSession()->pageTextNotContains($old_title);
 
     // Switch the text format to a new one, then disable that format and all
     // other formats on the site (leaving only the fallback format).
@@ -323,13 +323,13 @@ public function testFormatWidgetPermissions() {
     $this->assertSession()->pageTextContains('Text format field is required.');
     $this->drupalGet('node/' . $node->id());
     $this->assertSession()->pageTextContains($old_title);
-    $this->assertNoText($new_title);
+    $this->assertSession()->pageTextNotContains($new_title);
     $edit[$body_format_key] = filter_fallback_format();
     $this->drupalGet('node/' . $node->id() . '/edit');
     $this->submitForm($edit, 'Save');
     $this->assertSession()->addressEquals('node/' . $node->id());
     $this->assertSession()->pageTextContains($new_title);
-    $this->assertNoText($old_title);
+    $this->assertSession()->pageTextNotContains($old_title);
   }
 
   /**
diff --git a/core/modules/filter/tests/src/Functional/FilterSecurityTest.php b/core/modules/filter/tests/src/Functional/FilterSecurityTest.php
index 3d8edb2af94af2816d0e02e962de95119eddceb7..76433f854f93a75ae90480d24bc953de64ef0913 100644
--- a/core/modules/filter/tests/src/Functional/FilterSecurityTest.php
+++ b/core/modules/filter/tests/src/Functional/FilterSecurityTest.php
@@ -77,7 +77,7 @@ public function testDisableFilterModule() {
 
     // Verify that filter_test_replace filter replaced the content.
     $this->drupalGet('node/' . $node->id());
-    $this->assertNoText($body_raw);
+    $this->assertSession()->pageTextNotContains($body_raw);
     $this->assertSession()->pageTextContains('Filter: Testing filter');
 
     // Disable the text format entirely.
@@ -86,7 +86,7 @@ public function testDisableFilterModule() {
 
     // Verify that the content is empty, because the text format does not exist.
     $this->drupalGet('node/' . $node->id());
-    $this->assertNoText($body_raw);
+    $this->assertSession()->pageTextNotContains($body_raw);
   }
 
   /**
diff --git a/core/modules/forum/tests/src/Functional/ForumBlockTest.php b/core/modules/forum/tests/src/Functional/ForumBlockTest.php
index 01084cfcc085cfe6d65d973552aa0dc967692e68..426ddc4fcd227739cdf3ea60e414f52e25c389ef 100644
--- a/core/modules/forum/tests/src/Functional/ForumBlockTest.php
+++ b/core/modules/forum/tests/src/Functional/ForumBlockTest.php
@@ -78,7 +78,7 @@ public function testNewForumTopicsBlock() {
         $this->assertSession()->linkExists($topics[$index], 0, new FormattableMarkup('Forum topic @topic found in the "New forum topics" block.', ['@topic' => $topics[$index]]));
       }
       else {
-        $this->assertNoText($topics[$index]);
+        $this->assertSession()->pageTextNotContains($topics[$index]);
       }
     }
   }
@@ -124,7 +124,7 @@ public function testActiveForumTopicsBlock() {
         $this->assertSession()->linkExists($topics[$index], 0, new FormattableMarkup('Forum topic @topic found in the "Active forum topics" block.', ['@topic' => $topics[$index]]));
       }
       else {
-        $this->assertNoText($topics[$index]);
+        $this->assertSession()->pageTextNotContains($topics[$index]);
       }
     }
 
@@ -141,7 +141,7 @@ public function testActiveForumTopicsBlock() {
         $this->assertSession()->linkExists($topics[$index], 0, 'Forum topic found in the "Active forum topics" block.');
       }
       else {
-        $this->assertNoText($topics[$index]);
+        $this->assertSession()->pageTextNotContains($topics[$index]);
       }
     }
   }
diff --git a/core/modules/forum/tests/src/Functional/ForumIndexTest.php b/core/modules/forum/tests/src/Functional/ForumIndexTest.php
index cdc7a71d7611b277c3f3716197c72d2ad36704d9..d90c73d31ce64e21557c27d24c3ee12e5292b9af 100644
--- a/core/modules/forum/tests/src/Functional/ForumIndexTest.php
+++ b/core/modules/forum/tests/src/Functional/ForumIndexTest.php
@@ -92,7 +92,7 @@ public function testForumIndexStatus() {
 
     // Verify that the node no longer appears on the index.
     $this->drupalGet('forum/' . $tid);
-    $this->assertNoText($title);
+    $this->assertSession()->pageTextNotContains($title);
   }
 
 }
diff --git a/core/modules/forum/tests/src/Functional/ForumNodeAccessTest.php b/core/modules/forum/tests/src/Functional/ForumNodeAccessTest.php
index 50b29e1502fea3958b738df3de5db79254e43322..1ca15cb687c757e5432b9459fc698fcea771b3ee 100644
--- a/core/modules/forum/tests/src/Functional/ForumNodeAccessTest.php
+++ b/core/modules/forum/tests/src/Functional/ForumNodeAccessTest.php
@@ -98,7 +98,7 @@ public function testForumNodeAccess() {
     $this->drupalGet('');
 
     // Ensure private node is not found but public is found.
-    $this->assertNoText($private_node->getTitle());
+    $this->assertSession()->pageTextNotContains($private_node->getTitle());
     $this->assertSession()->pageTextContains($public_node->getTitle());
   }
 
diff --git a/core/modules/forum/tests/src/Functional/ForumTest.php b/core/modules/forum/tests/src/Functional/ForumTest.php
index eb212ad92a947c7007b9d0a36c894f853f4184fd..9a1847a2fee3d1f79cab1e5642d879b6cfd5c053 100644
--- a/core/modules/forum/tests/src/Functional/ForumTest.php
+++ b/core/modules/forum/tests/src/Functional/ForumTest.php
@@ -491,8 +491,8 @@ public function deleteForum($tid) {
     $this->drupalGet('admin/structure/forum/edit/forum/' . $tid);
     $this->clickLink('Delete');
     $this->assertSession()->pageTextContains('Are you sure you want to delete the forum');
-    $this->assertNoText('Add forum');
-    $this->assertNoText('Add forum container');
+    $this->assertSession()->pageTextNotContains('Add forum');
+    $this->assertSession()->pageTextNotContains('Add forum container');
     $this->submitForm([], 'Delete');
 
     // Assert that the forum no longer exists.
@@ -585,7 +585,7 @@ public function createForumTopic($forum, $container = FALSE) {
 
     $type = t('Forum topic');
     if ($container) {
-      $this->assertNoText("$type $title has been created.");
+      $this->assertSession()->pageTextNotContains("$type $title has been created.");
       $this->assertRaw(t('The item %title is a forum container, not a forum.', ['%title' => $forum['name']]));
       return;
     }
diff --git a/core/modules/help/tests/src/Functional/ExperimentalHelpTest.php b/core/modules/help/tests/src/Functional/ExperimentalHelpTest.php
index 502557bb7365460d27d9db145d4115d5031832ba..b451ae62f5b4813d0577d50352e892a10e0b791c 100644
--- a/core/modules/help/tests/src/Functional/ExperimentalHelpTest.php
+++ b/core/modules/help/tests/src/Functional/ExperimentalHelpTest.php
@@ -55,7 +55,7 @@ public function testExperimentalHelp() {
 
     // Regular modules should not display the message.
     $this->drupalGet('admin/help/help_page_test');
-    $this->assertNoText('This module is experimental.');
+    $this->assertSession()->pageTextNotContains('This module is experimental.');
 
     // Ensure the actual help page is displayed to avoid a false positive.
     $this->assertSession()->statusCodeEquals(200);
diff --git a/core/modules/help/tests/src/Functional/HelpBlockTest.php b/core/modules/help/tests/src/Functional/HelpBlockTest.php
index 4e56e40f626e1cf09ff568fc489fbe862d95453a..590d45cccba86e6c0326b067b06cc2318b313c03 100644
--- a/core/modules/help/tests/src/Functional/HelpBlockTest.php
+++ b/core/modules/help/tests/src/Functional/HelpBlockTest.php
@@ -48,7 +48,7 @@ public function testHelp() {
 
     $this->drupalGet('help_page_test/no_help');
     // The help block should not appear when there is no help.
-    $this->assertNoText($this->helpBlock->label());
+    $this->assertSession()->pageTextNotContains($this->helpBlock->label());
 
     // Ensure that if two hook_help() implementations both return a render array
     // the output is as expected.
diff --git a/core/modules/help/tests/src/Functional/HelpTest.php b/core/modules/help/tests/src/Functional/HelpTest.php
index 05eac025809cde74eee064fcdb3d9cc6f7a6455e..9e0e14c96ad2c2899fd83f456a5080704c5c4030 100644
--- a/core/modules/help/tests/src/Functional/HelpTest.php
+++ b/core/modules/help/tests/src/Functional/HelpTest.php
@@ -123,7 +123,7 @@ protected function verifyHelp($response = 200) {
       $this->assertSession()->pageTextContains('This page shows you all available administration tasks for each module.');
     }
     else {
-      $this->assertNoText('This page shows you all available administration tasks for each module.');
+      $this->assertSession()->pageTextNotContains('This page shows you all available administration tasks for each module.');
     }
 
     foreach ($this->getModuleList() as $module => $name) {
diff --git a/core/modules/help/tests/src/Functional/NoHelpTest.php b/core/modules/help/tests/src/Functional/NoHelpTest.php
index 1201f474358104dd7d2958a4c83ded854a583473..8d343f096dec39dc8beb57b264c1a14a6fd04ae7 100644
--- a/core/modules/help/tests/src/Functional/NoHelpTest.php
+++ b/core/modules/help/tests/src/Functional/NoHelpTest.php
@@ -47,7 +47,7 @@ public function testMainPageNoHelp() {
     $this->assertFalse(\Drupal::moduleHandler()->implementsHook('menu_test', 'help'), 'The menu_test module does not implement hook_help');
     // Make sure the test module menu_test does not display a help link on
     // admin/help.
-    $this->assertNoText(\Drupal::moduleHandler()->getName('menu_test'));
+    $this->assertSession()->pageTextNotContains(\Drupal::moduleHandler()->getName('menu_test'));
 
     // Ensure that the module overview help page for a module that does not
     // implement hook_help() results in a 404.
diff --git a/core/modules/image/tests/src/Functional/ImageAdminStylesTest.php b/core/modules/image/tests/src/Functional/ImageAdminStylesTest.php
index 875135057e029ce637f9db2fd5f494d1d5d6f2e0..32ea357ba9553d6b99df589b5b7bf8a209802546 100644
--- a/core/modules/image/tests/src/Functional/ImageAdminStylesTest.php
+++ b/core/modules/image/tests/src/Functional/ImageAdminStylesTest.php
@@ -397,7 +397,7 @@ public function testEditEffect() {
     $this->assertSession()->pageTextContains('Scale and crop 360×240');
 
     // Check that the previous effect is replaced.
-    $this->assertNoText('Scale and crop 300×200');
+    $this->assertSession()->pageTextNotContains('Scale and crop 300×200');
 
     // Add another scale effect.
     $this->drupalGet('admin/config/media/image-styles/add');
diff --git a/core/modules/image/tests/src/Functional/ImageFieldValidateTest.php b/core/modules/image/tests/src/Functional/ImageFieldValidateTest.php
index cbb47a56057e3e7cc0fa645a12ac4abed6428954..3f63813f59f879255086e2a6afe06dc829ab4fba 100644
--- a/core/modules/image/tests/src/Functional/ImageFieldValidateTest.php
+++ b/core/modules/image/tests/src/Functional/ImageFieldValidateTest.php
@@ -197,8 +197,8 @@ public function testRequiredAttributes() {
     $this->drupalGet('node/add/article');
     $this->submitForm($edit, 'Save');
 
-    $this->assertNoText('Alternative text field is required.');
-    $this->assertNoText('Title field is required.');
+    $this->assertSession()->pageTextNotContains('Alternative text field is required.');
+    $this->assertSession()->pageTextNotContains('Title field is required.');
 
     $instance->setSetting('required', 0);
     $instance->setSetting('alt_field_required', 1);
@@ -211,8 +211,8 @@ public function testRequiredAttributes() {
     $this->drupalGet('node/add/article');
     $this->submitForm($edit, 'Save');
 
-    $this->assertNoText('Alternative text field is required.');
-    $this->assertNoText('Title field is required.');
+    $this->assertSession()->pageTextNotContains('Alternative text field is required.');
+    $this->assertSession()->pageTextNotContains('Title field is required.');
   }
 
   /**
diff --git a/core/modules/image/tests/src/Functional/ImageFieldWidgetTest.php b/core/modules/image/tests/src/Functional/ImageFieldWidgetTest.php
index b60b1d4c11bc9ede12ec2ff42ba7dcfd6673b379..fb25470433f8f080fd68e5b611a6ada3bc73e03e 100644
--- a/core/modules/image/tests/src/Functional/ImageFieldWidgetTest.php
+++ b/core/modules/image/tests/src/Functional/ImageFieldWidgetTest.php
@@ -35,7 +35,7 @@ public function testWidgetElement() {
     $this->assertSession()->elementExists('xpath', '//div[contains(@class, "field--widget-image-image")]');
     // Verify that the image field widget limits accepted files.
     $this->assertSession()->elementExists('xpath', '//input[contains(@accept, "image/*")]');
-    $this->assertNoText('Image test on [site:name]');
+    $this->assertSession()->pageTextNotContains('Image test on [site:name]');
 
     // Check for allowed image file extensions - default.
     $this->assertSession()->pageTextContains('Allowed types: png gif jpg jpeg.');
diff --git a/core/modules/language/tests/src/Functional/LanguageConfigurationTest.php b/core/modules/language/tests/src/Functional/LanguageConfigurationTest.php
index 2e0292da0ac5e74992162a00c755d59b07a3dc19..31db7e47af5cac2f72256522eea98e9ef936c28b 100644
--- a/core/modules/language/tests/src/Functional/LanguageConfigurationTest.php
+++ b/core/modules/language/tests/src/Functional/LanguageConfigurationTest.php
@@ -101,7 +101,7 @@ public function testLanguageConfiguration() {
       'prefix[fr]' => '',
     ];
     $this->submitForm($edit, 'Save configuration');
-    $this->assertNoText('The prefix may only be left blank for the selected detection fallback language.');
+    $this->assertSession()->pageTextNotContains('The prefix may only be left blank for the selected detection fallback language.');
 
     // Change default negotiation language.
     $this->config('language.negotiation')->set('selected_langcode', 'fr')->save();
diff --git a/core/modules/link/tests/src/Functional/LinkFieldTest.php b/core/modules/link/tests/src/Functional/LinkFieldTest.php
index 2bc8656d2274ac97a7477212ec4f4dfa2859c3db..c6712dbec0c3e7abba28635dad7c46fe2349061a 100644
--- a/core/modules/link/tests/src/Functional/LinkFieldTest.php
+++ b/core/modules/link/tests/src/Functional/LinkFieldTest.php
@@ -327,7 +327,7 @@ public function testLinkTitle() {
             "{$field_name}[0][uri]" => '',
           ];
           $this->submitForm($edit, 'Save');
-          $this->assertNoText('Link text field is required.');
+          $this->assertSession()->pageTextNotContains('Link text field is required.');
 
           // Verify that a URL and link text meets requirements.
           $this->drupalGet('entity_test/add');
@@ -336,7 +336,7 @@ public function testLinkTitle() {
             "{$field_name}[0][title]" => 'Example',
           ];
           $this->submitForm($edit, 'Save');
-          $this->assertNoText('Link text field is required.');
+          $this->assertSession()->pageTextNotContains('Link text field is required.');
         }
       }
     }
diff --git a/core/modules/locale/tests/src/Functional/LocaleImportFunctionalTest.php b/core/modules/locale/tests/src/Functional/LocaleImportFunctionalTest.php
index 902e080cea2f3c22348a960390d5c6d86f080bda..8b666737d6e75e2f7dac82b296c1ed132800e089 100644
--- a/core/modules/locale/tests/src/Functional/LocaleImportFunctionalTest.php
+++ b/core/modules/locale/tests/src/Functional/LocaleImportFunctionalTest.php
@@ -188,7 +188,7 @@ public function testStandalonePoFile() {
     ];
     $this->drupalGet('admin/config/regional/translate');
     $this->submitForm($search, 'Filter');
-    $this->assertNoText('No strings available.');
+    $this->assertSession()->pageTextNotContains('No strings available.');
     // This import should have changed number of plural forms.
     $locale_plurals = \Drupal::service('locale.plural.formula')->reset()->getNumberOfPlurals('fr');
     $this->assertEquals(3, $locale_plurals, 'Plural numbers changed.');
@@ -249,7 +249,7 @@ public function testStandalonePoFile() {
     ];
     $this->drupalGet('admin/config/regional/translate');
     $this->submitForm($search, 'Filter');
-    $this->assertNoText('No strings available.');
+    $this->assertSession()->pageTextNotContains('No strings available.');
 
   }
 
diff --git a/core/modules/locale/tests/src/Functional/LocalePluralFormatTest.php b/core/modules/locale/tests/src/Functional/LocalePluralFormatTest.php
index 3cae3436e87e4f85441c83ed72d9f9969208aeeb..160fe866b604eff809adbc4d2e1182f64e185780 100644
--- a/core/modules/locale/tests/src/Functional/LocalePluralFormatTest.php
+++ b/core/modules/locale/tests/src/Functional/LocalePluralFormatTest.php
@@ -280,7 +280,7 @@ public function testPluralEditExport() {
     $this->assertSession()->pageTextContains('Singular form');
     $this->assertSession()->pageTextContains('First plural form');
     $this->assertSession()->pageTextContains('2. plural form');
-    $this->assertNoText('3. plural form');
+    $this->assertSession()->pageTextNotContains('3. plural form');
 
     // Plural values for langcode hr.
     $this->assertSession()->pageTextContains('@count sat');
@@ -309,7 +309,7 @@ public function testPluralEditExport() {
     // Plural values for the langcode fr.
     $this->assertSession()->pageTextContains('@count heure');
     $this->assertSession()->pageTextContains('@count heures');
-    $this->assertNoText('2. plural form');
+    $this->assertSession()->pageTextNotContains('2. plural form');
 
     // Edit langcode fr translations and see if that took effect.
     $edit = [
diff --git a/core/modules/locale/tests/src/Functional/LocaleTranslationUiTest.php b/core/modules/locale/tests/src/Functional/LocaleTranslationUiTest.php
index d0ea227b805253dc6bd4b0e5ac8b5b930e17ab06..a5583aba0f9343f9e0ccabc3d61372a56f2b1e8e 100644
--- a/core/modules/locale/tests/src/Functional/LocaleTranslationUiTest.php
+++ b/core/modules/locale/tests/src/Functional/LocaleTranslationUiTest.php
@@ -243,7 +243,7 @@ public function testStringTranslation() {
     ];
     $this->drupalGet('admin/config/regional/translate');
     $this->submitForm($search, 'Filter');
-    $this->assertNoText('No strings available.');
+    $this->assertSession()->pageTextNotContains('No strings available.');
   }
 
   /**
@@ -373,7 +373,7 @@ public function testStringValidation() {
       // Check for a form error on the textarea, which means the string was
       // rejected as unsafe.
       $this->assertSession()->elementAttributeContains('xpath', '//form[@id="locale-translate-edit-form"]//textarea', 'class', 'error');
-      $this->assertNoText('The string has been saved.');
+      $this->assertSession()->pageTextNotContains('The string has been saved.');
     }
   }
 
@@ -434,9 +434,9 @@ public function testStringSearch() {
     ];
     $this->drupalGet('admin/config/regional/translate');
     $this->submitForm($search, 'Filter');
-    // assertText() seems to remove the input field where $name always could be
-    // found, so this is not a false assert. See how assertNoText succeeds
-    // later.
+    // pageTextContains() seems to remove the input field where $name always
+    // could be found, so this is not a false assert. See how
+    // pageTextNotContains succeeds later.
     $this->assertSession()->pageTextContains($name);
 
     // Ensure untranslated string doesn't appear if searching on 'only
@@ -459,7 +459,7 @@ public function testStringSearch() {
     ];
     $this->drupalGet('admin/config/regional/translate');
     $this->submitForm($search, 'Filter');
-    $this->assertNoText('No strings available.');
+    $this->assertSession()->pageTextNotContains('No strings available.');
 
     // Add translation.
     // Assume this is the only result, given the random name.
@@ -481,7 +481,7 @@ public function testStringSearch() {
     ];
     $this->drupalGet('admin/config/regional/translate');
     $this->submitForm($search, 'Filter');
-    $this->assertNoText('No strings available.');
+    $this->assertSession()->pageTextNotContains('No strings available.');
 
     // Ensure translated source string doesn't appear if searching on 'only
     // untranslated strings'.
@@ -513,7 +513,7 @@ public function testStringSearch() {
     ];
     $this->drupalGet('admin/config/regional/translate');
     $this->submitForm($search, 'Filter');
-    $this->assertNoText('No strings available.');
+    $this->assertSession()->pageTextNotContains('No strings available.');
 
     // Ensure translated string doesn't appear if searching in System (English).
     $search = [
diff --git a/core/modules/locale/tests/src/Functional/LocaleUpdateInterfaceTest.php b/core/modules/locale/tests/src/Functional/LocaleUpdateInterfaceTest.php
index 1df2655a79ccf33e1cbb108e8af9a44dca65413d..cebe7b445b41b63b49e6d81c99962d7b3ca2ce4c 100644
--- a/core/modules/locale/tests/src/Functional/LocaleUpdateInterfaceTest.php
+++ b/core/modules/locale/tests/src/Functional/LocaleUpdateInterfaceTest.php
@@ -49,7 +49,7 @@ public function testInterface() {
     // No language added.
     // Check status page and Available translation updates page.
     $this->drupalGet('admin/reports/status');
-    $this->assertNoText('Translation update status');
+    $this->assertSession()->pageTextNotContains('Translation update status');
 
     $this->drupalGet('admin/reports/translations');
     $this->assertRaw(t('No translatable languages available. <a href=":add_language">Add a language</a> first.', [':add_language' => Url::fromRoute('entity.configurable_language.collection')->toString()]));
diff --git a/core/modules/locale/tests/src/Functional/LocaleUpdateTest.php b/core/modules/locale/tests/src/Functional/LocaleUpdateTest.php
index 00cd4568c8cc7b103bdc1d5d7ab503e80b43e0f1..ffb6083e8af98274145d468cfe347a567ade316f 100644
--- a/core/modules/locale/tests/src/Functional/LocaleUpdateTest.php
+++ b/core/modules/locale/tests/src/Functional/LocaleUpdateTest.php
@@ -454,7 +454,7 @@ public function testEnableCustomLanguage() {
     ];
     $this->drupalGet('admin/config/regional/translate');
     $this->submitForm($search, 'Filter');
-    $this->assertNoText('No strings available.');
+    $this->assertSession()->pageTextNotContains('No strings available.');
 
     // Ensure the multiline string was imported.
     $search = [
@@ -477,7 +477,7 @@ public function testEnableCustomLanguage() {
     $this->drupalGet('admin/config/regional/translate');
     $this->submitForm($search, 'Filter');
     $this->assertSession()->pageTextContains('Allowed HTML source string');
-    $this->assertNoText('Another allowed HTML source string');
+    $this->assertSession()->pageTextNotContains('Another allowed HTML source string');
   }
 
 }
diff --git a/core/modules/menu_ui/tests/src/Functional/MenuUiNodeTest.php b/core/modules/menu_ui/tests/src/Functional/MenuUiNodeTest.php
index dde78653f75f56e9fa43a380fd88a5a77a1c4c72..496cee07c25da0010049f4bb823c2820650e1696 100644
--- a/core/modules/menu_ui/tests/src/Functional/MenuUiNodeTest.php
+++ b/core/modules/menu_ui/tests/src/Functional/MenuUiNodeTest.php
@@ -95,7 +95,7 @@ public function testMenuNodeFormWidget() {
     // Verify that no menu settings are displayed and nodes can be created.
     $this->drupalGet('node/add/page');
     $this->assertSession()->pageTextContains('Create Basic page');
-    $this->assertNoText('Menu settings');
+    $this->assertSession()->pageTextNotContains('Menu settings');
     $node_title = $this->randomMachineName();
     $edit = [
       'title[0][value]' => $node_title,
diff --git a/core/modules/menu_ui/tests/src/Functional/MenuUiTest.php b/core/modules/menu_ui/tests/src/Functional/MenuUiTest.php
index 665c937f4883f2ef6c24506a6e91e5e6c8572f50..b1f89dd2f84162d4eee03c43bcee184782d2227c 100644
--- a/core/modules/menu_ui/tests/src/Functional/MenuUiTest.php
+++ b/core/modules/menu_ui/tests/src/Functional/MenuUiTest.php
@@ -615,7 +615,7 @@ public function testUnpublishedNodeMenuItem() {
     $this->drupalLogout();
     $this->drupalLogin($this->adminUser);
     $this->drupalGet('admin/structure/menu/manage/' . $item->getMenuName());
-    $this->assertNoText($item->getTitle());
+    $this->assertSession()->pageTextNotContains($item->getTitle());
     // The cache contexts associated with the (in)accessible menu links are
     // bubbled. See DefaultMenuLinkTreeManipulators::menuLinkCheckAccess().
     $this->assertSession()->responseHeaderContains('X-Drupal-Cache-Contexts', 'user.permissions');
@@ -850,7 +850,7 @@ public function deleteMenuLink(MenuLinkContent $item) {
 
     // Verify deletion.
     $this->drupalGet('');
-    $this->assertNoText($title);
+    $this->assertSession()->pageTextNotContains($title);
   }
 
   /**
@@ -864,7 +864,7 @@ public function toggleMenuLink(MenuLinkContent $item) {
 
     // Verify menu link is absent.
     $this->drupalGet('');
-    $this->assertNoText($item->getTitle());
+    $this->assertSession()->pageTextNotContains($item->getTitle());
     $this->enableMenuLink($item);
 
     // Verify menu link is displayed.
diff --git a/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateAccessTest.php b/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateAccessTest.php
index edb64265cb714151f78713d510f170f6d5788209..25be88e921e5e96b4da5f3ab4c2effac873bdda1 100644
--- a/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateAccessTest.php
+++ b/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateAccessTest.php
@@ -36,7 +36,7 @@ public function testAccess() {
     $this->drupalLogin($user);
     $this->drupalGet('upgrade');
     $this->assertSession()->statusCodeEquals(403);
-    $this->assertNoText('Upgrade');
+    $this->assertSession()->pageTextNotContains('Upgrade');
   }
 
 }
diff --git a/core/modules/node/tests/src/Functional/NodeActionsConfigurationTest.php b/core/modules/node/tests/src/Functional/NodeActionsConfigurationTest.php
index c069dbdcbadd0fecec3e0330c5a0a8e31ca52204..cc595be962f2738817a5e58a9b635bb7bfcd666e 100644
--- a/core/modules/node/tests/src/Functional/NodeActionsConfigurationTest.php
+++ b/core/modules/node/tests/src/Functional/NodeActionsConfigurationTest.php
@@ -72,7 +72,7 @@ public function testAssignOwnerNodeActionConfiguration() {
     $this->assertSession()->pageTextContains('The action has been successfully saved.');
     // Check that the old label for the node_assign_owner_action action does not
     // appear on the actions administration page after updating.
-    $this->assertNoText($action_label);
+    $this->assertSession()->pageTextNotContains($action_label);
     // Check that the new label for the node_assign_owner_action action appears
     // on the actions administration page after updating.
     $this->assertSession()->pageTextContains($new_action_label);
@@ -91,7 +91,7 @@ public function testAssignOwnerNodeActionConfiguration() {
     $this->assertSession()->statusCodeEquals(200);
     // Check that the label for the node_assign_owner_action action does not
     // appear on the actions administration page after deleting.
-    $this->assertNoText($new_action_label);
+    $this->assertSession()->pageTextNotContains($new_action_label);
 
     $action = Action::load($action_id);
     $this->assertNull($action, 'The node_assign_owner_action action is not available after being deleted.');
diff --git a/core/modules/node/tests/src/Functional/NodeBlockFunctionalTest.php b/core/modules/node/tests/src/Functional/NodeBlockFunctionalTest.php
index 5bad6e6d6f19e8a8ac40b034d751ec5e003d5039..3fa78eb20094a00dc4620c5bf54fe479fd6259a8 100644
--- a/core/modules/node/tests/src/Functional/NodeBlockFunctionalTest.php
+++ b/core/modules/node/tests/src/Functional/NodeBlockFunctionalTest.php
@@ -110,11 +110,11 @@ public function testRecentNodeBlock() {
     // see the block.
     $this->drupalLogout();
     $this->drupalGet('');
-    $this->assertNoText($block->label());
+    $this->assertSession()->pageTextNotContains($block->label());
 
     // Test that only the 2 latest nodes are shown.
     $this->drupalLogin($this->webUser);
-    $this->assertNoText($node1->label());
+    $this->assertSession()->pageTextNotContains($node1->label());
     $this->assertSession()->pageTextContains($node2->label());
     $this->assertSession()->pageTextContains($node3->label());
 
@@ -166,7 +166,7 @@ public function testRecentNodeBlock() {
     $this->drupalGet('');
     $label = $block->label();
     // Check that block is not displayed on the front page.
-    $this->assertNoText($label);
+    $this->assertSession()->pageTextNotContains($label);
     $this->assertCacheContexts(['languages:language_content', 'languages:language_interface', 'theme', 'url.query_args:' . MainContentViewSubscriber::WRAPPER_FORMAT, 'url.site', 'user', 'route']);
 
     // Ensure that a page that does not have a node context can still be cached,
@@ -194,7 +194,7 @@ public function testRecentNodeBlock() {
     $this->drupalGet('node/' . $node5->id());
     // Check that block is not displayed on the node page when node is of type
     // 'page'.
-    $this->assertNoText($label);
+    $this->assertSession()->pageTextNotContains($label);
     $this->assertCacheContexts(['languages:language_content', 'languages:language_interface', 'theme', 'url.query_args:' . MainContentViewSubscriber::WRAPPER_FORMAT, 'url.site', 'user', 'route', 'timezone']);
     $this->assertSession()->responseHeaderEquals('X-Drupal-Dynamic-Cache', 'MISS');
     $this->drupalGet('node/' . $node5->id());
diff --git a/core/modules/node/tests/src/Functional/NodeCreationTest.php b/core/modules/node/tests/src/Functional/NodeCreationTest.php
index d50df5f0d92f3600f17403b8b184452d89dc63f1..5184c20bc28ec4deb4a271924314647d85da4937 100644
--- a/core/modules/node/tests/src/Functional/NodeCreationTest.php
+++ b/core/modules/node/tests/src/Functional/NodeCreationTest.php
@@ -87,8 +87,8 @@ public function testNodeCreation() {
 
     // Verify that pages do not show submitted information by default.
     $this->drupalGet('node/' . $node->id());
-    $this->assertNoText($node->getOwner()->getAccountName());
-    $this->assertNoText($this->container->get('date.formatter')->format($node->getCreatedTime()));
+    $this->assertSession()->pageTextNotContains($node->getOwner()->getAccountName());
+    $this->assertSession()->pageTextNotContains($this->container->get('date.formatter')->format($node->getCreatedTime()));
 
     // Change the node type setting to show submitted by information.
     /** @var \Drupal\node\NodeTypeInterface $node_type */
diff --git a/core/modules/node/tests/src/Functional/NodeEditFormTest.php b/core/modules/node/tests/src/Functional/NodeEditFormTest.php
index 305eb8cb540473999ab02a4e27bba5e62976821f..3a674a905a7a895c1a5dcdff8cf10cfeae2e467c 100644
--- a/core/modules/node/tests/src/Functional/NodeEditFormTest.php
+++ b/core/modules/node/tests/src/Functional/NodeEditFormTest.php
@@ -225,7 +225,7 @@ public function testNodeMetaInformation() {
     // can not see the meta information.
     $this->drupalLogin($this->webUser);
     $this->drupalGet('node/add/page');
-    $this->assertNoText('Not saved yet');
+    $this->assertSession()->pageTextNotContains('Not saved yet');
 
     // Create node to edit.
     $edit['title[0][value]'] = $this->randomMachineName(8);
@@ -234,8 +234,8 @@ public function testNodeMetaInformation() {
 
     $node = $this->drupalGetNodeByTitle($edit['title[0][value]']);
     $this->drupalGet("node/" . $node->id() . "/edit");
-    $this->assertNoText('Published');
-    $this->assertNoText($this->container->get('date.formatter')->format($node->getChangedTime(), 'short'));
+    $this->assertSession()->pageTextNotContains('Published');
+    $this->assertSession()->pageTextNotContains($this->container->get('date.formatter')->format($node->getChangedTime(), 'short'));
 
     // Check that users with the 'administer nodes' permission can see the meta
     // information.
diff --git a/core/modules/node/tests/src/Functional/NodeEntityViewModeAlterTest.php b/core/modules/node/tests/src/Functional/NodeEntityViewModeAlterTest.php
index 0d086163c26dcbde07757eb4bafcdd97a0c64b87..e1357d705bfa4511f616ef27ef96e587afa063ac 100644
--- a/core/modules/node/tests/src/Functional/NodeEntityViewModeAlterTest.php
+++ b/core/modules/node/tests/src/Functional/NodeEntityViewModeAlterTest.php
@@ -52,7 +52,7 @@ public function testNodeViewModeChange() {
     // Check that teaser mode is viewed.
     $this->assertSession()->pageTextContains('Extra data that should appear only in the teaser for the node.');
     // Make sure body text is not present.
-    $this->assertNoText('Data that should appear only in the body for the node.');
+    $this->assertSession()->pageTextNotContains('Data that should appear only in the body for the node.');
 
     // Test that the correct build mode has been set.
     $build = $this->buildEntityView($node);
diff --git a/core/modules/node/tests/src/Functional/NodeRSSContentTest.php b/core/modules/node/tests/src/Functional/NodeRSSContentTest.php
index 45bea1374b09fd5e7082d578b7b08e4b24ea2d80..ad4aa767d5d6d49d5006ed4d02f2431e2a026af6 100644
--- a/core/modules/node/tests/src/Functional/NodeRSSContentTest.php
+++ b/core/modules/node/tests/src/Functional/NodeRSSContentTest.php
@@ -57,7 +57,7 @@ public function testNodeRSSContent() {
     // Check that content added in view modes other than 'rss' doesn't
     // appear in RSS feed.
     $non_rss_content = 'Extra data that should appear everywhere except the RSS feed for node ' . $node->id() . '.';
-    $this->assertNoText($non_rss_content);
+    $this->assertSession()->responseNotContains($non_rss_content);
 
     // Check that extra RSS elements and namespaces are added to RSS feed.
     $test_element = '<testElement>' . t('Value of testElement RSS element for node @nid.', ['@nid' => $node->id()]) . '</testElement>';
@@ -68,7 +68,7 @@ public function testNodeRSSContent() {
     // Check that content added in 'rss' view mode doesn't appear when
     // viewing node.
     $this->drupalGet('node/' . $node->id());
-    $this->assertNoText($rss_only_content);
+    $this->assertSession()->responseNotContains($rss_only_content);
   }
 
   /**
diff --git a/core/modules/node/tests/src/Functional/NodeRevisionsTest.php b/core/modules/node/tests/src/Functional/NodeRevisionsTest.php
index 0cb8c991a8b451861acc941111278796ba90ac92..66e91c011a4ee64793771a300a073bdd1db453fb 100644
--- a/core/modules/node/tests/src/Functional/NodeRevisionsTest.php
+++ b/core/modules/node/tests/src/Functional/NodeRevisionsTest.php
@@ -236,7 +236,7 @@ public function testRevisions() {
 
     // Verify that revision body text is not present on default version of node.
     $this->drupalGet('node/' . $node->id());
-    $this->assertNoText($new_body);
+    $this->assertSession()->pageTextNotContains($new_body);
 
     // Verify that the new body text is present on the revision.
     $this->drupalGet("node/" . $node->id() . "/revisions/" . $new_node_revision->getRevisionId() . "/view");
@@ -308,17 +308,17 @@ public function testRevisions() {
     // View the revision UI in 'IT', only the original node revision is shown.
     $this->drupalGet("it/node/" . $node->id() . "/revisions");
     $this->assertSession()->pageTextContains('Simple revision message (EN)');
-    $this->assertNoText('New revision message (DE)');
+    $this->assertSession()->pageTextNotContains('New revision message (DE)');
 
     // View the revision UI in 'DE', only the translated node revision is shown.
     $this->drupalGet("de/node/" . $node->id() . "/revisions");
-    $this->assertNoText('Simple revision message (EN)');
+    $this->assertSession()->pageTextNotContains('Simple revision message (EN)');
     $this->assertSession()->pageTextContains('New revision message (DE)');
 
     // View the revision UI in 'EN', only the original node revision is shown.
     $this->drupalGet("node/" . $node->id() . "/revisions");
     $this->assertSession()->pageTextContains('Simple revision message (EN)');
-    $this->assertNoText('New revision message (DE)');
+    $this->assertSession()->pageTextNotContains('New revision message (DE)');
   }
 
   /**
diff --git a/core/modules/node/tests/src/Functional/NodeTranslationUITest.php b/core/modules/node/tests/src/Functional/NodeTranslationUITest.php
index 6a09d92230cb923143a4cd714d6cc94307a91b29..f8d4c023b21c73ec8e09e83f6d1575d86b6f30bf 100644
--- a/core/modules/node/tests/src/Functional/NodeTranslationUITest.php
+++ b/core/modules/node/tests/src/Functional/NodeTranslationUITest.php
@@ -538,7 +538,7 @@ public function testRevisionTranslationRendering() {
 
     // Contents should be in English, of correct revision.
     $this->assertSession()->pageTextContains('First rev en title');
-    $this->assertNoText('First rev fr title');
+    $this->assertSession()->pageTextNotContains('First rev fr title');
 
     // Get a French view.
     $url_fr = $original_revision->getTranslation('fr')->toUrl('revision')->toString();
@@ -551,7 +551,7 @@ public function testRevisionTranslationRendering() {
 
     // Contents should be in French, of correct revision.
     $this->assertSession()->pageTextContains('First rev fr title');
-    $this->assertNoText('First rev en title');
+    $this->assertSession()->pageTextNotContains('First rev en title');
   }
 
   /**
diff --git a/core/modules/node/tests/src/Functional/NodeTypeTest.php b/core/modules/node/tests/src/Functional/NodeTypeTest.php
index a4c3154ff05fc5359228575a03fae7da78bd32b0..8c8e8b26588a31ef8ab3ba1cb2e126b4a86e1cda 100644
--- a/core/modules/node/tests/src/Functional/NodeTypeTest.php
+++ b/core/modules/node/tests/src/Functional/NodeTypeTest.php
@@ -193,7 +193,7 @@ public function testNodeTypeDeletion() {
     $this->assertRaw(
      t('%type is used by 1 piece of content on your site. You can not remove this content type until you have removed all of the %type content.', ['%type' => $type->label()])
     );
-    $this->assertNoText('This action cannot be undone.');
+    $this->assertSession()->pageTextNotContains('This action cannot be undone.');
 
     // Delete the node.
     $node->delete();
diff --git a/core/modules/node/tests/src/Functional/PagePreviewTest.php b/core/modules/node/tests/src/Functional/PagePreviewTest.php
index c57a276c7307dc482b86c5eec60143fcf1a86a3a..01275ec02110a6a6fad38b0af14da1a0aaf063cb 100644
--- a/core/modules/node/tests/src/Functional/PagePreviewTest.php
+++ b/core/modules/node/tests/src/Functional/PagePreviewTest.php
@@ -231,7 +231,7 @@ public function testPagePreview() {
     $this->drupalGet('node/preview/' . $uuid . '/full');
     $this->submitForm($view_mode_edit, 'Switch');
     $this->assertRaw('view-mode-teaser');
-    $this->assertNoText($edit[$body_key]);
+    $this->assertSession()->pageTextNotContains($edit[$body_key]);
 
     // Check that the title, body and term fields are displayed with the
     // values after going back to the content edit page.
@@ -300,7 +300,7 @@ public function testPagePreview() {
     $this->assertRaw('>' . $newterm1 . '<');
     $this->assertRaw('>' . $newterm2 . '<');
     $this->assertRaw('>' . $newterm3 . '<');
-    $this->assertNoText($this->term->getName());
+    $this->assertSession()->pageTextNotContains($this->term->getName());
     $this->assertSession()->linkExists($newterm1);
     $this->assertSession()->linkExists($newterm2);
     $this->assertSession()->linkNotExists($newterm3);
diff --git a/core/modules/node/tests/src/Functional/Views/BulkFormTest.php b/core/modules/node/tests/src/Functional/Views/BulkFormTest.php
index b86663687e1242a69d16555ed59c81d3898a0095..0415f1ad69b7af67f287a050baf42082871ce747 100644
--- a/core/modules/node/tests/src/Functional/Views/BulkFormTest.php
+++ b/core/modules/node/tests/src/Functional/Views/BulkFormTest.php
@@ -259,10 +259,10 @@ public function testBulkDeletion() {
     $this->assertSession()->pageTextContains("$label (Original translation) - The following content item translations will be deleted:");
     $label = $this->loadNode(3)->getTranslation('en')->label();
     $this->assertSession()->pageTextContains($label);
-    $this->assertNoText("$label (Original translation) - The following content item translations will be deleted:");
+    $this->assertSession()->pageTextNotContains("$label (Original translation) - The following content item translations will be deleted:");
     $label = $this->loadNode(4)->label();
     $this->assertSession()->pageTextContains($label);
-    $this->assertNoText("$label (Original translation) - The following content item translations will be deleted:");
+    $this->assertSession()->pageTextNotContains("$label (Original translation) - The following content item translations will be deleted:");
 
     $this->submitForm([], 'Delete');
 
diff --git a/core/modules/node/tests/src/Functional/Views/FilterNodeAccessTest.php b/core/modules/node/tests/src/Functional/Views/FilterNodeAccessTest.php
index 399ba9e05a431774348ecc52f8ab95adeca1ca74..a7b8b7f37854bbede17f47333d5a886fc5f7530e 100644
--- a/core/modules/node/tests/src/Functional/Views/FilterNodeAccessTest.php
+++ b/core/modules/node/tests/src/Functional/Views/FilterNodeAccessTest.php
@@ -89,7 +89,7 @@ public function testFilterNodeAccess() {
     // Test that the private node of the current user is shown.
     $this->assertSession()->pageTextContains('Private Article created by ' . $this->users[0]->getAccountName());
     // Test that the private node of the other use isn't shown.
-    $this->assertNoText('Private Article created by ' . $this->users[1]->getAccountName());
+    $this->assertSession()->pageTextNotContains('Private Article created by ' . $this->users[1]->getAccountName());
     // Test that both public nodes are shown.
     $this->assertSession()->pageTextContains('Public Article created by ' . $this->users[0]->getAccountName());
     $this->assertSession()->pageTextContains('Public Article created by ' . $this->users[1]->getAccountName());
@@ -100,7 +100,7 @@ public function testFilterNodeAccess() {
     // Test that the private node of the current user is shown.
     $this->assertSession()->pageTextContains('Private Article created by ' . $this->users[1]->getAccountName());
     // Test that the private node of the other use isn't shown.
-    $this->assertNoText('Private Article created by ' . $this->users[0]->getAccountName());
+    $this->assertSession()->pageTextNotContains('Private Article created by ' . $this->users[0]->getAccountName());
 
     // Test that a user with administer nodes permission can't see all nodes.
     $administer_nodes_user = $this->drupalCreateUser([
@@ -109,8 +109,8 @@ public function testFilterNodeAccess() {
     ]);
     $this->drupalLogin($administer_nodes_user);
     $this->drupalGet('test_filter_node_access');
-    $this->assertNoText('Private Article created by ' . $this->users[0]->getAccountName());
-    $this->assertNoText('Private Article created by ' . $this->users[1]->getAccountName());
+    $this->assertSession()->pageTextNotContains('Private Article created by ' . $this->users[0]->getAccountName());
+    $this->assertSession()->pageTextNotContains('Private Article created by ' . $this->users[1]->getAccountName());
     $this->assertSession()->pageTextContains('Public Article created by ' . $this->users[0]->getAccountName());
     $this->assertSession()->pageTextContains('Public Article created by ' . $this->users[1]->getAccountName());
 
diff --git a/core/modules/node/tests/src/Functional/Views/NodeLanguageTest.php b/core/modules/node/tests/src/Functional/Views/NodeLanguageTest.php
index 029ab634e95595c4a27c5181f6db2394d7190f36..986f59cbc09f810cb1efc614d0f12cfea1d9aff2 100644
--- a/core/modules/node/tests/src/Functional/Views/NodeLanguageTest.php
+++ b/core/modules/node/tests/src/Functional/Views/NodeLanguageTest.php
@@ -121,7 +121,7 @@ public function testLanguages() {
     foreach ($this->nodeTitles as $langcode => $list) {
       foreach ($list as $title) {
         if ($langcode == 'en') {
-          $this->assertNoText($title);
+          $this->assertSession()->pageTextNotContains($title);
         }
         else {
           $this->assertSession()->pageTextContains($title);
@@ -130,7 +130,7 @@ public function testLanguages() {
     }
 
     // Test that the language field value is shown.
-    $this->assertNoText('English');
+    $this->assertSession()->pageTextNotContains('English');
     $this->assertSession()->pageTextContains('French');
     $this->assertSession()->pageTextContains('Spanish');
 
@@ -151,8 +151,8 @@ public function testLanguages() {
     $this->drupalGet('test-language/es');
     // This time, test just the language field.
     $message = 'Spanish argument page';
-    $this->assertNoText('English');
-    $this->assertNoText('French');
+    $this->assertSession()->pageTextNotContains('English');
+    $this->assertSession()->pageTextNotContains('French');
     $this->assertSession()->pageTextContains('Spanish');
 
     // Test the front page view filter. Only node titles in the current language
@@ -169,7 +169,7 @@ public function testLanguages() {
       foreach ($this->nodeTitles as $control_langcode => $control_titles) {
         if ($langcode != $control_langcode) {
           foreach ($control_titles as $title) {
-            $this->assertNoText($title);
+            $this->assertSession()->pageTextNotContains($title);
           }
         }
       }
@@ -191,7 +191,7 @@ public function testLanguages() {
       foreach ($this->nodeTitles as $control_langcode => $control_titles) {
         if ($langcode != $control_langcode) {
           foreach ($control_titles as $title) {
-            $this->assertNoText($title);
+            $this->assertSession()->pageTextNotContains($title);
           }
         }
       }
@@ -214,7 +214,7 @@ public function testLanguages() {
             $this->assertSession()->pageTextContains($title);
           }
           else {
-            $this->assertNoText($title);
+            $this->assertSession()->pageTextNotContains($title);
           }
         }
       }
@@ -242,7 +242,7 @@ public function testLanguages() {
           $this->assertSession()->pageTextContains($title);
         }
         else {
-          $this->assertNoText($title);
+          $this->assertSession()->pageTextNotContains($title);
         }
       }
     }
@@ -287,12 +287,12 @@ protected function assertLanguageNames($native = FALSE) {
     if ($native) {
       $this->assertSession()->pageTextContains('Français');
       $this->assertSession()->pageTextContains('Español');
-      $this->assertNoText('French');
-      $this->assertNoText('Spanish');
+      $this->assertSession()->pageTextNotContains('French');
+      $this->assertSession()->pageTextNotContains('Spanish');
     }
     else {
-      $this->assertNoText('Français');
-      $this->assertNoText('Español');
+      $this->assertSession()->pageTextNotContains('Français');
+      $this->assertSession()->pageTextNotContains('Español');
       $this->assertSession()->pageTextContains('French');
       $this->assertSession()->pageTextContains('Spanish');
     }
diff --git a/core/modules/node/tests/src/Functional/Views/StatusExtraTest.php b/core/modules/node/tests/src/Functional/Views/StatusExtraTest.php
index 2c9a54c0a98430bd8d2c220d63b3f03f850c6904..6580dd42a87717449a085388e55484eca79b459c 100644
--- a/core/modules/node/tests/src/Functional/Views/StatusExtraTest.php
+++ b/core/modules/node/tests/src/Functional/Views/StatusExtraTest.php
@@ -70,26 +70,26 @@ public function testStatusExtra() {
     $this->drupalLogin($node_author);
     $this->drupalGet('test_status_extra');
     $this->assertSession()->pageTextContains($node_published->label());
-    $this->assertNoText($node_unpublished->label());
+    $this->assertSession()->pageTextNotContains($node_unpublished->label());
     $this->assertSession()->pageTextContains($node_unpublished2->label());
-    $this->assertNoText($node_unpublished3->label());
+    $this->assertSession()->pageTextNotContains($node_unpublished3->label());
 
     // The normal user should just see the published node.
     $this->drupalLogin($normal_user);
     $this->drupalGet('test_status_extra');
     $this->assertSession()->pageTextContains($node_published->label());
-    $this->assertNoText($node_unpublished->label());
-    $this->assertNoText($node_unpublished2->label());
-    $this->assertNoText($node_unpublished3->label());
+    $this->assertSession()->pageTextNotContains($node_unpublished->label());
+    $this->assertSession()->pageTextNotContains($node_unpublished2->label());
+    $this->assertSession()->pageTextNotContains($node_unpublished3->label());
 
     // The author without the permission to see their own unpublished node should
     // just see the published node.
     $this->drupalLogin($node_author_not_unpublished);
     $this->drupalGet('test_status_extra');
     $this->assertSession()->pageTextContains($node_published->label());
-    $this->assertNoText($node_unpublished->label());
-    $this->assertNoText($node_unpublished2->label());
-    $this->assertNoText($node_unpublished3->label());
+    $this->assertSession()->pageTextNotContains($node_unpublished->label());
+    $this->assertSession()->pageTextNotContains($node_unpublished2->label());
+    $this->assertSession()->pageTextNotContains($node_unpublished3->label());
   }
 
 }
diff --git a/core/modules/path/tests/src/Functional/PathAliasTest.php b/core/modules/path/tests/src/Functional/PathAliasTest.php
index 439ef2570614a7f7dcd93c6ab3fdb47a3f933836..18f518eb1040caf889f32fc4c89e2ea4e075f162 100644
--- a/core/modules/path/tests/src/Functional/PathAliasTest.php
+++ b/core/modules/path/tests/src/Functional/PathAliasTest.php
@@ -135,7 +135,7 @@ public function testAdminAlias() {
     $this->container->get('path_alias.manager')->cacheClear();
     // Confirm that previous alias no longer works.
     $this->drupalGet($previous);
-    $this->assertNoText($node1->label());
+    $this->assertSession()->pageTextNotContains($node1->label());
     $this->assertSession()->statusCodeEquals(404);
 
     // Create second test node.
@@ -167,7 +167,7 @@ public function testAdminAlias() {
 
     // Confirm that the alias no longer works.
     $this->drupalGet($edit['alias[0][value]']);
-    $this->assertNoText($node1->label());
+    $this->assertSession()->pageTextNotContains($node1->label());
     $this->assertSession()->statusCodeEquals(404);
 
     // Create a really long alias.
@@ -180,7 +180,7 @@ public function testAdminAlias() {
     $this->drupalGet('admin/config/search/path/add');
     $this->submitForm($edit, 'Save');
     // The untruncated alias should not be found.
-    $this->assertNoText($alias);
+    $this->assertSession()->pageTextNotContains($alias);
     // The 'truncated' alias will always be found.
     $this->assertSession()->pageTextContains($truncated_alias);
 
@@ -207,7 +207,7 @@ public function testAdminAlias() {
     $this->submitForm($edit, 'Save');
 
     // Confirm that the alias with trailing slash is not found.
-    $this->assertNoText($edit['alias[0][value]']);
+    $this->assertSession()->pageTextNotContains($edit['alias[0][value]']);
     // The alias without trailing flash is found.
     $this->assertSession()->pageTextContains(trim($edit['alias[0][value]'], '/'));
 
@@ -221,7 +221,7 @@ public function testAdminAlias() {
     $this->assertSession()->pageTextContains('The alias has been saved.');
     $this->drupalGet($edit['alias[0][value]']);
     // Previous alias should no longer work.
-    $this->assertNoText($node4->label());
+    $this->assertSession()->pageTextNotContains($node4->label());
     // Alias should work.
     $this->assertSession()->pageTextContains($node2->label());
     $this->assertSession()->statusCodeEquals(200);
@@ -303,7 +303,7 @@ public function testNodeAlias() {
 
     // Make sure that previous alias no longer works.
     $this->drupalGet($previous);
-    $this->assertNoText($node1->label());
+    $this->assertSession()->pageTextNotContains($node1->label());
     $this->assertSession()->statusCodeEquals(404);
 
     // Create second test node.
@@ -323,7 +323,7 @@ public function testNodeAlias() {
 
     // Confirm that the alias no longer works.
     $this->drupalGet($edit['path[0][alias]']);
-    $this->assertNoText($node1->label());
+    $this->assertSession()->pageTextNotContains($node1->label());
     $this->assertSession()->statusCodeEquals(404);
 
     // Create third test node.
diff --git a/core/modules/path/tests/src/Functional/PathTaxonomyTermTest.php b/core/modules/path/tests/src/Functional/PathTaxonomyTermTest.php
index 297a22258ac92da98d751efffcb317235f383059..1a5cfb93498b16d2239b8822f4e05989e875603c 100644
--- a/core/modules/path/tests/src/Functional/PathTaxonomyTermTest.php
+++ b/core/modules/path/tests/src/Functional/PathTaxonomyTermTest.php
@@ -85,7 +85,7 @@ public function testTermAlias() {
 
     // Confirm that the old alias no longer works.
     $this->drupalGet(trim($edit['path[0][alias]'], '/'));
-    $this->assertNoText($description);
+    $this->assertSession()->pageTextNotContains($description);
     $this->assertSession()->statusCodeEquals(404);
 
     // Remove the term's URL alias.
@@ -96,7 +96,7 @@ public function testTermAlias() {
 
     // Confirm that the alias no longer works.
     $this->drupalGet(trim($edit2['path[0][alias]'], '/'));
-    $this->assertNoText($description);
+    $this->assertSession()->pageTextNotContains($description);
     $this->assertSession()->statusCodeEquals(404);
   }
 
diff --git a/core/modules/responsive_image/tests/src/Functional/ResponsiveImageAdminUITest.php b/core/modules/responsive_image/tests/src/Functional/ResponsiveImageAdminUITest.php
index cfb05a30a0a33ea8906f7470eeac60ed4cbaec23..9cbbad433b5faaa93b21be9a1aaa31bbd15b26e6 100644
--- a/core/modules/responsive_image/tests/src/Functional/ResponsiveImageAdminUITest.php
+++ b/core/modules/responsive_image/tests/src/Functional/ResponsiveImageAdminUITest.php
@@ -64,7 +64,7 @@ public function testResponsiveImageAdmin() {
     // Check if the new group is created.
     $this->assertSession()->statusCodeEquals(200);
     $this->drupalGet('admin/config/media/responsive-image-style');
-    $this->assertNoText('There are no responsive image styles yet.');
+    $this->assertSession()->pageTextNotContains('There are no responsive image styles yet.');
     $this->assertSession()->pageTextContains('Style One');
 
     // Edit the group.
diff --git a/core/modules/rest/tests/src/Functional/Views/StyleSerializerTest.php b/core/modules/rest/tests/src/Functional/Views/StyleSerializerTest.php
index d49d8f2ab4a38aa347e30c2a308da3b6278757be..bcbf57e6da0ceaf9676a0925008aa823bd498496 100644
--- a/core/modules/rest/tests/src/Functional/Views/StyleSerializerTest.php
+++ b/core/modules/rest/tests/src/Functional/Views/StyleSerializerTest.php
@@ -589,7 +589,7 @@ public function testFieldRawOutput() {
     }
     // Test that the excluded field is not shown in the row options.
     $this->drupalGet('admin/structure/views/nojs/display/test_serializer_display_field/rest_export_1/row_options');
-    $this->assertNoText('created');
+    $this->assertSession()->pageTextNotContains('created');
   }
 
   /**
diff --git a/core/modules/search/tests/src/Functional/SearchAdvancedSearchFormTest.php b/core/modules/search/tests/src/Functional/SearchAdvancedSearchFormTest.php
index fe3b102363d68209eb3a030c2b43305830d4bd74..1189a5e93ac8824475e666aadb16a062d6a7434d 100644
--- a/core/modules/search/tests/src/Functional/SearchAdvancedSearchFormTest.php
+++ b/core/modules/search/tests/src/Functional/SearchAdvancedSearchFormTest.php
@@ -61,7 +61,7 @@ public function testNodeType() {
 
     // Search for the dummy title with a GET query.
     $this->drupalGet('search/node', ['query' => ['keys' => $dummy_title]]);
-    $this->assertNoText($this->node->label());
+    $this->assertSession()->pageTextNotContains($this->node->label());
 
     // Search for the title of the node with a GET query.
     $this->drupalGet('search/node', ['query' => ['keys' => $this->node->label()]]);
diff --git a/core/modules/search/tests/src/Functional/SearchBlockTest.php b/core/modules/search/tests/src/Functional/SearchBlockTest.php
index 0eeab4d6f2d1feaebcb9399daff91fe62d9b7ce4..c1c18c7b919bd30a4d831a2330ec8c25fa34e16e 100644
--- a/core/modules/search/tests/src/Functional/SearchBlockTest.php
+++ b/core/modules/search/tests/src/Functional/SearchBlockTest.php
@@ -119,16 +119,16 @@ public function testSearchFormBlock() {
     $this->drupalGet('node');
     $this->submitForm(['keys' => $this->randomMachineName(1)], 'Search');
     $this->assertSession()->pageTextContains('You must include at least one keyword to match in the content');
-    $this->assertNoText('Please enter some keywords');
+    $this->assertSession()->pageTextNotContains('Please enter some keywords');
     $this->submitForm(['keys' => $this->randomMachineName()], 'Search', 'search-block-form');
-    $this->assertNoText('You must include at least one keyword to match in the content');
+    $this->assertSession()->pageTextNotContains('You must include at least one keyword to match in the content');
 
     // Same test again, using the search page form for the second search this
     // time.
     $this->drupalGet('node');
     $this->submitForm(['keys' => $this->randomMachineName(1)], 'Search');
     $this->submitForm(['keys' => $this->randomMachineName()], 'Search', 'search-form');
-    $this->assertNoText('You must include at least one keyword to match in the content');
+    $this->assertSession()->pageTextNotContains('You must include at least one keyword to match in the content');
 
     // Edit the block configuration so that it searches users instead of nodes,
     // and test.
diff --git a/core/modules/search/tests/src/Functional/SearchCommentCountToggleTest.php b/core/modules/search/tests/src/Functional/SearchCommentCountToggleTest.php
index 2560e2f8de6267365ee5af9efa5a19d867524101..b95a74ec5a7a6ac855099d55ad2941be846c1916 100644
--- a/core/modules/search/tests/src/Functional/SearchCommentCountToggleTest.php
+++ b/core/modules/search/tests/src/Functional/SearchCommentCountToggleTest.php
@@ -106,7 +106,7 @@ public function testSearchCommentCountToggle() {
     $this->searchableNodes['1 comment']->save();
 
     $this->submitForm($edit, 'Search');
-    $this->assertNoText('0 comments');
+    $this->assertSession()->pageTextNotContains('0 comments');
     $this->assertSession()->pageTextContains('1 comment');
 
     // Test comment count display for nodes with comment status set to Hidden
@@ -116,8 +116,8 @@ public function testSearchCommentCountToggle() {
     $this->searchableNodes['1 comment']->save();
 
     $this->submitForm($edit, 'Search');
-    $this->assertNoText('0 comments');
-    $this->assertNoText('1 comment');
+    $this->assertSession()->pageTextNotContains('0 comments');
+    $this->assertSession()->pageTextNotContains('1 comment');
   }
 
 }
diff --git a/core/modules/search/tests/src/Functional/SearchCommentTest.php b/core/modules/search/tests/src/Functional/SearchCommentTest.php
index 44a77dae5fd7033b9ef72cdba064cb64c9abf981..ab237c402343e0e4c79df53cc7e4c8d14fc009ac 100644
--- a/core/modules/search/tests/src/Functional/SearchCommentTest.php
+++ b/core/modules/search/tests/src/Functional/SearchCommentTest.php
@@ -375,7 +375,7 @@ public function testAddNewComment() {
     $this->drupalGet('search/node');
     $this->submitForm(['keys' => 'short'], 'Search');
     $this->assertSession()->pageTextContains($node->label());
-    $this->assertNoText('Add new comment');
+    $this->assertSession()->pageTextNotContains('Add new comment');
   }
 
 }
diff --git a/core/modules/search/tests/src/Functional/SearchConfigSettingsFormTest.php b/core/modules/search/tests/src/Functional/SearchConfigSettingsFormTest.php
index 27dcbcfffb97fed68feab89b6a5cf16eb0598a90..8518df08055ceb999020ad48e7982bbf17b049d0 100644
--- a/core/modules/search/tests/src/Functional/SearchConfigSettingsFormTest.php
+++ b/core/modules/search/tests/src/Functional/SearchConfigSettingsFormTest.php
@@ -111,7 +111,7 @@ public function testSearchSettingsPage() {
     ];
     $this->drupalGet('admin/config/search/pages');
     $this->submitForm($edit, 'Save configuration');
-    $this->assertNoText('The configuration options have been saved.');
+    $this->assertSession()->pageTextNotContains('The configuration options have been saved.');
 
     // Test logging setting. It should be off by default.
     $text = $this->randomMachineName(5);
@@ -190,14 +190,14 @@ public function testSearchModuleDisabling() {
       $info = $plugin_info[$entity_id];
       $this->drupalGet('search/' . $entity->getPath(), ['query' => ['keys' => $info['keys']]]);
       $this->assertSession()->statusCodeEquals(200);
-      $this->assertNoText('no results');
+      $this->assertSession()->pageTextNotContains('no results');
       $this->assertSession()->pageTextContains($info['text']);
 
       // Verify that other plugin search tab labels are not visible.
       foreach ($plugins as $other) {
         if ($other != $entity_id) {
-          $label = $entities[$other]->label();
-          $this->assertNoText($label);
+          $path = 'search/' . $entities[$other]->getPath();
+          $this->assertSession()->elementNotExists('xpath', '//ul[@class="tabs primary"]/li/a[@data-drupal-link-system-path="' . $path . '"]');
         }
       }
 
@@ -236,8 +236,9 @@ public function testSearchModuleDisabling() {
     foreach ($paths as $item) {
       $this->drupalGet($item['path'], $item['options']);
       foreach ($plugins as $entity_id) {
+        $path = 'search/' . $entities[$entity_id]->getPath();
         $label = $entities[$entity_id]->label();
-        $this->assertSession()->pageTextContains($label);
+        $this->assertSession()->elementTextContains('xpath', '//ul[@class="tabs primary"]/li/a[@data-drupal-link-system-path="' . $path . '"]', $label);
       }
     }
   }
diff --git a/core/modules/search/tests/src/Functional/SearchEmbedFormTest.php b/core/modules/search/tests/src/Functional/SearchEmbedFormTest.php
index 3d14007093952eb03e8813064bc1aec29c4832c6..22fac20176805e8937f549f51b2b64e46a0d51bb 100644
--- a/core/modules/search/tests/src/Functional/SearchEmbedFormTest.php
+++ b/core/modules/search/tests/src/Functional/SearchEmbedFormTest.php
@@ -82,7 +82,7 @@ public function testEmbeddedForm() {
     // our form being submitted.
     $this->drupalGet('search');
     $this->submitForm(['keys' => 'foo'], 'Search');
-    $this->assertNoText('Test form was submitted');
+    $this->assertSession()->pageTextNotContains('Test form was submitted');
     $count = \Drupal::state()->get('search_embedded_form.submit_count');
     $this->assertEquals($this->submitCount, $count, 'Form submission count is correct');
     $this->submitCount = $count;
diff --git a/core/modules/search/tests/src/Functional/SearchExactTest.php b/core/modules/search/tests/src/Functional/SearchExactTest.php
index 5a29c77249f7876fba1f6620679e8285880a0354..8ae6cc1d3787ef120ccb8483d56018ef33fff615 100644
--- a/core/modules/search/tests/src/Functional/SearchExactTest.php
+++ b/core/modules/search/tests/src/Functional/SearchExactTest.php
@@ -89,8 +89,8 @@ public function testExactQuery() {
     $edit = ['keys' => 'Druplicon'];
     $this->drupalGet('search/node');
     $this->submitForm($edit, 'Search');
-    $this->assertNoText($user->getAccountName());
-    $this->assertNoText($this->container->get('date.formatter')->format($node->getChangedTime(), 'short'));
+    $this->assertSession()->pageTextNotContains($user->getAccountName());
+    $this->assertSession()->pageTextNotContains($this->container->get('date.formatter')->format($node->getChangedTime(), 'short'));
 
   }
 
diff --git a/core/modules/search/tests/src/Functional/SearchKeywordsConditionsTest.php b/core/modules/search/tests/src/Functional/SearchKeywordsConditionsTest.php
index 563fcedf65ee25e7fcc37ca2b1d9f255e4d8dfb2..dbc42e2d3e3a53c9a4ce9796701f02df52c46ba6 100644
--- a/core/modules/search/tests/src/Functional/SearchKeywordsConditionsTest.php
+++ b/core/modules/search/tests/src/Functional/SearchKeywordsConditionsTest.php
@@ -58,7 +58,7 @@ protected function setUp(): void {
   public function testSearchKeywordsConditions() {
     // No keys, not conditions - no results.
     $this->drupalGet('search/dummy_path');
-    $this->assertNoText('Dummy search snippet to display');
+    $this->assertSession()->pageTextNotContains('Dummy search snippet to display');
     // With keys - get results.
     $keys = 'bike shed ' . $this->randomMachineName();
     $this->drupalGet("search/dummy_path", ['query' => ['keys' => $keys]]);
diff --git a/core/modules/search/tests/src/Functional/SearchNodeUpdateAndDeletionTest.php b/core/modules/search/tests/src/Functional/SearchNodeUpdateAndDeletionTest.php
index 564a3fb13261ef3fe98d324f993a922b19300caf..649bbfe6f05e5dd9b9f8ddf00611c0eed77e6317 100644
--- a/core/modules/search/tests/src/Functional/SearchNodeUpdateAndDeletionTest.php
+++ b/core/modules/search/tests/src/Functional/SearchNodeUpdateAndDeletionTest.php
@@ -126,7 +126,7 @@ public function testSearchIndexUpdateOnNodeDeletion() {
     // Search again to verify the node doesn't appear anymore.
     $this->drupalGet('search/node');
     $this->submitForm($edit, 'Search');
-    $this->assertNoText($node->label());
+    $this->assertSession()->pageTextNotContains($node->label());
   }
 
 }
diff --git a/core/modules/search/tests/src/Functional/SearchNumberMatchingTest.php b/core/modules/search/tests/src/Functional/SearchNumberMatchingTest.php
index f3b874c76566587a78858c9a24e19cb45247339e..f2aab18eabdaa42f5333215811bc9b68a624e735 100644
--- a/core/modules/search/tests/src/Functional/SearchNumberMatchingTest.php
+++ b/core/modules/search/tests/src/Functional/SearchNumberMatchingTest.php
@@ -98,7 +98,7 @@ public function testNumberSearching() {
       // with a dummy search.
       $this->drupalGet('search/node');
       $this->submitForm(['keys' => 'foo'], 'Search');
-      $this->assertNoText($node->label());
+      $this->assertSession()->pageTextNotContains($node->label());
 
       // Now verify that we can find node i by searching for any of the
       // numbers.
diff --git a/core/modules/search/tests/src/Functional/SearchNumbersTest.php b/core/modules/search/tests/src/Functional/SearchNumbersTest.php
index 91bd8f81dbee34a3c00f66ddc6151eb92ed626dc..d8c335b1ef90b1169bf908eb2c01f5d3126fcc21 100644
--- a/core/modules/search/tests/src/Functional/SearchNumbersTest.php
+++ b/core/modules/search/tests/src/Functional/SearchNumbersTest.php
@@ -111,7 +111,7 @@ public function testNumberSearching() {
       // with a dummy search.
       $this->drupalGet('search/node');
       $this->submitForm(['keys' => 'foo'], 'Search');
-      $this->assertNoText($node->label());
+      $this->assertSession()->pageTextNotContains($node->label());
 
       // Verify that the node title does appear as a link on the search page
       // when searching for the number.
diff --git a/core/modules/search/tests/src/Functional/SearchPageTextTest.php b/core/modules/search/tests/src/Functional/SearchPageTextTest.php
index 258ef6d504aed31c72420f7b697192d217f7ab77..91d568d795ef287fd4f1ddb7fd6890b780dafbd5 100644
--- a/core/modules/search/tests/src/Functional/SearchPageTextTest.php
+++ b/core/modules/search/tests/src/Functional/SearchPageTextTest.php
@@ -84,8 +84,8 @@ public function testSearchText() {
     $this->assertSession()->pageTextContains('Search');
     $title_source = 'Search for @keywords | Drupal';
     $this->assertSession()->titleEquals('Search for ' . Unicode::truncate($search_terms, 60, TRUE, TRUE) . ' | Drupal');
-    $this->assertNoText('Node');
-    $this->assertNoText('Node');
+    $this->assertSession()->pageTextNotContains('Node');
+    $this->assertSession()->pageTextNotContains('Node');
     $this->assertSession()->pageTextContains('Content');
 
     $this->clickLink('About searching');
@@ -155,12 +155,12 @@ public function testSearchText() {
     $this->submitForm([
       'or' => $this->randomMachineName() . ' ' . $this->randomMachineName(),
     ], 'edit-submit--2');
-    $this->assertNoText('Please enter some keywords');
+    $this->assertSession()->pageTextNotContains('Please enter some keywords');
     $this->drupalGet('search/node');
     $this->submitForm([
       'phrase' => '"' . $this->randomMachineName() . '" "' . $this->randomMachineName() . '"',
     ], 'edit-submit--2');
-    $this->assertNoText('Please enter some keywords');
+    $this->assertSession()->pageTextNotContains('Please enter some keywords');
 
     // Verify that if you search for a too-short keyword, you get the right
     // message, and that if after that you search for a longer keyword, you
@@ -168,9 +168,9 @@ public function testSearchText() {
     $this->drupalGet('search/node');
     $this->submitForm(['keys' => $this->randomMachineName(1)], 'Search');
     $this->assertSession()->pageTextContains('You must include at least one keyword');
-    $this->assertNoText('Please enter some keywords');
+    $this->assertSession()->pageTextNotContains('Please enter some keywords');
     $this->submitForm(['keys' => $this->randomMachineName()], 'Search');
-    $this->assertNoText('You must include at least one keyword');
+    $this->assertSession()->pageTextNotContains('You must include at least one keyword');
 
     // Test that if you search for a URL with .. in it, you still end up at
     // the search page. See issue https://www.drupal.org/node/890058.
diff --git a/core/modules/search/tests/src/Functional/SearchQueryAlterTest.php b/core/modules/search/tests/src/Functional/SearchQueryAlterTest.php
index 9a03c817736072be11a43b0af2c00366a7089840..3ae77f1969688caa43adabc90053e9f3c1ee9a1c 100644
--- a/core/modules/search/tests/src/Functional/SearchQueryAlterTest.php
+++ b/core/modules/search/tests/src/Functional/SearchQueryAlterTest.php
@@ -55,7 +55,7 @@ public function testQueryAlter() {
     $this->submitForm(['keys' => 'pizza'], 'Search');
     // The article should be there but not the page.
     $this->assertSession()->pageTextContains('article');
-    $this->assertNoText('page');
+    $this->assertSession()->pageTextNotContains('page');
   }
 
 }
diff --git a/core/modules/statistics/tests/src/Functional/StatisticsAdminTest.php b/core/modules/statistics/tests/src/Functional/StatisticsAdminTest.php
index 0b9418ab14abd320b077104ebc60dd7191abea9e..445a53d15a5daa2de0f284693d25b3dbda597ac5 100644
--- a/core/modules/statistics/tests/src/Functional/StatisticsAdminTest.php
+++ b/core/modules/statistics/tests/src/Functional/StatisticsAdminTest.php
@@ -174,7 +174,7 @@ public function testExpiredLogs() {
 
     // Verify that no hit URL is found.
     $this->drupalGet('admin/reports/pages');
-    $this->assertNoText('node/' . $this->testNode->id());
+    $this->assertSession()->pageTextNotContains('node/' . $this->testNode->id());
 
     $result = Database::getConnection()->select('node_counter', 'nc')
       ->fields('nc', ['daycount'])
diff --git a/core/modules/system/tests/src/Functional/Bootstrap/DrupalMessengerServiceTest.php b/core/modules/system/tests/src/Functional/Bootstrap/DrupalMessengerServiceTest.php
index c86611197a4af5da7f2f2772e6d96484859bb50d..32faab1b34c14d94719b7fafa36673fd242b7c0b 100644
--- a/core/modules/system/tests/src/Functional/Bootstrap/DrupalMessengerServiceTest.php
+++ b/core/modules/system/tests/src/Functional/Bootstrap/DrupalMessengerServiceTest.php
@@ -31,7 +31,7 @@ public function testDrupalMessengerService() {
     // The page at system_test.messenger_service route sets two messages and
     // then removes the first before it is displayed.
     $this->drupalGet(Url::fromRoute('system_test.messenger_service'));
-    $this->assertNoText('First message (removed).');
+    $this->assertSession()->pageTextNotContains('First message (removed).');
     $this->assertRaw(t('Second message with <em>markup!</em> (not removed).'));
 
     // Ensure duplicate messages are handled as expected.
diff --git a/core/modules/system/tests/src/Functional/DrupalKernel/ContentNegotiationTest.php b/core/modules/system/tests/src/Functional/DrupalKernel/ContentNegotiationTest.php
index acea9d9bac4cdfe11073fae53a706efe3883ec04..f500f78b533b67f8a0df8d25b060fc74d1c020a4 100644
--- a/core/modules/system/tests/src/Functional/DrupalKernel/ContentNegotiationTest.php
+++ b/core/modules/system/tests/src/Functional/DrupalKernel/ContentNegotiationTest.php
@@ -42,7 +42,7 @@ public function testBogusAcceptHeader() {
     ];
     foreach ($tests as $case => $header) {
       $this->drupalGet('', [], ['Accept: ' . $header]);
-      $this->assertNoText('Unsupported Media Type');
+      $this->assertSession()->pageTextNotContains('Unsupported Media Type');
       $this->assertSession()->pageTextContains('Log in');
     }
   }
diff --git a/core/modules/system/tests/src/Functional/Entity/EntityRevisionsTest.php b/core/modules/system/tests/src/Functional/Entity/EntityRevisionsTest.php
index 9e0d26f57a1816e6ca041830d739f053161fa554..ed0e74d31fbad56e0f5fa799881031e231eda935 100644
--- a/core/modules/system/tests/src/Functional/Entity/EntityRevisionsTest.php
+++ b/core/modules/system/tests/src/Functional/Entity/EntityRevisionsTest.php
@@ -212,11 +212,11 @@ public function testEntityRevisionParamConverter() {
 
     $this->drupalGet($revision_url);
     $this->assertSession()->pageTextContains('pending revision - en');
-    $this->assertNoText('pending revision - de');
+    $this->assertSession()->pageTextNotContains('pending revision - de');
 
     $this->drupalGet('de/' . $revision_url);
     $this->assertSession()->pageTextContains('pending revision - de');
-    $this->assertNoText('pending revision - en');
+    $this->assertSession()->pageTextNotContains('pending revision - en');
   }
 
   /**
diff --git a/core/modules/system/tests/src/Functional/File/ConfigTest.php b/core/modules/system/tests/src/Functional/File/ConfigTest.php
index 313a118d7012291f779fcf0b2d1c5ed5e83f3f9b..3fb94889f0071d67b7bb7c1c92610104af09a659 100644
--- a/core/modules/system/tests/src/Functional/File/ConfigTest.php
+++ b/core/modules/system/tests/src/Functional/File/ConfigTest.php
@@ -57,7 +57,7 @@ public function testFileConfigurationPage() {
 
     $this->drupalGet('admin/config/media/file-system');
     $this->assertSession()->pageTextContains('Public local files served by the webserver.');
-    $this->assertNoText('Private local files served by Drupal.');
+    $this->assertSession()->pageTextNotContains('Private local files served by Drupal.');
   }
 
 }
diff --git a/core/modules/system/tests/src/Functional/Form/ElementsAccessTest.php b/core/modules/system/tests/src/Functional/Form/ElementsAccessTest.php
index 7f90505dc8fde1c2189741fd849470e5c5f3b7de..3eac1b6cd539425c90105e2375c638cd15826f1e 100644
--- a/core/modules/system/tests/src/Functional/Form/ElementsAccessTest.php
+++ b/core/modules/system/tests/src/Functional/Form/ElementsAccessTest.php
@@ -29,12 +29,12 @@ class ElementsAccessTest extends BrowserTestBase {
   public function testAccessFalse() {
     $this->drupalGet('form_test/vertical-tabs-access');
     $this->submitForm([], 'Submit');
-    $this->assertNoText('This checkbox inside a vertical tab does not have its default value.');
-    $this->assertNoText('This textfield inside a vertical tab does not have its default value.');
-    $this->assertNoText('This checkbox inside a fieldset does not have its default value.');
-    $this->assertNoText('This checkbox inside a container does not have its default value.');
-    $this->assertNoText('This checkbox inside a nested container does not have its default value.');
-    $this->assertNoText('This checkbox inside a vertical tab whose fieldset access is allowed does not have its default value.');
+    $this->assertSession()->pageTextNotContains('This checkbox inside a vertical tab does not have its default value.');
+    $this->assertSession()->pageTextNotContains('This textfield inside a vertical tab does not have its default value.');
+    $this->assertSession()->pageTextNotContains('This checkbox inside a fieldset does not have its default value.');
+    $this->assertSession()->pageTextNotContains('This checkbox inside a container does not have its default value.');
+    $this->assertSession()->pageTextNotContains('This checkbox inside a nested container does not have its default value.');
+    $this->assertSession()->pageTextNotContains('This checkbox inside a vertical tab whose fieldset access is allowed does not have its default value.');
     $this->assertSession()->pageTextContains('The form submitted correctly.');
   }
 
diff --git a/core/modules/system/tests/src/Functional/Form/FormStoragePageCacheTest.php b/core/modules/system/tests/src/Functional/Form/FormStoragePageCacheTest.php
index 6bdefd2682c775433b999afd85d79bc1fe845870..629dbec687792cf0752a54b475e981cdf51e93c0 100644
--- a/core/modules/system/tests/src/Functional/Form/FormStoragePageCacheTest.php
+++ b/core/modules/system/tests/src/Functional/Form/FormStoragePageCacheTest.php
@@ -103,8 +103,8 @@ public function testRebuildFormStorageOnCachedPage() {
     // that initial build ID.
     $edit = ['title' => 'something'];
     $this->submitForm($edit, 'Rebuild');
-    $this->assertNoText('No old build id');
-    $this->assertNoText($build_id_initial);
+    $this->assertSession()->pageTextNotContains('No old build id');
+    $this->assertSession()->pageTextNotContains($build_id_initial);
     $build_id_first_rebuild = $this->getFormBuildId();
     $this->assertNotEquals($build_id_initial, $build_id_first_rebuild, 'Build id changes on first rebuild.');
 
diff --git a/core/modules/system/tests/src/Functional/Form/FormTest.php b/core/modules/system/tests/src/Functional/Form/FormTest.php
index 74dd371a1e2cff24e79ef1a871fc0ca1f8f4b008..e87ab2e9a3a24d36b1de3839251d9cf7bd8c6d9e 100644
--- a/core/modules/system/tests/src/Functional/Form/FormTest.php
+++ b/core/modules/system/tests/src/Functional/Form/FormTest.php
@@ -428,7 +428,7 @@ public function testSelect() {
         'multiple_no_default',
     ];
     foreach ($no_errors as $key) {
-      $this->assertNoText($form[$key]['#title'] . ' field is required.');
+      $this->assertSession()->pageTextNotContains($form[$key]['#title'] . ' field is required.');
     }
 
     $expected_errors = [
diff --git a/core/modules/system/tests/src/Functional/Form/ModulesListFormWebTest.php b/core/modules/system/tests/src/Functional/Form/ModulesListFormWebTest.php
index 8ee9e9daed3594fe7fbdb22a6cab8b0da38190e2..03e55c1a07e9cb28526a5674446265351caf5421 100644
--- a/core/modules/system/tests/src/Functional/Form/ModulesListFormWebTest.php
+++ b/core/modules/system/tests/src/Functional/Form/ModulesListFormWebTest.php
@@ -161,7 +161,7 @@ public function testInstalledIncompatibleModule() {
 
       file_put_contents($file_path, Yaml::encode($compatible_info));
       $this->drupalGet('admin/modules');
-      $this->assertNoText($incompatible_modules_message);
+      $this->assertSession()->pageTextNotContains($incompatible_modules_message);
     }
     // Uninstall the module and ensure that incompatible modules message is not
     // displayed for modules that are not installed.
@@ -174,7 +174,7 @@ public function testInstalledIncompatibleModule() {
       $incompatible_info = $info + $incompatible_update;
       file_put_contents($file_path, Yaml::encode($incompatible_info));
       $this->drupalGet('admin/modules');
-      $this->assertNoText($incompatible_modules_message);
+      $this->assertSession()->pageTextNotContains($incompatible_modules_message);
     }
   }
 
diff --git a/core/modules/system/tests/src/Functional/Form/ValidationTest.php b/core/modules/system/tests/src/Functional/Form/ValidationTest.php
index bd53fcc4914e4a2c80be666681cd3b86bcbb7e42..7cac1f9b13fa2141566a259bef33ba2c329802b6 100644
--- a/core/modules/system/tests/src/Functional/Form/ValidationTest.php
+++ b/core/modules/system/tests/src/Functional/Form/ValidationTest.php
@@ -72,7 +72,7 @@ public function testValidate() {
       ->setValue('invalid_token');
     $this->submitForm(['name' => 'validate'], 'Save');
     $this->assertSession()->fieldValueNotEquals('name', '#value changed by #validate');
-    $this->assertNoText('Name value: value changed by setValueForElement() in #validate');
+    $this->assertSession()->pageTextNotContains('Name value: value changed by setValueForElement() in #validate');
     $this->assertSession()->pageTextContains('The form has become outdated.');
   }
 
@@ -115,7 +115,7 @@ public function testValidateLimitErrors() {
     // is triggered.
     $this->drupalGet($path);
     $this->submitForm($edit, 'Partial validate');
-    $this->assertNoText('Title field is required.');
+    $this->assertSession()->pageTextNotContains('Title field is required.');
     $this->assertSession()->pageTextContains('Test element is invalid');
 
     // Edge case of #limit_validation_errors containing numeric indexes: same
@@ -123,13 +123,13 @@ public function testValidateLimitErrors() {
     // 'test_numeric_index' field.
     $this->drupalGet($path);
     $this->submitForm($edit, 'Partial validate (numeric index)');
-    $this->assertNoText('Title field is required.');
+    $this->assertSession()->pageTextNotContains('Title field is required.');
     $this->assertSession()->pageTextContains('Test (numeric index) element is invalid');
 
     // Ensure something like 'foobar' isn't considered "inside" 'foo'.
     $this->drupalGet($path);
     $this->submitForm($edit, 'Partial validate (substring)');
-    $this->assertNoText('Title field is required.');
+    $this->assertSession()->pageTextNotContains('Title field is required.');
     $this->assertSession()->pageTextContains('Test (substring) foo element is invalid');
 
     // Ensure not validated values are not available to submit handlers.
@@ -227,15 +227,15 @@ public function testCustomRequiredError() {
 
     foreach (Element::children($form) as $key) {
       if (isset($form[$key]['#required_error'])) {
-        $this->assertNoText($form[$key]['#title'] . ' field is required.');
+        $this->assertSession()->pageTextNotContains($form[$key]['#title'] . ' field is required.');
         $this->assertSession()->pageTextContains((string) $form[$key]['#required_error']);
       }
       elseif (isset($form[$key]['#form_test_required_error'])) {
-        $this->assertNoText($form[$key]['#title'] . ' field is required.');
+        $this->assertSession()->pageTextNotContains($form[$key]['#title'] . ' field is required.');
         $this->assertSession()->pageTextContains((string) $form[$key]['#form_test_required_error']);
       }
     }
-    $this->assertNoText('An illegal choice has been detected. Please contact the site administrator.');
+    $this->assertSession()->pageTextNotContains('An illegal choice has been detected. Please contact the site administrator.');
 
     // Verify that no custom validation error appears with valid values.
     $edit = [
@@ -248,15 +248,15 @@ public function testCustomRequiredError() {
 
     foreach (Element::children($form) as $key) {
       if (isset($form[$key]['#required_error'])) {
-        $this->assertNoText($form[$key]['#title'] . ' field is required.');
-        $this->assertNoText((string) $form[$key]['#required_error']);
+        $this->assertSession()->pageTextNotContains($form[$key]['#title'] . ' field is required.');
+        $this->assertSession()->pageTextNotContains((string) $form[$key]['#required_error']);
       }
       elseif (isset($form[$key]['#form_test_required_error'])) {
-        $this->assertNoText($form[$key]['#title'] . ' field is required.');
-        $this->assertNoText((string) $form[$key]['#form_test_required_error']);
+        $this->assertSession()->pageTextNotContains($form[$key]['#title'] . ' field is required.');
+        $this->assertSession()->pageTextNotContains((string) $form[$key]['#form_test_required_error']);
       }
     }
-    $this->assertNoText('An illegal choice has been detected. Please contact the site administrator.');
+    $this->assertSession()->pageTextNotContains('An illegal choice has been detected. Please contact the site administrator.');
   }
 
 }
diff --git a/core/modules/system/tests/src/Functional/Menu/MenuRouterTest.php b/core/modules/system/tests/src/Functional/Menu/MenuRouterTest.php
index f7902c7c0bc9d024f7cfedd5b204de6c4ea74b4a..249a45c6bfac566a281b1fff945d2d2eac13b26e 100644
--- a/core/modules/system/tests/src/Functional/Menu/MenuRouterTest.php
+++ b/core/modules/system/tests/src/Functional/Menu/MenuRouterTest.php
@@ -80,7 +80,7 @@ protected function doTestHookMenuIntegration() {
   protected function doTestTitleCallbackFalse() {
     $this->drupalGet('test-page');
     $this->assertSession()->pageTextContains('A title with @placeholder', 'Raw text found on the page');
-    $this->assertNoText('A title with some other text', 'Text with placeholder substitutions not found.');
+    $this->assertSession()->pageTextNotContains('A title with some other text', 'Text with placeholder substitutions not found.');
   }
 
   /**
@@ -89,7 +89,7 @@ protected function doTestTitleCallbackFalse() {
   protected function doTestTitleMenuCallback() {
     // Verify that the menu router item title is not visible.
     $this->drupalGet('');
-    $this->assertNoText('Menu Callback Title');
+    $this->assertSession()->pageTextNotContains('Menu Callback Title');
     // Verify that the menu router item title is output as page title.
     $this->drupalGet('menu_callback_title');
     $this->assertSession()->pageTextContains('Menu Callback Title');
@@ -200,7 +200,7 @@ protected function doTestExoticPath() {
       "éøïвβ中國書۞";
     $this->drupalGet($path);
     $this->assertRaw('This is the menuTestCallback content.');
-    $this->assertNoText('The website encountered an unexpected error. Please try again later.');
+    $this->assertSession()->pageTextNotContains('The website encountered an unexpected error. Please try again later.');
   }
 
   /**
diff --git a/core/modules/system/tests/src/Functional/Module/ClassLoaderTest.php b/core/modules/system/tests/src/Functional/Module/ClassLoaderTest.php
index 0c07984f229f7561cc4ab1ef7d2bb44a856326da..adbb9901a825e2f0cba92232a820298d6a0dccd9 100644
--- a/core/modules/system/tests/src/Functional/Module/ClassLoaderTest.php
+++ b/core/modules/system/tests/src/Functional/Module/ClassLoaderTest.php
@@ -59,7 +59,7 @@ public function testClassLoadingNotInstalledModules() {
     for ($i = 0; $i < 2; $i++) {
       $this->drupalGet('module-test/class-loading');
       $this->assertSession()->statusCodeEquals(200);
-      $this->assertNoText($this->expected);
+      $this->assertSession()->pageTextNotContains($this->expected);
     }
   }
 
@@ -79,7 +79,7 @@ public function testClassLoadingDisabledModules() {
     for ($i = 0; $i < 2; $i++) {
       $this->drupalGet('module-test/class-loading');
       $this->assertSession()->statusCodeEquals(200);
-      $this->assertNoText($this->expected);
+      $this->assertSession()->pageTextNotContains($this->expected);
     }
   }
 
diff --git a/core/modules/system/tests/src/Functional/Module/ExperimentalModuleTest.php b/core/modules/system/tests/src/Functional/Module/ExperimentalModuleTest.php
index 4d704514eb2f77bf644ef198e425a587f5090ecf..8f34316a3a9e45e3168b1344b0040b17148cf95c 100644
--- a/core/modules/system/tests/src/Functional/Module/ExperimentalModuleTest.php
+++ b/core/modules/system/tests/src/Functional/Module/ExperimentalModuleTest.php
@@ -48,7 +48,7 @@ public function testExperimentalConfirmForm() {
     $this->drupalGet('admin/modules');
     $this->submitForm($edit, 'Install');
     $this->assertSession()->pageTextContains('Module Test page has been enabled.');
-    $this->assertNoText('Experimental modules are provided for testing purposes only.');
+    $this->assertSession()->pageTextNotContains('Experimental modules are provided for testing purposes only.');
 
     // Uninstall the module.
     \Drupal::service('module_installer')->uninstall(['test_page_test']);
@@ -63,12 +63,12 @@ public function testExperimentalConfirmForm() {
 
     // The module should not be enabled and there should be a warning and a
     // list of the experimental modules with only this one.
-    $this->assertNoText('Experimental Test has been enabled.');
+    $this->assertSession()->pageTextNotContains('Experimental Test has been enabled.');
     $this->assertSession()->pageTextContains('Experimental modules are provided for testing purposes only.');
     $this->assertSession()->pageTextContains('The following modules are experimental: Experimental Test');
 
     // There should be no message about enabling dependencies.
-    $this->assertNoText('You must enable');
+    $this->assertSession()->pageTextNotContains('You must enable');
 
     // Enable the module and confirm that it worked.
     $this->submitForm([], 'Continue');
@@ -86,14 +86,14 @@ public function testExperimentalConfirmForm() {
 
     // The module should not be enabled and there should be a warning and a
     // list of the experimental modules with only this one.
-    $this->assertNoText('2 modules have been enabled: Experimental Dependency Test, Experimental Test');
+    $this->assertSession()->pageTextNotContains('2 modules have been enabled: Experimental Dependency Test, Experimental Test');
     $this->assertSession()->pageTextContains('Experimental modules are provided for testing purposes only.');
 
     $this->assertSession()->pageTextContains('The following modules are experimental: Experimental Test');
 
     // Ensure the non-experimental module is not listed as experimental.
-    $this->assertNoText('The following modules are experimental: Experimental Test, Experimental Dependency Test');
-    $this->assertNoText('The following modules are experimental: Experimental Dependency Test');
+    $this->assertSession()->pageTextNotContains('The following modules are experimental: Experimental Test, Experimental Dependency Test');
+    $this->assertSession()->pageTextNotContains('The following modules are experimental: Experimental Dependency Test');
 
     // There should be a message about enabling dependencies.
     $this->assertSession()->pageTextContains('You must enable the Experimental Test module to install Experimental Dependency Test');
@@ -116,17 +116,17 @@ public function testExperimentalConfirmForm() {
 
     // The module should not be enabled and there should be a warning and a
     // list of the experimental modules with only this one.
-    $this->assertNoText('2 modules have been enabled: Experimental Dependency Test, Experimental Test');
+    $this->assertSession()->pageTextNotContains('2 modules have been enabled: Experimental Dependency Test, Experimental Test');
     $this->assertSession()->pageTextContains('Experimental modules are provided for testing purposes only.');
 
     $this->assertSession()->pageTextContains('The following modules are experimental: Experimental Test');
 
     // Ensure the non-experimental module is not listed as experimental.
-    $this->assertNoText('The following modules are experimental: Experimental Dependency Test, Experimental Test');
-    $this->assertNoText('The following modules are experimental: Experimental Dependency Test');
+    $this->assertSession()->pageTextNotContains('The following modules are experimental: Experimental Dependency Test, Experimental Test');
+    $this->assertSession()->pageTextNotContains('The following modules are experimental: Experimental Dependency Test');
 
     // There should be no message about enabling dependencies.
-    $this->assertNoText('You must enable');
+    $this->assertSession()->pageTextNotContains('You must enable');
 
     // Enable the module and confirm that it worked.
     $this->submitForm([], 'Continue');
diff --git a/core/modules/system/tests/src/Functional/Module/PrepareUninstallTest.php b/core/modules/system/tests/src/Functional/Module/PrepareUninstallTest.php
index e89498430eaeeefe23c5bf553434f5032c9ead5f..fa4d1456b9e22493362bf910bec0dd716a0561b8 100644
--- a/core/modules/system/tests/src/Functional/Module/PrepareUninstallTest.php
+++ b/core/modules/system/tests/src/Functional/Module/PrepareUninstallTest.php
@@ -109,7 +109,7 @@ public function testUninstall() {
     $this->submitForm(['uninstall[taxonomy]' => TRUE], 'Uninstall');
     $this->submitForm([], 'Uninstall');
     $this->assertSession()->pageTextContains('The selected modules have been uninstalled.');
-    $this->assertNoText('Enables the categorization of content.');
+    $this->assertSession()->pageTextNotContains('Enables the categorization of content.');
 
     // Check Node cannot be uninstalled yet, there is content to be removed.
     $this->drupalGet('admin/modules/uninstall');
@@ -136,7 +136,7 @@ public function testUninstall() {
     }
 
     // Ensures there is no more count when not necessary.
-    $this->assertNoText('And 0 more content');
+    $this->assertSession()->pageTextNotContains('And 0 more content');
     $this->assertSession()->pageTextContains('This action cannot be undone.');
     $this->assertSession()->pageTextContains('Make a backup of your database if you want to be able to restore these items.');
 
@@ -170,7 +170,7 @@ public function testUninstall() {
     $this->submitForm(['uninstall[node]' => TRUE], 'Uninstall');
     $this->submitForm([], 'Uninstall');
     $this->assertSession()->pageTextContains('The selected modules have been uninstalled.');
-    $this->assertNoText('Allows content to be submitted to the site and displayed on pages.');
+    $this->assertSession()->pageTextNotContains('Allows content to be submitted to the site and displayed on pages.');
 
     // Ensure a 404 is returned when accessing a non-existent entity type.
     $this->drupalGet('admin/modules/uninstall/entity/node');
diff --git a/core/modules/system/tests/src/Functional/Module/UninstallTest.php b/core/modules/system/tests/src/Functional/Module/UninstallTest.php
index 00c08000ff1a9aada77357df394e9d1bbb731474..f3dcfa8796f6ecb0a766d56c9a584485317751f7 100644
--- a/core/modules/system/tests/src/Functional/Module/UninstallTest.php
+++ b/core/modules/system/tests/src/Functional/Module/UninstallTest.php
@@ -87,7 +87,7 @@ public function testUninstallPage() {
     $edit['uninstall[module_test]'] = TRUE;
     $this->drupalGet('admin/modules/uninstall');
     $this->submitForm($edit, 'Uninstall');
-    $this->assertNoText('Configuration deletions');
+    $this->assertSession()->pageTextNotContains('Configuration deletions');
     $this->assertSession()->pageTextContains('Configuration updates');
     $this->assertSession()->pageTextContains($node_type->label());
     $this->submitForm([], 'Uninstall');
@@ -101,7 +101,7 @@ public function testUninstallPage() {
     $this->drupalGet('admin/modules/uninstall');
     $this->submitForm($edit, 'Uninstall');
     $this->assertSession()->pageTextContains('Configuration deletions');
-    $this->assertNoText('Configuration updates');
+    $this->assertSession()->pageTextNotContains('Configuration updates');
 
     $entity_types = [];
     foreach ($node_dependencies as $entity) {
@@ -173,7 +173,7 @@ public function testFailedInstallStatus() {
     $this->submitForm($edit, 'Uninstall');
     $this->submitForm([], 'Uninstall');
     $this->assertSession()->pageTextContains('The selected modules have been uninstalled.');
-    $this->assertNoText('Module installer config test');
+    $this->assertSession()->pageTextNotContains('Module installer config test');
   }
 
 }
diff --git a/core/modules/system/tests/src/Functional/Session/SessionHttpsTest.php b/core/modules/system/tests/src/Functional/Session/SessionHttpsTest.php
index 1b12a18e8ce7b062c39bc36911dec549352682fb..0b679ad373e5e0a568c8fdfcaf151c600a6e5bd1 100644
--- a/core/modules/system/tests/src/Functional/Session/SessionHttpsTest.php
+++ b/core/modules/system/tests/src/Functional/Session/SessionHttpsTest.php
@@ -92,7 +92,7 @@ public function testHttpsSession() {
 
     // Verify that user is not logged in on non-secure URL.
     $this->drupalGet($this->httpUrl('admin/config'));
-    $this->assertNoText('Configuration');
+    $this->assertSession()->pageTextNotContains('Configuration');
     $this->assertSession()->statusCodeEquals(403);
 
     // Verify that empty SID cannot be used on the non-secure site.
diff --git a/core/modules/system/tests/src/Functional/Session/SessionTest.php b/core/modules/system/tests/src/Functional/Session/SessionTest.php
index 673a580f93c1223eb8dd0a0abfef8123f33ba5ec..acb5321b00a12ed4aa48f293f172fb437efefbde 100644
--- a/core/modules/system/tests/src/Functional/Session/SessionTest.php
+++ b/core/modules/system/tests/src/Functional/Session/SessionTest.php
@@ -131,7 +131,7 @@ public function testDataPersistence() {
     $this->sessionReset();
     // Verify that after logout, previous user's session data is not available.
     $this->drupalGet('session-test/get');
-    $this->assertNoText($value_1);
+    $this->assertSession()->pageTextNotContains($value_1);
 
     // Now try to store some data as an anonymous user.
     $value_3 = $this->randomMachineName();
@@ -158,7 +158,7 @@ public function testDataPersistence() {
     // Verify that the session persists for an authenticated user after
     // logging out and then back in.
     $this->drupalGet('session-test/get');
-    $this->assertNoText($value_1);
+    $this->assertSession()->pageTextNotContains($value_1);
 
     // Change session and create another user.
     $user2 = $this->drupalCreateUser([]);
@@ -226,7 +226,7 @@ public function testEmptyAnonymousSession() {
     $this->assertSessionCookie(FALSE);
     // @todo Reinstate when REQUEST and RESPONSE events fire for cached pages.
     // $this->assertSessionEmpty(TRUE);
-    $this->assertNoText('This is a dummy message.');
+    $this->assertSession()->pageTextNotContains('This is a dummy message.');
     $this->assertSession()->responseHeaderEquals('X-Drupal-Cache', 'HIT');
     $this->assertSession()->responseHeaderDoesNotExist('Set-Cookie');
 
@@ -240,7 +240,7 @@ public function testEmptyAnonymousSession() {
     $this->assertSessionCookie(FALSE);
     // @todo Reinstate when REQUEST and RESPONSE events fire for cached pages.
     // $this->assertSessionEmpty(TRUE);
-    $this->assertNoText('This is a dummy message.');
+    $this->assertSession()->pageTextNotContains('This is a dummy message.');
   }
 
   /**
diff --git a/core/modules/system/tests/src/Functional/System/AccessDeniedTest.php b/core/modules/system/tests/src/Functional/System/AccessDeniedTest.php
index d9744b1994621d29ac0446293d564b79807234bd..17a5343bb68192ead6dc62e2d1909a4cbe546a0d 100644
--- a/core/modules/system/tests/src/Functional/System/AccessDeniedTest.php
+++ b/core/modules/system/tests/src/Functional/System/AccessDeniedTest.php
@@ -131,7 +131,7 @@ public function testAccessDeniedCustomPageWithAccessDenied() {
     $this->config('system.site')->set('page.403', '/system-test/custom-4xx')->save();
 
     $this->drupalGet('/system-test/always-denied');
-    $this->assertNoText('Admin-only 4xx response');
+    $this->assertSession()->pageTextNotContains('Admin-only 4xx response');
     $this->assertSession()->pageTextContains('You are not authorized to access this page.');
     $this->assertSession()->statusCodeEquals(403);
     // Verify the access cacheability metadata for custom 403 is bubbled.
diff --git a/core/modules/system/tests/src/Functional/System/CronRunTest.php b/core/modules/system/tests/src/Functional/System/CronRunTest.php
index 72776c16eec00699a72260c165e8bd8aecde747f..95d2611e67d5b12d26abea664c9b113cd2ff2af9 100644
--- a/core/modules/system/tests/src/Functional/System/CronRunTest.php
+++ b/core/modules/system/tests/src/Functional/System/CronRunTest.php
@@ -117,7 +117,7 @@ public function testCronUI() {
     // Don't use REQUEST to calculate the exact time, because that will
     // fail randomly. Look for the word 'years', because without a timestamp,
     // the time will start at 1 January 1970.
-    $this->assertNoText('years');
+    $this->assertSession()->pageTextNotContains('years');
 
     $cron_last = time() - 200;
     \Drupal::state()->set('system.cron_last', $cron_last);
diff --git a/core/modules/system/tests/src/Functional/System/DateFormatsLockedTest.php b/core/modules/system/tests/src/Functional/System/DateFormatsLockedTest.php
index 1ee4c6fcb70537b4f81cdbd4e841b02a68c662e4..7158254ddf1a8b532fbb9fac6994677940220399 100644
--- a/core/modules/system/tests/src/Functional/System/DateFormatsLockedTest.php
+++ b/core/modules/system/tests/src/Functional/System/DateFormatsLockedTest.php
@@ -29,7 +29,7 @@ public function testDateLocking() {
     $this->assertSession()->linkByHrefExists('admin/config/regional/date-time/formats/manage/short');
     $this->assertSession()->linkByHrefNotExists('admin/config/regional/date-time/formats/manage/html_date');
     $this->assertSession()->pageTextContains('Fallback date format');
-    $this->assertNoText('short (locked)');
+    $this->assertSession()->pageTextNotContains('short (locked)');
 
     // Locked date formats are not editable.
     $this->drupalGet('admin/config/regional/date-time/formats/manage/short');
diff --git a/core/modules/system/tests/src/Functional/System/DateTimeTest.php b/core/modules/system/tests/src/Functional/System/DateTimeTest.php
index 690a469fb7afc365d46734d33d2c5813004bb3b3..16e7ee75206b68415bbfc7bc993d36c3a2eed1ed 100644
--- a/core/modules/system/tests/src/Functional/System/DateTimeTest.php
+++ b/core/modules/system/tests/src/Functional/System/DateTimeTest.php
@@ -263,7 +263,7 @@ public function testEnteringDateTimeViaSelectors() {
     $edit['field_dt[0][value][day]'] = '29';
     $this->drupalGet('node/add/page_with_date');
     $this->submitForm($edit, 'Save');
-    $this->assertNoText('Selected combination of day and month is not valid.');
+    $this->assertSession()->pageTextNotContains('Selected combination of day and month is not valid.');
 
     $this->drupalGet('node/1');
     $this->assertSession()->pageTextContains('Mon, 02/29/2016 - 01:30');
diff --git a/core/modules/system/tests/src/Functional/System/FrontPageTest.php b/core/modules/system/tests/src/Functional/System/FrontPageTest.php
index 6850eec4e4e996e05f17d8b9f9d1d2a27dacd149..7164f3365a15f05fe9c6e11eeac92eb824c16b99 100644
--- a/core/modules/system/tests/src/Functional/System/FrontPageTest.php
+++ b/core/modules/system/tests/src/Functional/System/FrontPageTest.php
@@ -66,7 +66,7 @@ public function testDrupalFrontPage() {
     $this->drupalGet('node');
     $this->assertSession()->pageTextContains('On front page.');
     $this->drupalGet($this->nodePath);
-    $this->assertNoText('On front page.');
+    $this->assertSession()->pageTextNotContains('On front page.');
 
     // Change the front page to an invalid path.
     $edit = ['site_frontpage' => '/kittens'];
@@ -90,7 +90,7 @@ public function testDrupalFrontPage() {
     $this->drupalGet('');
     $this->assertSession()->pageTextContains('On front page.');
     $this->drupalGet('node');
-    $this->assertNoText('On front page.');
+    $this->assertSession()->pageTextNotContains('On front page.');
     $this->drupalGet($this->nodePath);
     $this->assertSession()->pageTextContains('On front page.');
   }
diff --git a/core/modules/system/tests/src/Functional/System/PageNotFoundTest.php b/core/modules/system/tests/src/Functional/System/PageNotFoundTest.php
index 85e35aa6662ca63cb864ab3508a8d95da77fdde2..634c3ebe964ee66ed558fcfcace8e45aea9cdd11 100644
--- a/core/modules/system/tests/src/Functional/System/PageNotFoundTest.php
+++ b/core/modules/system/tests/src/Functional/System/PageNotFoundTest.php
@@ -77,7 +77,7 @@ public function testPageNotFoundCustomPageWithAccessDenied() {
     $this->config('system.site')->set('page.404', '/system-test/custom-4xx')->save();
 
     $this->drupalGet('/this-path-does-not-exist');
-    $this->assertNoText('Admin-only 4xx response');
+    $this->assertSession()->pageTextNotContains('Admin-only 4xx response');
     $this->assertSession()->pageTextContains('The requested page could not be found.');
     $this->assertSession()->statusCodeEquals(404);
     // Verify the access cacheability metadata for custom 404 is bubbled.
@@ -86,7 +86,7 @@ public function testPageNotFoundCustomPageWithAccessDenied() {
     $this->drupalLogin($this->adminUser);
     $this->drupalGet('/this-path-does-not-exist');
     $this->assertSession()->pageTextContains('Admin-only 4xx response');
-    $this->assertNoText('The requested page could not be found.');
+    $this->assertSession()->pageTextNotContains('The requested page could not be found.');
     $this->assertSession()->statusCodeEquals(404);
     // Verify the access cacheability metadata for custom 404 is bubbled.
     $this->assertCacheContext('user.roles');
diff --git a/core/modules/system/tests/src/Functional/System/SiteMaintenanceTest.php b/core/modules/system/tests/src/Functional/System/SiteMaintenanceTest.php
index 3dcbdb35429d7cb62ec47f2509b1f40d61d2f923..684e195d2323750bfa792c1d63cc12f74ddb5610 100644
--- a/core/modules/system/tests/src/Functional/System/SiteMaintenanceTest.php
+++ b/core/modules/system/tests/src/Functional/System/SiteMaintenanceTest.php
@@ -96,9 +96,9 @@ public function testSiteMaintenance() {
 
     // Verify that user is able to log in.
     $this->drupalGet('user');
-    $this->assertNoText($offline_message);
+    $this->assertSession()->pageTextNotContains($offline_message);
     $this->drupalGet('user/login');
-    $this->assertNoText($offline_message);
+    $this->assertSession()->pageTextNotContains($offline_message);
 
     // Log in user and verify that maintenance mode message is displayed
     // directly after login.
diff --git a/core/modules/system/tests/src/Functional/System/StatusTest.php b/core/modules/system/tests/src/Functional/System/StatusTest.php
index 717c4aa56e1649ae98e7f24ec72f831b534f53d6..1beb8513289bc18436ee392ccf70a5ce5b07d19c 100644
--- a/core/modules/system/tests/src/Functional/System/StatusTest.php
+++ b/core/modules/system/tests/src/Functional/System/StatusTest.php
@@ -60,7 +60,7 @@ public function testStatusPage() {
     }
 
     // If a module is fully installed no pending updates exists.
-    $this->assertNoText('Out of date');
+    $this->assertSession()->pageTextNotContains('Out of date');
 
     // The setting config_sync_directory is not properly formed.
     $this->assertRaw(t("Your %file file must define the %setting setting", ['%file' => $this->siteDirectory . '/settings.php', '%setting' => "\$settings['config_sync_directory']"]));
diff --git a/core/modules/system/tests/src/Functional/System/SystemAuthorizeTest.php b/core/modules/system/tests/src/Functional/System/SystemAuthorizeTest.php
index 2dec1ab4a4c3c06c7ee027216c038f6850035837..8f42feb75a66e99dd72c5519dec7b8e817e975a8 100644
--- a/core/modules/system/tests/src/Functional/System/SystemAuthorizeTest.php
+++ b/core/modules/system/tests/src/Functional/System/SystemAuthorizeTest.php
@@ -54,7 +54,7 @@ public function testFileTransferHooks() {
     $page_title = $this->randomMachineName(16);
     $this->drupalGetAuthorizePHP($page_title);
     $this->assertSession()->titleEquals("$page_title | Drupal");
-    $this->assertNoText('It appears you have reached this page in error.');
+    $this->assertSession()->pageTextNotContains('It appears you have reached this page in error.');
     $this->assertSession()->pageTextContains('To continue, provide your server connection details');
     // Make sure we see the new connection method added by system_test.
     $this->assertRaw('System Test FileTransfer');
diff --git a/core/modules/system/tests/src/Functional/System/ThemeTest.php b/core/modules/system/tests/src/Functional/System/ThemeTest.php
index 8c2f5a97bc3fabc2722c1029f18ec9360c939695..b41b76584b54eb7e613c3dfd7d7d2eb3d1b4864d 100644
--- a/core/modules/system/tests/src/Functional/System/ThemeTest.php
+++ b/core/modules/system/tests/src/Functional/System/ThemeTest.php
@@ -111,7 +111,7 @@ public function testThemeSettings() {
       ];
       $this->drupalGet('admin/appearance/settings');
       $this->submitForm($edit, 'Save configuration');
-      $this->assertNoText('The custom logo path is invalid.');
+      $this->assertSession()->pageTextNotContains('The custom logo path is invalid.');
       $this->assertSession()->fieldValueEquals('logo_path', $expected['form']);
 
       // Verify logo path examples.
@@ -231,8 +231,8 @@ public function testThemeSettings() {
     ];
     $this->drupalGet('admin/appearance/settings');
     $this->submitForm($edit, 'Save configuration');
-    $this->assertNoText('The custom logo path is invalid.');
-    $this->assertNoText('The custom favicon path is invalid.');
+    $this->assertSession()->pageTextNotContains('The custom logo path is invalid.');
+    $this->assertSession()->pageTextNotContains('The custom favicon path is invalid.');
   }
 
   /**
@@ -255,8 +255,8 @@ public function testThemeSettingsLogo() {
     // module is not enabled.
     \Drupal::service('module_installer')->uninstall(['file']);
     $this->drupalGet('admin/appearance/settings');
-    $this->assertNoText('Logo image settings');
-    $this->assertNoText('Shortcut icon settings');
+    $this->assertSession()->pageTextNotContains('Logo image settings');
+    $this->assertSession()->pageTextNotContains('Shortcut icon settings');
   }
 
   /**
@@ -483,7 +483,7 @@ public function testInstallAndSetAsDefault() {
       $this->assertEquals($theme_machine_name, $this->config('system.theme')->get('default'));
 
       // This checks for a regression. See https://www.drupal.org/node/2498691.
-      $this->assertNoText("The $theme_machine_name theme was not found.");
+      $this->assertSession()->pageTextNotContains("The $theme_machine_name theme was not found.");
 
       $themes = \Drupal::service('theme_handler')->rebuildThemeData();
       $version = $themes[$theme_machine_name]->info['version'];
diff --git a/core/modules/system/tests/src/Functional/Theme/ExperimentalThemeTest.php b/core/modules/system/tests/src/Functional/Theme/ExperimentalThemeTest.php
index 7cd097684daf5c7f2518c3e602a853078b6a145b..58a6e3933efb8811e0635d2676544a0db0759e1e 100644
--- a/core/modules/system/tests/src/Functional/Theme/ExperimentalThemeTest.php
+++ b/core/modules/system/tests/src/Functional/Theme/ExperimentalThemeTest.php
@@ -49,7 +49,7 @@ public function testExperimentalConfirmForm() {
     $this->drupalGet('admin/appearance');
     $this->cssSelect('a[title="Install <strong>Test theme</strong> theme"]')[0]->click();
     $this->assertSession()->pageTextContains('The <strong>Test theme</strong> theme has been installed.');
-    $this->assertNoText('Experimental modules are provided for testing purposes only.');
+    $this->assertSession()->pageTextNotContains('Experimental modules are provided for testing purposes only.');
 
     // Next, test installing an experimental theme with no dependencies.
     // There should be a confirmation form with an experimental warning, but no
@@ -60,11 +60,11 @@ public function testExperimentalConfirmForm() {
 
     // The module should not be enabled and there should be a warning and a
     // list of the experimental modules with only this one.
-    $this->assertNoText('The Experimental Test theme has been installed.');
+    $this->assertSession()->pageTextNotContains('The Experimental Test theme has been installed.');
     $this->assertSession()->pageTextContains('Experimental themes are provided for testing purposes only.');
 
     // There should be no message about enabling dependencies.
-    $this->assertNoText('You must enable');
+    $this->assertSession()->pageTextNotContains('You must enable');
 
     // Enable the theme and confirm that it worked.
     $this->submitForm([], 'Continue');
@@ -72,9 +72,9 @@ public function testExperimentalConfirmForm() {
 
     // Setting it as the default should not ask for another confirmation.
     $this->cssSelect('a[title="Set Experimental test as default theme"]')[0]->click();
-    $this->assertNoText('Experimental themes are provided for testing purposes only. Use at your own risk.');
+    $this->assertSession()->pageTextNotContains('Experimental themes are provided for testing purposes only. Use at your own risk.');
     $this->assertSession()->pageTextContains('Experimental test is now the default theme.');
-    $this->assertNoText(sprintf('Experimental test %s                (experimental theme)', \Drupal::VERSION));
+    $this->assertSession()->pageTextNotContains(sprintf('Experimental test %s                (experimental theme)', \Drupal::VERSION));
     $this->assertSession()->responseContains(sprintf('Experimental test %s                (default theme, administration theme, experimental theme)', \Drupal::VERSION));
 
     // Uninstall the theme.
@@ -96,13 +96,13 @@ public function testExperimentalConfirmForm() {
 
     // The theme should not be enabled and there should be a warning and a
     // list of the experimental modules with only this one.
-    $this->assertNoText('The Experimental dependency test theme has been installed.');
+    $this->assertSession()->pageTextNotContains('The Experimental dependency test theme has been installed.');
     $this->assertSession()->pageTextContains('Experimental themes are provided for testing purposes only. Use at your own risk.');
     $this->assertSession()->pageTextContains('The following themes are experimental: Experimental test');
 
     // Ensure the non-experimental theme is not listed as experimental.
-    $this->assertNoText('The following themes are experimental: Experimental test, Experimental dependency test');
-    $this->assertNoText('The following themes are experimental: Experimental dependency test');
+    $this->assertSession()->pageTextNotContains('The following themes are experimental: Experimental test, Experimental dependency test');
+    $this->assertSession()->pageTextNotContains('The following themes are experimental: Experimental dependency test');
 
     // There should be a message about enabling dependencies.
     $this->assertSession()->pageTextContains('You must enable the Experimental test theme to install Experimental dependency test');
@@ -115,7 +115,7 @@ public function testExperimentalConfirmForm() {
 
     // Setting it as the default should not ask for another confirmation.
     $this->cssSelect('a[title="Set Experimental dependency test as default theme"]')[0]->click();
-    $this->assertNoText('Experimental themes are provided for testing purposes only. Use at your own risk.');
+    $this->assertSession()->pageTextNotContains('Experimental themes are provided for testing purposes only. Use at your own risk.');
     $this->assertSession()->pageTextContains('Experimental dependency test is now the default theme.');
     $this->assertSession()->responseContains(sprintf('Experimental test %s                (experimental theme)', \Drupal::VERSION));
     $this->assertSession()->responseContains(sprintf('Experimental dependency test %s                (default theme, administration theme)', \Drupal::VERSION));
diff --git a/core/modules/system/tests/src/Functional/Theme/FastTest.php b/core/modules/system/tests/src/Functional/Theme/FastTest.php
index 95888c28211934cce14ab3785a2ab55073d6e72f..ec6f3a9d38f9dd648e7d36dcc5fa2ce72f86d003 100644
--- a/core/modules/system/tests/src/Functional/Theme/FastTest.php
+++ b/core/modules/system/tests/src/Functional/Theme/FastTest.php
@@ -35,7 +35,7 @@ public function testUserAutocomplete() {
     $this->drupalLogin($this->account);
     $this->drupalGet('user/autocomplete', ['query' => ['q' => $this->account->getAccountName()]]);
     $this->assertRaw($this->account->getAccountName());
-    $this->assertNoText('registry initialized');
+    $this->assertSession()->pageTextNotContains('registry initialized');
   }
 
 }
diff --git a/core/modules/system/tests/src/Functional/Theme/ThemeTest.php b/core/modules/system/tests/src/Functional/Theme/ThemeTest.php
index 66e07ef12e5a19ae7a73df3395673295acd515ce..5c5eeec7292a87e7ffbcb7b80263647444059dea 100644
--- a/core/modules/system/tests/src/Functional/Theme/ThemeTest.php
+++ b/core/modules/system/tests/src/Functional/Theme/ThemeTest.php
@@ -56,7 +56,7 @@ public function testNegotiatorPriorities() {
     $this->drupalGet('theme-test/priority');
 
     // Ensure that the custom theme negotiator was not able to set the theme.
-    $this->assertNoText('Theme hook implementor=theme-test--suggestion.html.twig. Foo=template_preprocess_theme_test');
+    $this->assertSession()->pageTextNotContains('Theme hook implementor=theme-test--suggestion.html.twig. Foo=template_preprocess_theme_test');
   }
 
   /**
diff --git a/core/modules/system/tests/src/Functional/Theme/ThemeUiTest.php b/core/modules/system/tests/src/Functional/Theme/ThemeUiTest.php
index daca1401a0230bcfca4315ae43a164acb142d037..39fce07d4c255fe7ee094b4563eee462cb906ad9 100644
--- a/core/modules/system/tests/src/Functional/Theme/ThemeUiTest.php
+++ b/core/modules/system/tests/src/Functional/Theme/ThemeUiTest.php
@@ -343,7 +343,7 @@ public function testInstalledIncompatibleTheme() {
 
     file_put_contents($file_path, Yaml::encode($compatible_info));
     $this->drupalGet('admin/appearance');
-    $this->assertNoText($incompatible_themes_message);
+    $this->assertSession()->pageTextNotContains($incompatible_themes_message);
     $page->clickLink("Install $theme_name theme");
     $assert_session->addressEquals('admin/appearance');
     $assert_session->pageTextContains("The $theme_name theme has been installed");
@@ -364,7 +364,7 @@ public function testInstalledIncompatibleTheme() {
 
       file_put_contents($file_path, Yaml::encode($compatible_info));
       $this->drupalGet('admin/appearance');
-      $this->assertNoText($incompatible_themes_message);
+      $this->assertSession()->pageTextNotContains($incompatible_themes_message);
     }
     // Uninstall the theme and ensure that incompatible themes message is not
     // displayed for themes that are not installed.
@@ -373,7 +373,7 @@ public function testInstalledIncompatibleTheme() {
       $incompatible_info = $info + $incompatible_update;
       file_put_contents($file_path, Yaml::encode($incompatible_info));
       $this->drupalGet('admin/appearance');
-      $this->assertNoText($incompatible_themes_message);
+      $this->assertSession()->pageTextNotContains($incompatible_themes_message);
     }
   }
 
diff --git a/core/modules/system/tests/src/Functional/Theme/TwigExtensionTest.php b/core/modules/system/tests/src/Functional/Theme/TwigExtensionTest.php
index f55db4c9c7e0bbefe36bf2cf8473bc5b5c9121a7..45de8f1efec81071afc2317839123ec9490d9a34 100644
--- a/core/modules/system/tests/src/Functional/Theme/TwigExtensionTest.php
+++ b/core/modules/system/tests/src/Functional/Theme/TwigExtensionTest.php
@@ -63,7 +63,7 @@ public function testTwigExtensionFunction() {
     $this->drupalGet('twig-extension-test/function');
     $this->assertSession()->pageTextContains('THE QUICK BROWN BOX JUMPS OVER THE LAZY DOG 123.');
     $this->assertSession()->pageTextContains('the quick brown box jumps over the lazy dog 123.');
-    $this->assertNoText('The Quick Brown Fox Jumps Over The Lazy Dog 123.');
+    $this->assertSession()->pageTextNotContains('The Quick Brown Fox Jumps Over The Lazy Dog 123.');
   }
 
   /**
diff --git a/core/modules/system/tests/src/Functional/Theme/TwigTransTest.php b/core/modules/system/tests/src/Functional/Theme/TwigTransTest.php
index 80ce0f187e3550ee2e876987949398fbc459cd72..c68c1c9d7a16612180a770acecc81d0605b39802 100644
--- a/core/modules/system/tests/src/Functional/Theme/TwigTransTest.php
+++ b/core/modules/system/tests/src/Functional/Theme/TwigTransTest.php
@@ -177,7 +177,7 @@ protected function assertTwigTransTags() {
     // Makes sure https://www.drupal.org/node/2489024 doesn't happen without
     // twig debug.
     // Ensure that running php code inside a Twig trans is not possible.
-    $this->assertNoText(pi());
+    $this->assertSession()->pageTextNotContains(pi());
   }
 
   /**
diff --git a/core/modules/system/tests/src/Functional/UpdateSystem/UpdatePathTestBaseFilledTest.php b/core/modules/system/tests/src/Functional/UpdateSystem/UpdatePathTestBaseFilledTest.php
index bcb801103c2850379d0b9c490bb6f6afbe861a2d..cf64b7d536056d4a4b0a4ac91fc972100a711ab6 100644
--- a/core/modules/system/tests/src/Functional/UpdateSystem/UpdatePathTestBaseFilledTest.php
+++ b/core/modules/system/tests/src/Functional/UpdateSystem/UpdatePathTestBaseFilledTest.php
@@ -76,7 +76,7 @@ public function testUpdatedSite() {
     $this->assertSession()->pageTextContains('Hola');
     $this->assertSession()->pageTextContains('Hello');
     // The user entity reference field is access restricted.
-    $this->assertNoText('Test 12');
+    $this->assertSession()->pageTextNotContains('Test 12');
     // Make sure all other field labels are there.
     for ($i = 1; $i <= 23; $i++) {
       if ($i != 12) {
@@ -140,7 +140,7 @@ public function testUpdatedSite() {
 
     // Make sure the user is translated.
     $this->drupalGet('user/3/translations');
-    $this->assertNoText('Not translated');
+    $this->assertSession()->pageTextNotContains('Not translated');
 
     // Make sure the custom field on the user is still there.
     $this->drupalGet('admin/config/people/accounts/fields');
diff --git a/core/modules/system/tests/src/Functional/UpdateSystem/UpdateScriptTest.php b/core/modules/system/tests/src/Functional/UpdateSystem/UpdateScriptTest.php
index 83c8d58d42a53bfd8863d55d511fe0e1f39ee0cc..37c9eb05c3c738a96d7f4fea58cc4aa35f05e2df 100644
--- a/core/modules/system/tests/src/Functional/UpdateSystem/UpdateScriptTest.php
+++ b/core/modules/system/tests/src/Functional/UpdateSystem/UpdateScriptTest.php
@@ -148,7 +148,7 @@ public function testRequirements() {
     $this->drupalGet($this->updateUrl, ['external' => TRUE]);
     $this->assertSession()->pageTextContains('This is a requirements warning provided by the update_script_test module.');
     $this->clickLink('try again');
-    $this->assertNoText('This is a requirements warning provided by the update_script_test module.');
+    $this->assertSession()->pageTextNotContains('This is a requirements warning provided by the update_script_test module.');
     $this->clickLink('Continue');
     $this->clickLink('Apply pending updates');
     $this->checkForMetaRefresh();
@@ -160,7 +160,7 @@ public function testRequirements() {
     $this->drupalGet($this->updateUrl, ['external' => TRUE]);
     $this->assertSession()->pageTextContains('This is a requirements warning provided by the update_script_test module.');
     $this->clickLink('try again');
-    $this->assertNoText('This is a requirements warning provided by the update_script_test module.');
+    $this->assertSession()->pageTextNotContains('This is a requirements warning provided by the update_script_test module.');
     $this->clickLink('Continue');
     $this->assertSession()->pageTextContains('No pending updates.');
     // Confirm that all caches were cleared.
@@ -695,7 +695,7 @@ protected function runUpdates($maintenance_mode) {
       $this->assertSession()->pageTextContains('Operating in maintenance mode.');
     }
     else {
-      $this->assertNoText('Operating in maintenance mode.');
+      $this->assertSession()->pageTextNotContains('Operating in maintenance mode.');
     }
     $this->drupalGet($this->updateUrl, ['external' => TRUE]);
     $this->updateRequirementsProblem();
@@ -709,8 +709,8 @@ protected function runUpdates($maintenance_mode) {
     $this->assertSession()->pageTextContains('The update_script_test_update_8001() update was executed successfully.');
 
     // Verify that no 7.x updates were run.
-    $this->assertNoText('The update_script_test_update_7200() update was executed successfully.');
-    $this->assertNoText('The update_script_test_update_7201() update was executed successfully.');
+    $this->assertSession()->pageTextNotContains('The update_script_test_update_7200() update was executed successfully.');
+    $this->assertSession()->pageTextNotContains('The update_script_test_update_7201() update was executed successfully.');
 
     // Verify that there are no links to different parts of the workflow.
     $this->assertSession()->linkNotExists('Administration pages');
diff --git a/core/modules/taxonomy/tests/src/Functional/TermTest.php b/core/modules/taxonomy/tests/src/Functional/TermTest.php
index 147973778cd12a9bee7525c57bce8883799620f1..e1107dfe84c46a9ab3e4b164c4116044ab720693 100644
--- a/core/modules/taxonomy/tests/src/Functional/TermTest.php
+++ b/core/modules/taxonomy/tests/src/Functional/TermTest.php
@@ -177,9 +177,9 @@ public function testTaxonomyTermChildTerms() {
     // Get Page 3. No parent term and no terms <18 are displayed. Terms 18-25
     // are displayed.
     $this->drupalGet('admin/structure/taxonomy/manage/' . $this->vocabulary->id() . '/overview', ['query' => ['page' => 2]]);
-    $this->assertNoText($term1->getName());
+    $this->assertSession()->pageTextNotContains($term1->getName());
     for ($x = 1; $x <= 17; $x++) {
-      $this->assertNoText($terms_array[$x]->getName());
+      $this->assertSession()->pageTextNotContains($terms_array[$x]->getName());
     }
     for ($x = 18; $x <= 25; $x++) {
       $this->assertSession()->pageTextContains($terms_array[$x]->getName());
@@ -324,8 +324,8 @@ public function testNodeTermCreationAndDeletion() {
     foreach ($term_names as $term_name) {
       $this->assertSession()->pageTextContains($term_name);
     }
-    $this->assertNoText($term_objects['term1']->getName());
-    $this->assertNoText($term_objects['term2']->getName());
+    $this->assertSession()->pageTextNotContains($term_objects['term1']->getName());
+    $this->assertSession()->pageTextNotContains($term_objects['term2']->getName());
   }
 
   /**
diff --git a/core/modules/taxonomy/tests/src/Functional/TermTranslationFieldViewTest.php b/core/modules/taxonomy/tests/src/Functional/TermTranslationFieldViewTest.php
index 08bce7b6a26814c09ffc1b0aa069f59a209a7ed0..a710b0c685a0c57ad3122925b353e4413b91f8e6 100644
--- a/core/modules/taxonomy/tests/src/Functional/TermTranslationFieldViewTest.php
+++ b/core/modules/taxonomy/tests/src/Functional/TermTranslationFieldViewTest.php
@@ -64,11 +64,11 @@ public function testTranslatedTaxonomyTermReferenceDisplay() {
     $translation_path = $this->translateToLangcode . '/' . $path;
 
     $this->drupalGet($path);
-    $this->assertNoText($this->translatedTagName);
+    $this->assertSession()->pageTextNotContains($this->translatedTagName);
     $this->assertSession()->pageTextContains($this->baseTagName);
     $this->drupalGet($translation_path);
     $this->assertSession()->pageTextContains($this->translatedTagName);
-    $this->assertNoText($this->baseTagName);
+    $this->assertSession()->pageTextNotContains($this->baseTagName);
   }
 
   /**
diff --git a/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyParentUITest.php b/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyParentUITest.php
index 32d15e7208724b259c7392666a29ea9972f91852..6599e7cbd7c40c27898bd8a7e1b3f9c213a6c07b 100644
--- a/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyParentUITest.php
+++ b/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyParentUITest.php
@@ -46,7 +46,7 @@ protected function setUp($import_test_views = TRUE): void {
    */
   public function testTaxonomyParentUI() {
     $this->drupalGet('admin/structure/views/nojs/handler/test_taxonomy_parent/default/relationship/parent');
-    $this->assertNoText('The handler for this item is broken or missing.');
+    $this->assertSession()->pageTextNotContains('The handler for this item is broken or missing.');
   }
 
 }
diff --git a/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyTermViewTest.php b/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyTermViewTest.php
index 9e9d4467283abaf9d23a9d09df8bfee0539f7234..c0a521ca20a17c18f1866766d2bb8c144dad0815 100644
--- a/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyTermViewTest.php
+++ b/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyTermViewTest.php
@@ -120,11 +120,11 @@ public function testTaxonomyTermView() {
     $this->drupalGet('taxonomy/term/' . $term->id());
     $this->assertSession()->pageTextContains($term->label());
     $this->assertSession()->pageTextContains($original_title);
-    $this->assertNoText($translated_title);
+    $this->assertSession()->pageTextNotContains($translated_title);
 
     $this->drupalGet('ur/taxonomy/term/' . $term->id());
     $this->assertSession()->pageTextContains($term->label());
-    $this->assertNoText($original_title);
+    $this->assertSession()->pageTextNotContains($original_title);
     $this->assertSession()->pageTextContains($translated_title);
 
     // Uninstall language module and ensure that the language is not part of the
diff --git a/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyVocabularyArgumentTest.php b/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyVocabularyArgumentTest.php
index 841ab102fc59aae568417ffd5253a339f8c29515..6415390dc104e6efe053c6057ca39499a68239a2 100644
--- a/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyVocabularyArgumentTest.php
+++ b/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyVocabularyArgumentTest.php
@@ -75,7 +75,7 @@ public function testTermWithVocabularyArgument() {
     // First term should be present.
     $this->assertSession()->pageTextContains($this->terms[0]->label());
     // Second term should not be present.
-    $this->assertNoText($this->terms[1]->label());
+    $this->assertSession()->pageTextNotContains($this->terms[1]->label());
   }
 
 }
diff --git a/core/modules/toolbar/tests/src/Functional/ToolbarAdminMenuTest.php b/core/modules/toolbar/tests/src/Functional/ToolbarAdminMenuTest.php
index 74a1c410b1d7eba1d13786a0a18d35d87c0c0c07..5813f1f348b8b317e4958fee08cb891d8d96d8d4 100644
--- a/core/modules/toolbar/tests/src/Functional/ToolbarAdminMenuTest.php
+++ b/core/modules/toolbar/tests/src/Functional/ToolbarAdminMenuTest.php
@@ -330,7 +330,7 @@ public function testLocaleTranslationSubtreesHashCacheClear() {
     ];
     $this->drupalGet('admin/config/regional/translate');
     $this->submitForm($search, 'Filter');
-    $this->assertNoText('No strings available');
+    $this->assertSession()->pageTextNotContains('No strings available');
     // Verify that search found the string as untranslated.
     $this->assertSession()->pageTextContains($name);
 
diff --git a/core/modules/toolbar/tests/src/Functional/ToolbarMenuTranslationTest.php b/core/modules/toolbar/tests/src/Functional/ToolbarMenuTranslationTest.php
index 02ebdb46576b4c2d9cc28ca315e8a0ac0195057f..f7889240ace493216dd6e7421a977b403175dd8c 100644
--- a/core/modules/toolbar/tests/src/Functional/ToolbarMenuTranslationTest.php
+++ b/core/modules/toolbar/tests/src/Functional/ToolbarMenuTranslationTest.php
@@ -74,7 +74,7 @@ public function testToolbarClasses() {
     $this->drupalGet('admin/config/regional/translate');
     $this->submitForm($search, 'Filter');
     // Make sure will be able to translate the menu item.
-    $this->assertNoText('No strings available.');
+    $this->assertSession()->pageTextNotContains('No strings available.');
 
     // Check that the class is on the item before we translate it.
     $xpath = $this->xpath('//a[contains(@class, "icon-system-admin-structure")]');
diff --git a/core/modules/tour/tests/src/Functional/TourHelpPageTest.php b/core/modules/tour/tests/src/Functional/TourHelpPageTest.php
index 2a97a0f27128adc27a5ffe48e1ee7e096fa9a576..c03b86940ae9fa5ee6bff4dd48da2954742a1286 100644
--- a/core/modules/tour/tests/src/Functional/TourHelpPageTest.php
+++ b/core/modules/tour/tests/src/Functional/TourHelpPageTest.php
@@ -87,7 +87,7 @@ protected function verifyHelp($tours_ok = TRUE) {
       $this->assertSession()->pageTextContains('Tours guide you through workflows');
     }
     else {
-      $this->assertNoText('Tours guide you through workflows');
+      $this->assertSession()->pageTextNotContains('Tours guide you through workflows');
     }
 
     $titles = $this->getTourList();
@@ -115,7 +115,7 @@ protected function verifyHelp($tours_ok = TRUE) {
         $this->assertSession()->linkNotExistsExact($title);
       }
       else {
-        $this->assertNoText($title);
+        $this->assertSession()->pageTextNotContains($title);
         // Just test the first item in the list of text that should not
         // be there, because the second matches part of the name of a module
         // that is in the Module overviews section, so the text will be there
diff --git a/core/modules/tracker/tests/src/Functional/TrackerNodeAccessTest.php b/core/modules/tracker/tests/src/Functional/TrackerNodeAccessTest.php
index 7e5da4f46e05699eac9766aa5640668743947df1..e3921eb0307f72c0311dfc99ece88baef2132892 100644
--- a/core/modules/tracker/tests/src/Functional/TrackerNodeAccessTest.php
+++ b/core/modules/tracker/tests/src/Functional/TrackerNodeAccessTest.php
@@ -104,10 +104,10 @@ public function testTrackerNodeAccess() {
     // User without access should not see private node.
     $this->drupalLogin($no_access_user);
     $this->drupalGet('activity');
-    $this->assertNoText($private_node->getTitle());
+    $this->assertSession()->pageTextNotContains($private_node->getTitle());
     $this->assertSession()->pageTextContains($public_node->getTitle());
     $this->drupalGet('user/' . $access_user->id() . '/activity');
-    $this->assertNoText($private_node->getTitle());
+    $this->assertSession()->pageTextNotContains($private_node->getTitle());
     $this->assertSession()->pageTextContains($public_node->getTitle());
   }
 
diff --git a/core/modules/tracker/tests/src/Functional/TrackerTest.php b/core/modules/tracker/tests/src/Functional/TrackerTest.php
index 4cfde59098a3a531e84cab3b8cab0050b3032979..0ac9a7c71215cca2648a44bcabf8888c8872831e 100644
--- a/core/modules/tracker/tests/src/Functional/TrackerTest.php
+++ b/core/modules/tracker/tests/src/Functional/TrackerTest.php
@@ -88,7 +88,7 @@ public function testTrackerAll() {
     ]);
 
     $this->drupalGet('activity');
-    $this->assertNoText($unpublished->label());
+    $this->assertSession()->pageTextNotContains($unpublished->label());
     $this->assertSession()->pageTextContains($published->label());
     $this->assertSession()->linkExists('My recent content', 0, 'User tab shows up on the global tracker page.');
 
@@ -121,7 +121,7 @@ public function testTrackerAll() {
     // Delete a node and ensure it no longer appears on the tracker.
     $published->delete();
     $this->drupalGet('activity');
-    $this->assertNoText($published->label());
+    $this->assertSession()->pageTextNotContains($published->label());
 
     // Test proper display of time on activity page when comments are disabled.
     // Disable comments.
@@ -173,9 +173,9 @@ public function testTrackerUser() {
     $this->submitForm($comment, 'Save');
 
     $this->drupalGet('user/' . $this->user->id() . '/activity');
-    $this->assertNoText($unpublished->label());
+    $this->assertSession()->pageTextNotContains($unpublished->label());
     $this->assertSession()->pageTextContains($my_published->label());
-    $this->assertNoText($other_published_no_comment->label());
+    $this->assertSession()->pageTextNotContains($other_published_no_comment->label());
     $this->assertSession()->pageTextContains($other_published_my_comment->label());
 
     // Assert cache contexts.
@@ -224,7 +224,7 @@ public function testTrackerUser() {
     $this->drupalGet('comment/1/edit');
     $this->submitForm(['status' => CommentInterface::NOT_PUBLISHED], 'Save');
     $this->drupalGet('user/' . $this->user->id() . '/activity');
-    $this->assertNoText($other_published_my_comment->label());
+    $this->assertSession()->pageTextNotContains($other_published_my_comment->label());
 
     // Test escaping of title on user's tracker tab.
     \Drupal::service('module_installer')->install(['user_hooks_test']);
diff --git a/core/modules/update/tests/src/Functional/FileTransferAuthorizeFormTest.php b/core/modules/update/tests/src/Functional/FileTransferAuthorizeFormTest.php
index ba362c71750d00f84e30d254b56089ad323d8733..58fda4cf9e8e1e110904df5b91551f29ba1df4f1 100644
--- a/core/modules/update/tests/src/Functional/FileTransferAuthorizeFormTest.php
+++ b/core/modules/update/tests/src/Functional/FileTransferAuthorizeFormTest.php
@@ -52,7 +52,7 @@ public function testViaAuthorize($url) {
 
     // Ensure the module does not already exist.
     $this->drupalGet('admin/modules');
-    $this->assertNoText('Update test new module');
+    $this->assertSession()->pageTextNotContains('Update test new module');
 
     $edit = [
       'project_url' => $url,
diff --git a/core/modules/update/tests/src/Functional/UpdateContribTest.php b/core/modules/update/tests/src/Functional/UpdateContribTest.php
index 2eb4e0dae8c6a9b5feb34cd7768fac464125dce1..c0ba0767ba545a487356fb9a600d74d696f7b0c8 100644
--- a/core/modules/update/tests/src/Functional/UpdateContribTest.php
+++ b/core/modules/update/tests/src/Functional/UpdateContribTest.php
@@ -72,7 +72,7 @@ public function testNoReleasesAvailable() {
     $this->assertRaw(Link::fromTextAndUrl(t('Drupal'), Url::fromUri('http://example.com/project/drupal'))->toString());
     $this->assertSession()->pageTextContains('Up to date');
     $this->assertSession()->responseContains('<h3>Modules</h3>');
-    $this->assertNoText('Update available');
+    $this->assertSession()->pageTextNotContains('Update available');
     $this->assertSession()->pageTextContains('No available releases found');
     $this->assertNoRaw(Link::fromTextAndUrl(t('AAA Update test'), Url::fromUri('http://example.com/project/aaa_update_test'))->toString());
 
@@ -105,7 +105,7 @@ public function testUpdateContribBasic() {
     $this->standardTests();
     $this->assertSession()->pageTextContains('Up to date');
     $this->assertSession()->responseContains('<h3>Modules</h3>');
-    $this->assertNoText('Update available');
+    $this->assertSession()->pageTextNotContains('Update available');
     $this->assertRaw($project_link);
 
     // Since aaa_update_test is installed the fact it is hidden and in the
@@ -182,7 +182,7 @@ public function testUpdateContribOrder() {
     $this->standardTests();
     // We're expecting the report to say all projects are up to date.
     $this->assertSession()->pageTextContains('Up to date');
-    $this->assertNoText('Update available');
+    $this->assertSession()->pageTextNotContains('Update available');
     // We want to see all 3 module names listed, since they'll show up either
     // as project names or as modules under the "Includes" listing.
     $this->assertSession()->pageTextContains('AAA Update test');
@@ -396,14 +396,15 @@ public function testUpdateShowDisabledThemes() {
       $this->refreshUpdateStatus($xml_mapping);
       // In neither case should we see the "Themes" heading for installed
       // themes.
-      $this->assertNoText('Themes');
+      // Use regex pattern because we need to match 'Themes' case sensitively.
+      $this->assertSession()->pageTextNotMatches('/Themes/');
       if ($check_disabled) {
         $this->assertSession()->pageTextContains('Uninstalled themes');
         $this->assertRaw($base_theme_project_link);
         $this->assertRaw($sub_theme_project_link);
       }
       else {
-        $this->assertNoText('Uninstalled themes');
+        $this->assertSession()->pageTextNotContains('Uninstalled themes');
         $this->assertNoRaw($base_theme_project_link);
         $this->assertNoRaw($sub_theme_project_link);
       }
@@ -483,7 +484,7 @@ public function testUpdateBrokenFetchURL() {
     // hope that 'Up to date' is not unique.
     $this->assertSession()->pageTextMatchesCount(3, '/Up to date/');
     // It should say we failed to get data, not that we're missing an update.
-    $this->assertNoText('Update available');
+    $this->assertSession()->pageTextNotContains('Update available');
 
     // We need to check that this string is found as part of a project row, not
     // just in the "Failed to get available update data" message at the top of
@@ -549,7 +550,7 @@ public function testHookUpdateStatusAlter() {
     $update_test_config->set('update_status', [])->save();
     $this->drupalGet('admin/reports/updates');
     $this->assertSession()->responseContains('<h3>Modules</h3>');
-    $this->assertNoText('Security update required!');
+    $this->assertSession()->pageTextNotContains('Security update required!');
     $this->assertRaw(Link::fromTextAndUrl(t('AAA Update test'), Url::fromUri('http://example.com/project/aaa_update_test'))->toString());
 
     // Turn the altering back on and visit the Update manager UI.
@@ -560,7 +561,7 @@ public function testHookUpdateStatusAlter() {
     // Turn the altering back off and visit the Update manager UI.
     $update_test_config->set('update_status', [])->save();
     $this->drupalGet('admin/modules/update');
-    $this->assertNoText('Security update');
+    $this->assertSession()->pageTextNotContains('Security update');
   }
 
   /**
diff --git a/core/modules/update/tests/src/Functional/UpdateSemverCoreTest.php b/core/modules/update/tests/src/Functional/UpdateSemverCoreTest.php
index c6018660148afaddf422fb2fed011d925fae1107..64b371c5736903f3b7a9e1990b8adb0a2a50e96d 100644
--- a/core/modules/update/tests/src/Functional/UpdateSemverCoreTest.php
+++ b/core/modules/update/tests/src/Functional/UpdateSemverCoreTest.php
@@ -278,10 +278,10 @@ public function testDatestampMismatch() {
     ];
     $this->config('update_test.settings')->set('system_info', $system_info)->save();
     $this->refreshUpdateStatus(['drupal' => 'dev']);
-    $this->assertNoText('2001-Sep-');
+    $this->assertSession()->pageTextNotContains('2001-Sep-');
     $this->assertSession()->pageTextContains('Up to date');
-    $this->assertNoText('Update available');
-    $this->assertNoText('Security update required!');
+    $this->assertSession()->pageTextNotContains('Update available');
+    $this->assertSession()->pageTextNotContains('Security update required!');
   }
 
   /**
@@ -298,7 +298,7 @@ public function testModulePageRunCron() {
 
     $this->cronRun();
     $this->drupalGet('admin/modules');
-    $this->assertNoText('No update information available.');
+    $this->assertSession()->pageTextNotContains('No update information available.');
   }
 
   /**
@@ -336,8 +336,8 @@ public function testModulePageUpToDate() {
     $this->checkForMetaRefresh();
     $this->assertSession()->pageTextContains('Checked available update data for one project.');
     $this->drupalGet('admin/modules');
-    $this->assertNoText('There are updates available for your version of Drupal.');
-    $this->assertNoText('There is a security update available for your version of Drupal.');
+    $this->assertSession()->pageTextNotContains('There are updates available for your version of Drupal.');
+    $this->assertSession()->pageTextNotContains('There is a security update available for your version of Drupal.');
   }
 
   /**
@@ -359,7 +359,7 @@ public function testModulePageRegularUpdate() {
     $this->assertSession()->pageTextContains('Checked available update data for one project.');
     $this->drupalGet('admin/modules');
     $this->assertSession()->pageTextContains('There are updates available for your version of Drupal.');
-    $this->assertNoText('There is a security update available for your version of Drupal.');
+    $this->assertSession()->pageTextNotContains('There is a security update available for your version of Drupal.');
   }
 
   /**
@@ -380,12 +380,12 @@ public function testModulePageSecurityUpdate() {
     $this->checkForMetaRefresh();
     $this->assertSession()->pageTextContains('Checked available update data for one project.');
     $this->drupalGet('admin/modules');
-    $this->assertNoText('There are updates available for your version of Drupal.');
+    $this->assertSession()->pageTextNotContains('There are updates available for your version of Drupal.');
     $this->assertSession()->pageTextContains('There is a security update available for your version of Drupal.');
 
     // Make sure admin/appearance warns you you're missing a security update.
     $this->drupalGet('admin/appearance');
-    $this->assertNoText('There are updates available for your version of Drupal.');
+    $this->assertSession()->pageTextNotContains('There are updates available for your version of Drupal.');
     $this->assertSession()->pageTextContains('There is a security update available for your version of Drupal.');
 
     // Make sure duplicate messages don't appear on Update status pages.
@@ -393,10 +393,10 @@ public function testModulePageSecurityUpdate() {
     $this->assertSession()->pageTextContainsOnce('There is a security update available for your version of Drupal.');
 
     $this->drupalGet('admin/reports/updates');
-    $this->assertNoText('There is a security update available for your version of Drupal.');
+    $this->assertSession()->pageTextNotContains('There is a security update available for your version of Drupal.');
 
     $this->drupalGet('admin/reports/updates/settings');
-    $this->assertNoText('There is a security update available for your version of Drupal.');
+    $this->assertSession()->pageTextNotContains('There is a security update available for your version of Drupal.');
   }
 
   /**
@@ -405,7 +405,7 @@ public function testModulePageSecurityUpdate() {
   public function testServiceUnavailable() {
     $this->refreshUpdateStatus([], '503-error');
     // Ensure that no "Warning: SimpleXMLElement..." parse errors are found.
-    $this->assertNoText('SimpleXMLElement');
+    $this->assertSession()->pageTextNotContains('SimpleXMLElement');
     $this->assertSession()->pageTextContainsOnce('Failed to get available update data for one project.');
   }
 
diff --git a/core/modules/update/tests/src/Functional/UpdateTestBase.php b/core/modules/update/tests/src/Functional/UpdateTestBase.php
index dd4d0279621b5b511bdf71a8aa6a37b660d28cf6..fcffc24cdbc294e37b6947bc86220af386b9ea50 100644
--- a/core/modules/update/tests/src/Functional/UpdateTestBase.php
+++ b/core/modules/update/tests/src/Functional/UpdateTestBase.php
@@ -109,7 +109,7 @@ protected function standardTests() {
     $this->assertSession()->responseContains('<h3>Drupal core</h3>');
     // Verify that the link to the Drupal project appears.
     $this->assertRaw(Link::fromTextAndUrl(t('Drupal'), Url::fromUri('http://example.com/project/drupal'))->toString());
-    $this->assertNoText('No available releases found');
+    $this->assertSession()->pageTextNotContains('No available releases found');
     $this->assertSession()->pageTextContains('Last checked:');
   }
 
diff --git a/core/modules/update/tests/src/Functional/UpdateUploadTest.php b/core/modules/update/tests/src/Functional/UpdateUploadTest.php
index f3ef4caa8eecfeac68c656ead85237f99977e333..dc5aae50a8c4b7048fe42624f899a15cb2a27778 100644
--- a/core/modules/update/tests/src/Functional/UpdateUploadTest.php
+++ b/core/modules/update/tests/src/Functional/UpdateUploadTest.php
@@ -180,25 +180,25 @@ public function testUpdateManagerCoreSecurityUpdateMessages() {
     // about core missing a security update.
 
     $this->drupalGet('admin/modules/install');
-    $this->assertNoText('There is a security update available for your version of Drupal.');
+    $this->assertSession()->pageTextNotContains('There is a security update available for your version of Drupal.');
 
     $this->drupalGet('admin/modules/update');
-    $this->assertNoText('There is a security update available for your version of Drupal.');
+    $this->assertSession()->pageTextNotContains('There is a security update available for your version of Drupal.');
 
     $this->drupalGet('admin/appearance/install');
-    $this->assertNoText('There is a security update available for your version of Drupal.');
+    $this->assertSession()->pageTextNotContains('There is a security update available for your version of Drupal.');
 
     $this->drupalGet('admin/appearance/update');
-    $this->assertNoText('There is a security update available for your version of Drupal.');
+    $this->assertSession()->pageTextNotContains('There is a security update available for your version of Drupal.');
 
     $this->drupalGet('admin/reports/updates/install');
-    $this->assertNoText('There is a security update available for your version of Drupal.');
+    $this->assertSession()->pageTextNotContains('There is a security update available for your version of Drupal.');
 
     $this->drupalGet('admin/reports/updates/update');
-    $this->assertNoText('There is a security update available for your version of Drupal.');
+    $this->assertSession()->pageTextNotContains('There is a security update available for your version of Drupal.');
 
     $this->drupalGet('admin/update/ready');
-    $this->assertNoText('There is a security update available for your version of Drupal.');
+    $this->assertSession()->pageTextNotContains('There is a security update available for your version of Drupal.');
   }
 
   /**
diff --git a/core/modules/user/tests/src/Functional/UserAdminTest.php b/core/modules/user/tests/src/Functional/UserAdminTest.php
index a572db57e5fe40f639ffc9f64d310050b5f7d02b..65acd73caa310854a910934bea8212ce795291d5 100644
--- a/core/modules/user/tests/src/Functional/UserAdminTest.php
+++ b/core/modules/user/tests/src/Functional/UserAdminTest.php
@@ -30,6 +30,19 @@ class UserAdminTest extends BrowserTestBase {
    */
   protected $defaultTheme = 'stark';
 
+  /**
+   * Gets the xpath selector for a user account.
+   *
+   * @param \Drupal\user\Entity\UserInterface $user
+   *   The user to get the link for.
+   *
+   * @return string
+   *   The xpath selector for the user link.
+   */
+  private static function getLinkSelectorForUser(UserInterface $user): string {
+    return '//td[contains(@class, "views-field-name")]/a[text()="' . $user->getAccountName() . '"]';
+  }
+
   /**
    * Registers a user and deletes it.
    */
@@ -88,9 +101,9 @@ public function testUserAdmin() {
     $this->drupalGet('admin/people', ['query' => ['permission' => 'administer taxonomy']]);
 
     // Check if the correct users show up.
-    $this->assertNoText($user_a->getAccountName());
-    $this->assertSession()->pageTextContains($user_b->getAccountName());
-    $this->assertSession()->pageTextContains($user_c->getAccountName());
+    $this->assertSession()->elementNotExists('xpath', static::getLinkSelectorForUser($user_a));
+    $this->assertSession()->elementExists('xpath', static::getLinkSelectorForUser($user_b));
+    $this->assertSession()->elementExists('xpath', static::getLinkSelectorForUser($user_c));
 
     // Filter the users by role. Grab the system-generated role name for User C.
     $roles = $user_c->getRoles();
@@ -98,9 +111,9 @@ public function testUserAdmin() {
     $this->drupalGet('admin/people', ['query' => ['role' => reset($roles)]]);
 
     // Check if the correct users show up when filtered by role.
-    $this->assertNoText($user_a->getAccountName());
-    $this->assertNoText($user_b->getAccountName());
-    $this->assertSession()->pageTextContains($user_c->getAccountName());
+    $this->assertSession()->elementNotExists('xpath', static::getLinkSelectorForUser($user_a));
+    $this->assertSession()->elementNotExists('xpath', static::getLinkSelectorForUser($user_b));
+    $this->assertSession()->elementExists('xpath', static::getLinkSelectorForUser($user_c));
 
     // Test blocking of a user.
     $account = $user_storage->load($user_c->id());
@@ -125,9 +138,9 @@ public function testUserAdmin() {
 
     // Test filtering on admin page for blocked users
     $this->drupalGet('admin/people', ['query' => ['status' => 2]]);
-    $this->assertNoText($user_a->getAccountName());
-    $this->assertNoText($user_b->getAccountName());
-    $this->assertSession()->pageTextContains($user_c->getAccountName());
+    $this->assertSession()->elementNotExists('xpath', static::getLinkSelectorForUser($user_a));
+    $this->assertSession()->elementNotExists('xpath', static::getLinkSelectorForUser($user_b));
+    $this->assertSession()->elementExists('xpath', static::getLinkSelectorForUser($user_c));
 
     // Test unblocking of a user from /admin/people page and sending of activation mail
     $editunblock = [];
diff --git a/core/modules/user/tests/src/Functional/UserBlocksTest.php b/core/modules/user/tests/src/Functional/UserBlocksTest.php
index 34b4389e95dbe30e9062378a7e9fe41d851f88a0..46809bdabc4b2d0cd2dc0c065e19d30f76a49934 100644
--- a/core/modules/user/tests/src/Functional/UserBlocksTest.php
+++ b/core/modules/user/tests/src/Functional/UserBlocksTest.php
@@ -77,7 +77,7 @@ public function testUserLoginBlock() {
     $edit['pass'] = $user->passRaw;
     $this->drupalGet('admin/people/permissions');
     $this->submitForm($edit, 'Log in');
-    $this->assertNoText('User login');
+    $this->assertSession()->pageTextNotContains('User login');
 
     // Check that we are still on the same page.
     $this->assertSession()->addressEquals(Url::fromRoute('user.admin_permissions'));
@@ -87,7 +87,7 @@ public function testUserLoginBlock() {
     $this->drupalGet('filter/tips');
     $this->assertSession()->responseHeaderEquals(DynamicPageCacheSubscriber::HEADER, 'MISS');
     $this->submitForm($edit, 'Log in');
-    $this->assertNoText('User login');
+    $this->assertSession()->pageTextNotContains('User login');
     // Verify that we are still on the same page after login for allowed page.
     $this->assertSession()->responseMatches('!<title.*?Compose tips.*?</title>!');
 
@@ -96,7 +96,7 @@ public function testUserLoginBlock() {
     $this->drupalGet('filter/tips', ['query' => ['foo' => 'bar']]);
     $this->assertSession()->responseHeaderEquals(DynamicPageCacheSubscriber::HEADER, 'HIT');
     $this->submitForm($edit, 'Log in');
-    $this->assertNoText('User login');
+    $this->assertSession()->pageTextNotContains('User login');
     // Verify that we are still on the same page after login for allowed page.
     $this->assertSession()->responseMatches('!<title.*?Compose tips.*?</title>!');
     $this->assertStringContainsString('/filter/tips?foo=bar', $this->getUrl(), 'Correct query arguments are displayed after login');
@@ -106,7 +106,7 @@ public function testUserLoginBlock() {
     $this->drupalGet('filter/tips', ['query' => ['foo' => 'baz']]);
     $this->assertSession()->responseHeaderEquals(DynamicPageCacheSubscriber::HEADER, 'HIT');
     $this->submitForm($edit, 'Log in');
-    $this->assertNoText('User login');
+    $this->assertSession()->pageTextNotContains('User login');
     // Verify that we are still on the same page after login for allowed page.
     $this->assertSession()->responseMatches('!<title.*?Compose tips.*?</title>!');
     $this->assertStringContainsString('/filter/tips?foo=baz', $this->getUrl(), 'Correct query arguments are displayed after login');
@@ -129,7 +129,7 @@ public function testUserLoginBlock() {
     $this->submitForm($edit, 'Log in');
     $this->assertSession()->pageTextContains('Unrecognized username or password. Forgot your password?');
     $this->drupalGet('filter/tips');
-    $this->assertNoText('Unrecognized username or password. Forgot your password?');
+    $this->assertSession()->pageTextNotContains('Unrecognized username or password. Forgot your password?');
   }
 
 }
diff --git a/core/modules/user/tests/src/Functional/UserCancelTest.php b/core/modules/user/tests/src/Functional/UserCancelTest.php
index a6ab36a03ab67f892a7813e368d03538813e6d1b..4f0db35fd5062b2f9247dcc149e78e4965e90bc1 100644
--- a/core/modules/user/tests/src/Functional/UserCancelTest.php
+++ b/core/modules/user/tests/src/Functional/UserCancelTest.php
@@ -193,7 +193,7 @@ public function testUserBlock() {
     $this->submitForm([], 'Cancel account');
     $this->assertSession()->pageTextContains('Are you sure you want to cancel your account?');
     $this->assertSession()->pageTextContains('Your account will be blocked and you will no longer be able to log in. All of your content will remain attributed to your username.');
-    $this->assertNoText('Select the method to cancel the account above.');
+    $this->assertSession()->pageTextNotContains('Select the method to cancel the account above.');
 
     // Confirm account cancellation.
     $timestamp = time();
diff --git a/core/modules/user/tests/src/Functional/UserCreateFailMailTest.php b/core/modules/user/tests/src/Functional/UserCreateFailMailTest.php
index 449166fefe9472c8c8937924528b068245018563..a3b0e90323406bb9e504044fa0aa09b335a952c1 100644
--- a/core/modules/user/tests/src/Functional/UserCreateFailMailTest.php
+++ b/core/modules/user/tests/src/Functional/UserCreateFailMailTest.php
@@ -45,7 +45,7 @@ public function testUserAdd() {
     $this->submitForm($edit, 'Create new account');
 
     $this->assertSession()->pageTextContains('Unable to send email. Contact the site administrator if the problem persists.');
-    $this->assertNoText('A welcome message with further instructions has been emailed to the new user ' . $edit['name'] . '.');
+    $this->assertSession()->pageTextNotContains('A welcome message with further instructions has been emailed to the new user ' . $edit['name'] . '.');
   }
 
 }
diff --git a/core/modules/user/tests/src/Functional/UserCreateTest.php b/core/modules/user/tests/src/Functional/UserCreateTest.php
index 5d97b6489f80cea0c6c929fc534d375fd7d25b57..d9905cdc3b12fae994435c2d6f7dcf78f4c9b9f4 100644
--- a/core/modules/user/tests/src/Functional/UserCreateTest.php
+++ b/core/modules/user/tests/src/Functional/UserCreateTest.php
@@ -136,7 +136,7 @@ public function testUserAdd() {
     $this->drupalGet('admin/people/create');
     $this->submitForm($edit, 'Create new account');
     $this->assertSession()->pageTextContains("Created a new user account for $name. No email has been sent");
-    $this->assertNoText('Password field is required');
+    $this->assertSession()->pageTextNotContains('Password field is required');
   }
 
 }
diff --git a/core/modules/user/tests/src/Functional/UserPasswordResetTest.php b/core/modules/user/tests/src/Functional/UserPasswordResetTest.php
index fbb86ffa90852f63e5314e30824ff70bc659c10e..cc7b77969af143829ef7b71a3f187d6de9fd28cc 100644
--- a/core/modules/user/tests/src/Functional/UserPasswordResetTest.php
+++ b/core/modules/user/tests/src/Functional/UserPasswordResetTest.php
@@ -170,7 +170,7 @@ public function testUserPasswordReset() {
     $this->drupalGet($resetURL);
     $this->submitForm([], 'Log in');
     $this->drupalGet('user/' . $this->account->id() . '/edit');
-    $this->assertNoText('Expected user_string to be a string, NULL given');
+    $this->assertSession()->pageTextNotContains('Expected user_string to be a string, NULL given');
     $this->drupalLogout();
 
     // Create a password reset link as if the request time was 60 seconds older than the allowed limit.
@@ -518,7 +518,7 @@ public function assertPasswordIpFlood() {
    * Makes assertions about a password reset not triggering IP flood control.
    */
   public function assertNoPasswordIpFlood() {
-    $this->assertNoText('Too many password recovery requests from your IP address. It is temporarily blocked. Try again later or contact the site administrator.');
+    $this->assertSession()->pageTextNotContains('Too many password recovery requests from your IP address. It is temporarily blocked. Try again later or contact the site administrator.');
   }
 
   /**
@@ -557,7 +557,7 @@ public function testResetImpersonation() {
     $this->drupalGet($attack_reset_url);
     $this->submitForm([], 'Log in');
     // Verify that the invalid password reset page does not show the user name.
-    $this->assertNoText($user2->getAccountName());
+    $this->assertSession()->pageTextNotContains($user2->getAccountName());
     $this->assertSession()->addressEquals('user/password');
     $this->assertSession()->pageTextContains('You have tried to use a one-time login link that has either been used or is no longer valid. Please request a new one using the form below.');
   }
diff --git a/core/modules/user/tests/src/Functional/UserRegistrationTest.php b/core/modules/user/tests/src/Functional/UserRegistrationTest.php
index f041a4cd970887c881ff5eb2490e27efa6a5607b..8938a6da9f6ef9c970f7ddfe8654d3239deb5c48 100644
--- a/core/modules/user/tests/src/Functional/UserRegistrationTest.php
+++ b/core/modules/user/tests/src/Functional/UserRegistrationTest.php
@@ -332,7 +332,7 @@ public function testRegistrationWithUserFields() {
 
     // Check that the field does not appear on the registration form.
     $this->drupalGet('user/register');
-    $this->assertNoText($field->label());
+    $this->assertSession()->pageTextNotContains($field->label());
     $this->assertSession()->responseHeaderContains('X-Drupal-Cache-Tags', 'config:core.entity_form_display.user.user.register');
     $this->assertSession()->responseHeaderContains('X-Drupal-Cache-Tags', 'config:user.settings');
 
diff --git a/core/modules/user/tests/src/Functional/UserRoleAdminTest.php b/core/modules/user/tests/src/Functional/UserRoleAdminTest.php
index 1cb1900cb2a4d041b1622021716fab5352e8fb87..263b3a576fdbd04fc9b4466186732d92dccd36fb 100644
--- a/core/modules/user/tests/src/Functional/UserRoleAdminTest.php
+++ b/core/modules/user/tests/src/Functional/UserRoleAdminTest.php
@@ -100,10 +100,10 @@ public function testRoleAdministration() {
     // interface.
     $this->drupalGet('admin/people/roles/manage/' . RoleInterface::ANONYMOUS_ID);
     $this->assertSession()->statusCodeEquals(200);
-    $this->assertNoText('Delete role');
+    $this->assertSession()->pageTextNotContains('Delete role');
     $this->drupalGet('admin/people/roles/manage/' . RoleInterface::AUTHENTICATED_ID);
     $this->assertSession()->statusCodeEquals(200);
-    $this->assertNoText('Delete role');
+    $this->assertSession()->pageTextNotContains('Delete role');
   }
 
   /**
diff --git a/core/modules/user/tests/src/Functional/Views/FilterPermissionUiTest.php b/core/modules/user/tests/src/Functional/Views/FilterPermissionUiTest.php
index 54c27a8049c460b54e662e088e8db20e457b8c06..e0d0769722842467e50c388b22dd5ccc3e862fca 100644
--- a/core/modules/user/tests/src/Functional/Views/FilterPermissionUiTest.php
+++ b/core/modules/user/tests/src/Functional/Views/FilterPermissionUiTest.php
@@ -54,7 +54,7 @@ public function testHandlerUI() {
     $this->assertSession()->linkExists('User: Permission (= View user information)');
     $this->submitForm([], 'Save');
     // Verify that we can save the view.
-    $this->assertNoText('No valid values found on filter: User: Permission.');
+    $this->assertSession()->pageTextNotContains('No valid values found on filter: User: Permission.');
     $this->assertSession()->pageTextContains('The view test_filter_permission has been saved.');
 
     // Verify that the handler summary is also correct when multiple values are
@@ -70,7 +70,7 @@ public function testHandlerUI() {
     $this->assertSession()->linkExists('User: Permission (or View us…)');
     $this->submitForm([], 'Save');
     // Verify that we can save the view.
-    $this->assertNoText('No valid values found on filter: User: Permission.');
+    $this->assertSession()->pageTextNotContains('No valid values found on filter: User: Permission.');
     $this->assertSession()->pageTextContains('The view test_filter_permission has been saved.');
   }
 
diff --git a/core/modules/user/tests/src/Functional/Views/HandlerFieldRoleTest.php b/core/modules/user/tests/src/Functional/Views/HandlerFieldRoleTest.php
index f9e610a58a4652cf1a2f1a00f8395373375e2595..3f68c071a63e0c9e17f619d47e70a06040f9a561 100644
--- a/core/modules/user/tests/src/Functional/Views/HandlerFieldRoleTest.php
+++ b/core/modules/user/tests/src/Functional/Views/HandlerFieldRoleTest.php
@@ -49,7 +49,7 @@ public function testRole() {
     $this->assertSession()->responseContains($rolename_b . Html::escape('<em>' . $rolename_a . '</em>'));
     // Verify that the view test_views_handler_field_role does not render a role
     // not assigned to a user.
-    $this->assertNoText($rolename_not_assigned);
+    $this->assertSession()->pageTextNotContains($rolename_not_assigned);
   }
 
 }
diff --git a/core/modules/user/tests/src/Functional/Views/UserFieldsAccessChangeTest.php b/core/modules/user/tests/src/Functional/Views/UserFieldsAccessChangeTest.php
index 40df001dc7baa2a7d4b42a0cd0c8b5d5dce39e34..8c222f02b2d2841d8ff660dc4668e8e9afe6b5e9 100644
--- a/core/modules/user/tests/src/Functional/Views/UserFieldsAccessChangeTest.php
+++ b/core/modules/user/tests/src/Functional/Views/UserFieldsAccessChangeTest.php
@@ -39,9 +39,9 @@ public function testUserFieldAccess() {
     $this->assertSession()->pageTextContains('Created');
 
     // User does not by default have access to init, mail and status.
-    $this->assertNoText('Init');
-    $this->assertNoText('Email');
-    $this->assertNoText('Status');
+    $this->assertSession()->pageTextNotContains('Init');
+    $this->assertSession()->pageTextNotContains('Email');
+    $this->assertSession()->pageTextNotContains('Status');
 
     // Assign sub-admin role to grant extra access.
     $user = $this->drupalCreateUser(['sub-admin']);
diff --git a/core/modules/views/tests/src/Functional/Entity/BaseFieldAccessTest.php b/core/modules/views/tests/src/Functional/Entity/BaseFieldAccessTest.php
index b24afb3801f73355fa2a080778fcd0d6b567c003..43dfdd1741ea61b1815efe73bb8c19b01497421e 100644
--- a/core/modules/views/tests/src/Functional/Entity/BaseFieldAccessTest.php
+++ b/core/modules/views/tests/src/Functional/Entity/BaseFieldAccessTest.php
@@ -67,7 +67,7 @@ protected function setUp($import_test_views = TRUE): void {
   public function testProtectedField() {
     $this->drupalGet('test-entity-protected-access');
     $this->assertSession()->pageTextContains('ok to see this one');
-    $this->assertNoText('no access value');
+    $this->assertSession()->pageTextNotContains('no access value');
   }
 
 }
diff --git a/core/modules/views/tests/src/Functional/Plugin/DisplayTest.php b/core/modules/views/tests/src/Functional/Plugin/DisplayTest.php
index 7d5596cc1bdfd723f8bbf4d30732bc0ea402d3bd..087d21a5b695ff0d7b1cf6520c5ad34bc578cd2e 100644
--- a/core/modules/views/tests/src/Functional/Plugin/DisplayTest.php
+++ b/core/modules/views/tests/src/Functional/Plugin/DisplayTest.php
@@ -445,17 +445,17 @@ protected function checkTranslationSetting($expected_node_translatability = FALS
 
     $this->drupalGet('admin/structure/views/nojs/display/content/page_1/rendering_language');
     if ($expected_node_translatability) {
-      $this->assertNoText($not_supported_text);
+      $this->assertSession()->pageTextNotContains($not_supported_text);
       $this->assertSession()->pageTextContains($supported_text);
     }
     else {
       $this->assertSession()->pageTextContains($not_supported_text);
-      $this->assertNoText($supported_text);
+      $this->assertSession()->pageTextNotContains($supported_text);
     }
 
     $this->drupalGet('admin/structure/views/nojs/display/files/page_1/rendering_language');
     $this->assertSession()->pageTextContains($not_supported_text);
-    $this->assertNoText($supported_text);
+    $this->assertSession()->pageTextNotContains($supported_text);
   }
 
 }
diff --git a/core/modules/views/tests/src/Functional/Plugin/ExposedFormCheckboxesTest.php b/core/modules/views/tests/src/Functional/Plugin/ExposedFormCheckboxesTest.php
index 3cb893936faa79f756cbcd9a76de647770a089f8..fb626b4ba34668ee3c3ff15e748322064ba4edb5 100644
--- a/core/modules/views/tests/src/Functional/Plugin/ExposedFormCheckboxesTest.php
+++ b/core/modules/views/tests/src/Functional/Plugin/ExposedFormCheckboxesTest.php
@@ -109,7 +109,7 @@ public function testExposedFormRenderCheckboxes() {
     // checked.
     $this->clickLink('Page 2');
     $this->assertSession()->elementsCount('xpath', "//div[contains(@class, 'views-row')]", 1);
-    $this->assertNoText('An illegal choice has been detected. Please contact the site administrator.');
+    $this->assertSession()->pageTextNotContains('An illegal choice has been detected. Please contact the site administrator.');
   }
 
   /**
@@ -158,14 +158,14 @@ public function testExposedIsAllOfFilter() {
     // All rows are displayed by default on the first page when no options are
     // checked.
     $this->assertSession()->elementsCount('xpath', "//div[contains(@class, 'views-row')]", 8);
-    $this->assertNoText('An illegal choice has been detected. Please contact the site administrator.');
+    $this->assertSession()->pageTextNotContains('An illegal choice has been detected. Please contact the site administrator.');
 
     // Select one option and ensure we still have results.
     $tid = $this->terms[0]->id();
     $this->submitForm(["tid[$tid]" => $tid], 'Apply');
     // Ensure only nodes tagged with $tid are displayed.
     $this->assertSession()->elementsCount('xpath', "//div[contains(@class, 'views-row')]", 2);
-    $this->assertNoText('An illegal choice has been detected. Please contact the site administrator.');
+    $this->assertSession()->pageTextNotContains('An illegal choice has been detected. Please contact the site administrator.');
   }
 
 }
diff --git a/core/modules/views/tests/src/Functional/Plugin/ExposedFormTest.php b/core/modules/views/tests/src/Functional/Plugin/ExposedFormTest.php
index 42f5ae084caf6d049d66bde1c639a44f4a6b3134..dc334a75681aded101fa1397dbe9f0d0c6c3f499 100644
--- a/core/modules/views/tests/src/Functional/Plugin/ExposedFormTest.php
+++ b/core/modules/views/tests/src/Functional/Plugin/ExposedFormTest.php
@@ -220,9 +220,12 @@ public function testExposedBlock($display) {
     $block->getPlugin()->setConfigurationValue('label_display', TRUE);
     $block->save();
 
-    // Test that the block label is found.
+    // Assert that the only two occurrences of `$view->getTitle()` are the title
+    // and h2 tags.
     $this->drupalGet('test_exposed_block');
-    $this->assertSession()->pageTextContains($view->getTitle());
+    $this->assertSession()->elementContains('css', 'title', $view->getTitle());
+    $this->assertSession()->elementExists('xpath', '//h2[text()="' . $view->getTitle() . '"]');
+    $this->assertSession()->pageTextMatchesCount(2, '/' . $view->getTitle() . '/');
 
     // Set a custom label on the exposed filter form block.
     $block->getPlugin()->setConfigurationValue('views_label', '<strong>Custom</strong> title<script>alert("hacked!");</script>');
@@ -237,9 +240,12 @@ public function testExposedBlock($display) {
     $block->save();
 
     // Test that the label is removed.
+    // Assert that the only occurrence of `$view->getTitle()` is the title tag
+    // now that label has been removed.
     $this->drupalGet('test_exposed_block');
     $this->assertNoRaw('<strong>Custom</strong> titlealert("hacked!");');
-    $this->assertNoText($view->getTitle());
+    $this->assertSession()->elementContains('css', 'title', $view->getTitle());
+    $this->assertSession()->pageTextMatchesCount(1, '/' . $view->getTitle() . '/');
 
     // Test there is an exposed form in a block.
     $xpath = $this->assertSession()->buildXPathQuery('//div[@id=:id]/form/@id', [':id' => Html::getUniqueId('block-' . $block->id())]);
@@ -333,7 +339,7 @@ public function testTextInputRequired() {
     // Ensure that the "on demand text" is not displayed when an exposed filter
     // is applied.
     $this->drupalGet('test_exposed_form_buttons', ['query' => ['type' => 'article']]);
-    $this->assertNoText($on_demand_text);
+    $this->assertSession()->pageTextNotContains($on_demand_text);
   }
 
   /**
diff --git a/core/modules/views/tests/src/Functional/Plugin/FilterTest.php b/core/modules/views/tests/src/Functional/Plugin/FilterTest.php
index a84bef2554cc41a1c3b044d9597bdcb70b9410e6..c1a933d83d4dd201b423b64e08492be522e12b56 100644
--- a/core/modules/views/tests/src/Functional/Plugin/FilterTest.php
+++ b/core/modules/views/tests/src/Functional/Plugin/FilterTest.php
@@ -171,7 +171,7 @@ public function testInOperatorSelectAllOptions() {
     $this->drupalGet('admin/structure/views/view/test_filter_in_operator_ui/edit/default');
     $this->submitForm([], 'Save');
     $this->submitForm([], 'Update preview');
-    $this->assertNoText('An illegal choice has been detected.');
+    $this->assertSession()->pageTextNotContains('An illegal choice has been detected.');
   }
 
   /**
diff --git a/core/modules/views/tests/src/Functional/Plugin/MenuLinkTest.php b/core/modules/views/tests/src/Functional/Plugin/MenuLinkTest.php
index 6a27559a1e0487d47a8eea67ce6bba8eda568a58..d41fb12882e17dce64f021f4c70eed43eeda2139 100644
--- a/core/modules/views/tests/src/Functional/Plugin/MenuLinkTest.php
+++ b/core/modules/views/tests/src/Functional/Plugin/MenuLinkTest.php
@@ -102,7 +102,7 @@ public function testHierarchicalMenuLinkVisibility() {
     // Test if the primary menu item (node) is visible, and the secondary menu
     // item (view) is hidden.
     $this->assertSession()->pageTextContains('Primary level node');
-    $this->assertNoText('Secondary level view page');
+    $this->assertSession()->pageTextNotContains('Secondary level view page');
 
     // Go to the node page and ensure that both the first and second level items
     // are visible.
diff --git a/core/modules/views/tests/src/Functional/Plugin/MiniPagerTest.php b/core/modules/views/tests/src/Functional/Plugin/MiniPagerTest.php
index bb72ff81c730f9a26d39afb549191a2c9bf7bf4c..7c6c54c85f6a81c3c694626deff135b08418744e 100644
--- a/core/modules/views/tests/src/Functional/Plugin/MiniPagerTest.php
+++ b/core/modules/views/tests/src/Functional/Plugin/MiniPagerTest.php
@@ -58,7 +58,7 @@ public function testMiniPagerRender() {
     $this->drupalGet('test_mini_pager');
     $this->assertSession()->pageTextContains('›› test');
     $this->assertSession()->pageTextContains('Page 1');
-    $this->assertNoText('‹‹ test');
+    $this->assertSession()->pageTextNotContains('‹‹ test');
     $this->assertSession()->pageTextContains($this->nodes[0]->label());
     $this->assertSession()->pageTextContains($this->nodes[1]->label());
     $this->assertSession()->pageTextContains($this->nodes[2]->label());
@@ -75,7 +75,7 @@ public function testMiniPagerRender() {
     // On last page, current page and previous page link appear, next page link
     // does not.
     $this->drupalGet('test_mini_pager', ['query' => ['page' => 6]]);
-    $this->assertNoText('›› test');
+    $this->assertSession()->pageTextNotContains('›› test');
     $this->assertSession()->pageTextContains('Page 7');
     $this->assertSession()->pageTextContains('‹‹ test');
     $this->assertSession()->pageTextContains($this->nodes[18]->label());
@@ -106,16 +106,16 @@ public function testMiniPagerRender() {
     $this->assertSession()->pageTextContains($this->nodes[1]->label());
 
     $this->drupalGet('test_mini_pager_one', ['query' => ['page' => 19]]);
-    $this->assertNoText('››');
+    $this->assertSession()->pageTextNotContains('››');
     $this->assertSession()->pageTextContains('Page 20');
     $this->assertSession()->pageTextContains('‹‹');
     $this->assertSession()->pageTextContains($this->nodes[19]->label());
 
     // Test a mini pager with all items on the page. No pager should display.
     $this->drupalGet('test_mini_pager_all');
-    $this->assertNoText('‹‹ test');
-    $this->assertNoText('Page 1');
-    $this->assertNoText('test ››');
+    $this->assertSession()->pageTextNotContains('‹‹ test');
+    $this->assertSession()->pageTextNotContains('Page 1');
+    $this->assertSession()->pageTextNotContains('test ››');
     // Verify that all rows appear on the page.
     $this->assertSession()->elementsCount('xpath', "//div[contains(@class, 'views-row')]", count($this->nodes));
 
@@ -125,9 +125,9 @@ public function testMiniPagerRender() {
     }
 
     $this->drupalGet('test_mini_pager');
-    $this->assertNoText('‹‹ test');
-    $this->assertNoText('Page 1');
-    $this->assertNoText('‹‹ test');
+    $this->assertSession()->pageTextNotContains('‹‹ test');
+    $this->assertSession()->pageTextNotContains('Page 1');
+    $this->assertSession()->pageTextNotContains('‹‹ test');
     $this->assertSession()->pageTextContains($this->nodes[19]->label());
 
     $view = Views::getView('test_mini_pager');
@@ -138,9 +138,9 @@ public function testMiniPagerRender() {
     // Remove the last node as well and ensure that no "Page 1" is shown.
     $this->nodes[19]->delete();
     $this->drupalGet('test_mini_pager');
-    $this->assertNoText('‹‹ test');
-    $this->assertNoText('Page 1');
-    $this->assertNoText('‹‹ test');
+    $this->assertSession()->pageTextNotContains('‹‹ test');
+    $this->assertSession()->pageTextNotContains('Page 1');
+    $this->assertSession()->pageTextNotContains('‹‹ test');
   }
 
 }
diff --git a/core/modules/views/tests/src/Functional/Plugin/ViewsBulkTest.php b/core/modules/views/tests/src/Functional/Plugin/ViewsBulkTest.php
index 15aa090a30286abb15269ae66d7500ef4af14023..edabcb016605f673f3c32cc044803194ed6e0416 100644
--- a/core/modules/views/tests/src/Functional/Plugin/ViewsBulkTest.php
+++ b/core/modules/views/tests/src/Functional/Plugin/ViewsBulkTest.php
@@ -65,7 +65,7 @@ public function testBulkSelection() {
     // on the confirm form.
     $this->submitForm(['node_bulk_form[0]' => TRUE], 'Apply to selected items');
     $this->assertSession()->pageTextContains($node_1->getTitle());
-    $this->assertNoText($node_2->getTitle());
+    $this->assertSession()->pageTextNotContains($node_2->getTitle());
 
     // Change the pager limit to 2.
     $this->config('views.view.content')->set('display.default.display_options.pager.options.items_per_page', 2)->save();
@@ -83,7 +83,7 @@ public function testBulkSelection() {
     // selected on the confirm form.
     $this->submitForm(['node_bulk_form[1]' => TRUE], 'Apply to selected items');
     $this->assertSession()->pageTextContains($node_1->getTitle());
-    $this->assertNoText($node_3->getTitle());
+    $this->assertSession()->pageTextNotContains($node_3->getTitle());
   }
 
 }
diff --git a/core/modules/views/tests/src/Functional/Wizard/BasicTest.php b/core/modules/views/tests/src/Functional/Wizard/BasicTest.php
index 5947c471c3f1c8752d26252a08142fe48d5cf4a3..6d843b5bb764969052765fc9afa2e495f7634c46 100644
--- a/core/modules/views/tests/src/Functional/Wizard/BasicTest.php
+++ b/core/modules/views/tests/src/Functional/Wizard/BasicTest.php
@@ -50,11 +50,11 @@ public function testViewsWizardAndListing() {
     $this->assertSession()->linkByHrefExists(Url::fromRoute('entity.view.duplicate_form', ['view' => $view1['id']])->toString());
 
     // The view should not have a REST export display.
-    $this->assertNoText('REST export');
+    $this->assertSession()->pageTextNotContains('REST export');
 
     // This view should not have a block.
     $this->drupalGet('admin/structure/block');
-    $this->assertNoText($view1['label']);
+    $this->assertSession()->pageTextNotContains($view1['label']);
 
     // Create two nodes.
     $node1 = $this->drupalCreateNode(['type' => 'page']);
@@ -104,11 +104,11 @@ public function testViewsWizardAndListing() {
     $this->assertSession()->linkByHrefExists(Url::fromRoute('view.' . $view2['id'] . '.page_1')->toString());
 
     // The view should not have a REST export display.
-    $this->assertNoText('REST export');
+    $this->assertSession()->pageTextNotContains('REST export');
 
     // This view should not have a block.
     $this->drupalGet('admin/structure/block');
-    $this->assertNoText('View: ' . $view2['label']);
+    $this->assertSession()->pageTextNotContains('View: ' . $view2['label']);
 
     // Create a view with a page and a block, and filter the listing.
     $view3 = [];
@@ -131,7 +131,7 @@ public function testViewsWizardAndListing() {
     $this->assertSession()->addressEquals($view3['page[path]']);
     $this->assertSession()->pageTextContains($view3['page[title]']);
     $this->assertSession()->pageTextContains($node1->label());
-    $this->assertNoText($node2->label());
+    $this->assertSession()->pageTextNotContains($node2->label());
 
     // Go back to the views page and check if this view is there.
     $this->drupalGet('admin/structure/views');
@@ -140,7 +140,7 @@ public function testViewsWizardAndListing() {
     $this->assertSession()->linkByHrefExists(Url::fromRoute('view.' . $view3['id'] . '.page_1')->toString());
 
     // The view should not have a REST export display.
-    $this->assertNoText('REST export');
+    $this->assertSession()->pageTextNotContains('REST export');
 
     // Confirm that the block is available in the block administration UI.
     $this->drupalGet('admin/structure/block/list/' . $this->config('system.theme')->get('default'));
@@ -154,10 +154,10 @@ public function testViewsWizardAndListing() {
     // for the expected node title in the block.
     $this->drupalGet('user');
     $this->assertSession()->pageTextContains($node1->label());
-    $this->assertNoText($node2->label());
+    $this->assertSession()->pageTextNotContains($node2->label());
 
     // Make sure the listing page doesn't show disabled default views.
-    $this->assertNoText('tracker');
+    $this->assertSession()->pageTextNotContains('tracker');
 
     // Create a view with only a REST export.
     $view4 = [];
diff --git a/core/modules/views/tests/src/Functional/Wizard/ItemsPerPageTest.php b/core/modules/views/tests/src/Functional/Wizard/ItemsPerPageTest.php
index 4b6e9c74e7192dc5c0da0992ea043e3bc20a62ba..0a17137271daa7018aa8f0f2599a6a34410936c3 100644
--- a/core/modules/views/tests/src/Functional/Wizard/ItemsPerPageTest.php
+++ b/core/modules/views/tests/src/Functional/Wizard/ItemsPerPageTest.php
@@ -88,8 +88,8 @@ public function testItemsPerPage() {
     $this->assertSession()->pageTextContains($node4->label());
     $this->assertSession()->pageTextContains($node3->label());
     $this->assertSession()->pageTextContains($node2->label());
-    $this->assertNoText($node1->label());
-    $this->assertNoText($page_node->label());
+    $this->assertSession()->pageTextNotContains($node1->label());
+    $this->assertSession()->pageTextNotContains($page_node->label());
     $pos5 = strpos($content, $node5->label());
     $pos4 = strpos($content, $node4->label());
     $pos3 = strpos($content, $node3->label());
@@ -112,9 +112,9 @@ public function testItemsPerPage() {
     $this->assertSession()->pageTextContains($node5->label());
     $this->assertSession()->pageTextContains($node4->label());
     $this->assertSession()->pageTextContains($node3->label());
-    $this->assertNoText($node2->label());
-    $this->assertNoText($node1->label());
-    $this->assertNoText($page_node->label());
+    $this->assertSession()->pageTextNotContains($node2->label());
+    $this->assertSession()->pageTextNotContains($node1->label());
+    $this->assertSession()->pageTextNotContains($page_node->label());
     $pos5 = strpos($content, $node5->label());
     $pos4 = strpos($content, $node4->label());
     $pos3 = strpos($content, $node3->label());
diff --git a/core/modules/views/tests/src/Functional/Wizard/TaggedWithTest.php b/core/modules/views/tests/src/Functional/Wizard/TaggedWithTest.php
index a5457eb75752e28ae43c5c0f354dacc8869e86c8..188d3bcd12a6723f989b1abb9c7c1c4387f26776 100644
--- a/core/modules/views/tests/src/Functional/Wizard/TaggedWithTest.php
+++ b/core/modules/views/tests/src/Functional/Wizard/TaggedWithTest.php
@@ -166,7 +166,7 @@ public function testTaggedWith() {
     $this->assertSession()->statusCodeEquals(200);
     $this->assertSession()->pageTextContains($node_tag1_title);
     $this->assertSession()->pageTextContains($node_tag1_tag2_title);
-    $this->assertNoText($node_no_tags_title);
+    $this->assertSession()->pageTextNotContains($node_no_tags_title);
 
     // Create a view that filters by taxonomy term "tag2". It should show only
     // the one node from above that is tagged with "tag2".
@@ -185,9 +185,9 @@ public function testTaggedWith() {
     $this->submitForm($view2, 'Save and edit');
     $this->assertSession()->statusCodeEquals(200);
     $this->drupalGet($view2['page[path]']);
-    $this->assertNoText($node_tag1_title);
+    $this->assertSession()->pageTextNotContains($node_tag1_title);
     $this->assertSession()->pageTextContains($node_tag1_tag2_title);
-    $this->assertNoText($node_no_tags_title);
+    $this->assertSession()->pageTextNotContains($node_no_tags_title);
   }
 
   /**
diff --git a/core/modules/views_ui/tests/src/Functional/DefaultViewsTest.php b/core/modules/views_ui/tests/src/Functional/DefaultViewsTest.php
index 383015616023f3c2b37bf0b563f1174afc2827db..1c79b478c218c8646f83dad06f102e914f1a812b 100644
--- a/core/modules/views_ui/tests/src/Functional/DefaultViewsTest.php
+++ b/core/modules/views_ui/tests/src/Functional/DefaultViewsTest.php
@@ -90,7 +90,7 @@ public function testDefaultViews() {
     // $this->drupalGet($revert_href);
     // $this->submitForm(array(), 'Revert');
     // $this->drupalGet('glossary');
-    // $this->assertNoText($new_title);
+    // $this->assertSession()->pageTextNotContains($new_title);
 
     // Duplicate the view and check that the normal schema of duplicated views is used.
     $this->drupalGet('admin/structure/views');
diff --git a/core/modules/views_ui/tests/src/Functional/DisplayAttachmentTest.php b/core/modules/views_ui/tests/src/Functional/DisplayAttachmentTest.php
index 5b2ce890d68a145d0efb3d7f023f071898779eec..758e8c064923020f4c1eacfe57611ec5f2aa1042 100644
--- a/core/modules/views_ui/tests/src/Functional/DisplayAttachmentTest.php
+++ b/core/modules/views_ui/tests/src/Functional/DisplayAttachmentTest.php
@@ -98,7 +98,7 @@ public function testRemoveAttachedDisplay() {
     $this->submitForm([], 'Save');
 
     // Check that there is no warning for the removed page display.
-    $this->assertNoText("Plugin ID &#039;page_1&#039; was not found.");
+    $this->assertSession()->pageTextNotContains("Plugin ID 'page_1' was not found.");
 
     // Check that the attachment is no longer linked to the removed display.
     $this->assertSession()->pageTextContains('Not defined');
diff --git a/core/modules/views_ui/tests/src/Functional/DisplayCRUDTest.php b/core/modules/views_ui/tests/src/Functional/DisplayCRUDTest.php
index 89dc0c4aaa47709ce682b144ac106cf3d6c5b227..4a944e18f3dfc7546d7535478a7b20196c1ffb3d 100644
--- a/core/modules/views_ui/tests/src/Functional/DisplayCRUDTest.php
+++ b/core/modules/views_ui/tests/src/Functional/DisplayCRUDTest.php
@@ -143,7 +143,7 @@ public function testDuplicateDisplay() {
     $this->assertSession()->linkByHrefExists($path_prefix . '/block_1', 0, 'Make sure after duplicating the new display appears in the UI');
     $this->assertSession()->addressEquals($path_prefix . '/block_1');
     $this->assertSession()->pageTextContains('Block settings');
-    $this->assertNoText('Page settings');
+    $this->assertSession()->pageTextNotContains('Page settings');
 
     $this->submitForm([], 'Save');
     $view = Views::getView($view['id']);
diff --git a/core/modules/views_ui/tests/src/Functional/DisplayTest.php b/core/modules/views_ui/tests/src/Functional/DisplayTest.php
index 69f375b38ce9436b3a70ce33b3ad17c8652ae0a0..a02269c3dacf93c83e13994a744e7b39c8a24d6b 100644
--- a/core/modules/views_ui/tests/src/Functional/DisplayTest.php
+++ b/core/modules/views_ui/tests/src/Functional/DisplayTest.php
@@ -36,12 +36,14 @@ class DisplayTest extends UITestBase {
    */
   public function testAddDisplay() {
     $view = $this->randomView();
-    $this->assertNoText('Block');
-    $this->assertNoText('Block 2');
+    $this->assertSession()->elementNotExists('xpath', '//li[@data-drupal-selector="edit-displays-top-tabs-block-1"]');
+    $this->assertSession()->elementNotExists('xpath', '//li[@data-drupal-selector="edit-displays-top-tabs-block-2"]');
+    $this->assertSession()->pageTextMatchesCount(0, '/Block name:/');
 
     $this->submitForm([], 'Add Block');
-    $this->assertSession()->pageTextContains('Block');
-    $this->assertNoText('Block 2');
+    $this->assertSession()->elementTextContains('xpath', '//li[@data-drupal-selector="edit-displays-top-tabs-block-1"]', 'Block*');
+    $this->assertSession()->elementNotExists('xpath', '//li[@data-drupal-selector="edit-displays-top-tabs-block-2"]');
+    $this->assertSession()->pageTextMatchesCount(1, '/Block name:/');
   }
 
   /**
@@ -285,7 +287,7 @@ public function testHideDisplayOverride() {
     $this->submitForm([], 'Save');
 
     $this->drupalGet('admin/structure/views/nojs/handler/test_display/page_1/field/title');
-    $this->assertNoText('All displays');
+    $this->assertSession()->pageTextNotContains('All displays');
 
     // Test that the override option is shown when default display is on.
     \Drupal::configFactory()->getEditable('views.settings')->set('ui.show.default_display', TRUE)->save();
diff --git a/core/modules/views_ui/tests/src/Functional/FilterNumericWebTest.php b/core/modules/views_ui/tests/src/Functional/FilterNumericWebTest.php
index eea148bdaa643c3daebcff415baa22873028ee70..0952c5e1cd3b7cf0aaf4d13295ee9266f0ee075b 100644
--- a/core/modules/views_ui/tests/src/Functional/FilterNumericWebTest.php
+++ b/core/modules/views_ui/tests/src/Functional/FilterNumericWebTest.php
@@ -76,9 +76,9 @@ public function testFilterNumericUI() {
     $this->submitForm(['age' => '2'], 'Apply');
     $this->assertSession()->pageTextContains('John');
     $this->assertSession()->pageTextContains('Paul');
-    $this->assertNoText('Ringo');
+    $this->assertSession()->pageTextNotContains('Ringo');
     $this->assertSession()->pageTextContains('George');
-    $this->assertNoText('Meredith');
+    $this->assertSession()->pageTextNotContains('Meredith');
 
     // Change the filter to a single filter to test the schema when the operator
     // is not exposed.
@@ -94,16 +94,16 @@ public function testFilterNumericUI() {
     // Test that the filter works as expected.
     $this->drupalGet('test_view-path');
     $this->assertSession()->pageTextContains('John');
-    $this->assertNoText('Paul');
-    $this->assertNoText('Ringo');
-    $this->assertNoText('George');
-    $this->assertNoText('Meredith');
+    $this->assertSession()->pageTextNotContains('Paul');
+    $this->assertSession()->pageTextNotContains('Ringo');
+    $this->assertSession()->pageTextNotContains('George');
+    $this->assertSession()->pageTextNotContains('Meredith');
     $this->submitForm(['age' => '26'], 'Apply');
-    $this->assertNoText('John');
+    $this->assertSession()->pageTextNotContains('John');
     $this->assertSession()->pageTextContains('Paul');
-    $this->assertNoText('Ringo');
-    $this->assertNoText('George');
-    $this->assertNoText('Meredith');
+    $this->assertSession()->pageTextNotContains('Ringo');
+    $this->assertSession()->pageTextNotContains('George');
+    $this->assertSession()->pageTextNotContains('Meredith');
 
     // Change the filter to a 'between' filter to test if the label and
     // description are set for the 'minimum' filter element.
diff --git a/core/modules/views_ui/tests/src/Functional/HandlerTest.php b/core/modules/views_ui/tests/src/Functional/HandlerTest.php
index 6c68cc6f101eb7a4f439bd4407dd9b406fa29c6b..0c7fc4b936a5621d37f09b624308a6668133bbb8 100644
--- a/core/modules/views_ui/tests/src/Functional/HandlerTest.php
+++ b/core/modules/views_ui/tests/src/Functional/HandlerTest.php
@@ -284,12 +284,12 @@ public function testErrorMissingHelp() {
     // Test that the error message is not shown for entity fields but an empty
     // description field is shown instead.
     $this->drupalGet('admin/structure/views/nojs/add-handler/test_node_view/default/field');
-    $this->assertNoText('Error: missing help');
+    $this->assertSession()->pageTextNotContains('Error: missing help');
     $this->assertRaw('<td class="description"></td>');
 
     // Test that no error message is shown for other fields.
     $this->drupalGet('admin/structure/views/nojs/add-handler/test_view_empty/default/field');
-    $this->assertNoText('Error: missing help');
+    $this->assertSession()->pageTextNotContains('Error: missing help');
   }
 
   /**
diff --git a/core/modules/views_ui/tests/src/Functional/OverrideDisplaysTest.php b/core/modules/views_ui/tests/src/Functional/OverrideDisplaysTest.php
index 5903db7571e2611f6ae24a67298cd824a954e310..968ff49a64af9c984beccadf2cd234f2b13fd9af 100644
--- a/core/modules/views_ui/tests/src/Functional/OverrideDisplaysTest.php
+++ b/core/modules/views_ui/tests/src/Functional/OverrideDisplaysTest.php
@@ -114,11 +114,11 @@ public function testWizardMixedDefaultOverriddenDisplays() {
     $this->drupalGet($view['page[path]']);
     $this->assertSession()->statusCodeEquals(200);
     $this->assertSession()->pageTextContains($view['page[title]']);
-    $this->assertNoText($view['block[title]']);
+    $this->assertSession()->pageTextNotContains($view['block[title]']);
     $this->drupalGet($view['page[feed_properties][path]']);
     $this->assertSession()->statusCodeEquals(200);
     $this->assertSession()->responseContains($view['page[title]']);
-    $this->assertNoText($view['block[title]']);
+    $this->assertSession()->responseNotContains($view['block[title]']);
 
     // Confirm that the block is available in the block administration UI.
     $this->drupalGet('admin/structure/block/list/' . $this->config('system.theme')->get('default'));
@@ -139,7 +139,7 @@ public function testWizardMixedDefaultOverriddenDisplays() {
 
     $this->drupalGet('');
     $this->assertSession()->pageTextContains($view['block[title]']);
-    $this->assertNoText($view['page[title]']);
+    $this->assertSession()->pageTextNotContains($view['page[title]']);
 
     // Edit the page and change the title. This should automatically change
     // the feed's title also, but not the block.
@@ -152,16 +152,16 @@ public function testWizardMixedDefaultOverriddenDisplays() {
     $this->drupalGet($view['page[path]']);
     $this->assertSession()->statusCodeEquals(200);
     $this->assertSession()->pageTextContains($new_default_title);
-    $this->assertNoText($view['page[title]']);
-    $this->assertNoText($view['block[title]']);
+    $this->assertSession()->pageTextNotContains($view['page[title]']);
+    $this->assertSession()->pageTextNotContains($view['block[title]']);
     $this->drupalGet($view['page[feed_properties][path]']);
     $this->assertSession()->statusCodeEquals(200);
     $this->assertSession()->responseContains($new_default_title);
-    $this->assertNoText($view['page[title]']);
-    $this->assertNoText($view['block[title]']);
+    $this->assertSession()->responseNotContains($view['page[title]']);
+    $this->assertSession()->responseNotContains($view['block[title]']);
     $this->drupalGet('');
-    $this->assertNoText($new_default_title);
-    $this->assertNoText($view['page[title]']);
+    $this->assertSession()->pageTextNotContains($new_default_title);
+    $this->assertSession()->pageTextNotContains($view['page[title]']);
     $this->assertSession()->pageTextContains($view['block[title]']);
 
     // Edit the block and change the title. This should automatically change
@@ -178,10 +178,10 @@ public function testWizardMixedDefaultOverriddenDisplays() {
     $this->drupalGet($view['page[feed_properties][path]']);
     $this->assertSession()->statusCodeEquals(200);
     $this->assertSession()->responseContains($new_default_title);
-    $this->assertNoText($new_block_title);
+    $this->assertSession()->responseNotContains($new_block_title);
     $this->drupalGet('');
     $this->assertSession()->pageTextContains($new_block_title);
-    $this->assertNoText($view['block[title]']);
+    $this->assertSession()->pageTextNotContains($view['block[title]']);
   }
 
   /**
diff --git a/core/modules/views_ui/tests/src/Functional/StyleUITest.php b/core/modules/views_ui/tests/src/Functional/StyleUITest.php
index 0d9b68a17f140c8311c6fce6394b57e069fb6f82..ecaaecaf90fd47520480b26d8530e956f6f72fd0 100644
--- a/core/modules/views_ui/tests/src/Functional/StyleUITest.php
+++ b/core/modules/views_ui/tests/src/Functional/StyleUITest.php
@@ -67,7 +67,7 @@ public function testStyleUI() {
     $this->drupalGet("admin/structure/views/nojs/display/{$view_name}/page_1/row");
     $this->submitForm(['row[type]' => 'fields'], 'Apply');
     // If fields are being used this text will not be shown.
-    $this->assertNoText('The selected style or row format does not use fields.');
+    $this->assertSession()->pageTextNotContains('The selected style or row format does not use fields.');
   }
 
 }
diff --git a/core/modules/views_ui/tests/src/Functional/TranslatedViewTest.php b/core/modules/views_ui/tests/src/Functional/TranslatedViewTest.php
index 7638c8fe7bd9e600cc2ffb76855d934e60d86202..0a1ea69bd6cce2d2267cd092f18bdf20ac876bde 100644
--- a/core/modules/views_ui/tests/src/Functional/TranslatedViewTest.php
+++ b/core/modules/views_ui/tests/src/Functional/TranslatedViewTest.php
@@ -82,7 +82,7 @@ public function testTranslatedStrings() {
     // Check if the label is translated.
     $this->drupalGet($edit_url, ['language' => \Drupal::languageManager()->getLanguage('fr')]);
     $this->assertSession()->titleEquals('Files (File) | Drupal');
-    $this->assertNoText('Fichiers');
+    $this->assertSession()->pageTextNotContains('Fichiers');
   }
 
 }
diff --git a/core/profiles/standard/tests/src/Functional/StandardTest.php b/core/profiles/standard/tests/src/Functional/StandardTest.php
index 1bf5f725d1f96487c1c9f3fa3f9aa55200128a46..fdc7d5a64f1401f8c28798e5d7d2a859da860e1a 100644
--- a/core/profiles/standard/tests/src/Functional/StandardTest.php
+++ b/core/profiles/standard/tests/src/Functional/StandardTest.php
@@ -91,7 +91,7 @@ public function testStandard() {
     // Fetch the feed.
     $this->drupalGet('rss.xml');
     $this->assertSession()->responseContains('Foobar');
-    $this->assertNoText('Then she picked out two somebodies, Sally and me');
+    $this->assertSession()->responseNotContains('Then she picked out two somebodies, Sally and me');
 
     // Ensure block body exists.
     $this->drupalGet('block/add');
@@ -155,10 +155,10 @@ public function testStandard() {
 
     // Make sure the optional image styles are not installed.
     $this->drupalGet('admin/config/media/image-styles');
-    $this->assertNoText('Max 325x325');
-    $this->assertNoText('Max 650x650');
-    $this->assertNoText('Max 1300x1300');
-    $this->assertNoText('Max 2600x2600');
+    $this->assertSession()->pageTextNotContains('Max 325x325');
+    $this->assertSession()->pageTextNotContains('Max 650x650');
+    $this->assertSession()->pageTextNotContains('Max 1300x1300');
+    $this->assertSession()->pageTextNotContains('Max 2600x2600');
 
     // Make sure the optional image styles are installed after enabling
     // the responsive_image module.
diff --git a/core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php b/core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php
index 00fa980e974497bd8ea44e75cd7cb3a28e2d64e4..08d974062e5760f9c97e4878d1266694b71ab9e7 100644
--- a/core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php
+++ b/core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php
@@ -299,7 +299,7 @@ public function testTextAsserts() {
     $this->drupalGet('test-encoded');
     $dangerous = 'Bad html <script>alert(123);</script>';
     $sanitized = Html::escape($dangerous);
-    $this->assertNoText($dangerous);
+    $this->assertSession()->responseNotContains($dangerous);
     $this->assertSession()->responseContains($sanitized);
   }
 
@@ -333,6 +333,7 @@ public function testAssertText() {
    * @group legacy
    */
   public function testAssertNoText() {
+    $this->expectDeprecation('AssertLegacyTrait::assertNoText() is deprecated in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->responseNotContains() or $this->assertSession()->pageTextNotContains() instead. See https://www.drupal.org/node/3129738');
     $this->expectDeprecation('Calling AssertLegacyTrait::assertNoText() with more than one argument is deprecated in drupal:8.2.0 and the method is removed from drupal:10.0.0. Use $this->assertSession()->responseNotContains() or $this->assertSession()->pageTextNotContains() instead. See https://www.drupal.org/node/3129738');
     $this->drupalGet('test-encoded');
     $dangerous = 'Bad html <script>alert(123);</script>';
diff --git a/core/tests/Drupal/FunctionalTests/Installer/DistributionProfileExistingSettingsTest.php b/core/tests/Drupal/FunctionalTests/Installer/DistributionProfileExistingSettingsTest.php
index 41721e87b3a02b43b522dbe5a74716070b958bec..fe2ece56b179f70658a6828afa00f4ed8a299a00 100644
--- a/core/tests/Drupal/FunctionalTests/Installer/DistributionProfileExistingSettingsTest.php
+++ b/core/tests/Drupal/FunctionalTests/Installer/DistributionProfileExistingSettingsTest.php
@@ -90,7 +90,7 @@ protected function setUpLanguage() {
     // Verify that the requested theme is used.
     $this->assertRaw($this->info['distribution']['install']['theme']);
     // Verify that the "Choose profile" step does not appear.
-    $this->assertNoText('profile');
+    $this->assertSession()->pageTextNotContains('profile');
 
     parent::setUpLanguage();
   }
diff --git a/core/tests/Drupal/FunctionalTests/Installer/DistributionProfileTest.php b/core/tests/Drupal/FunctionalTests/Installer/DistributionProfileTest.php
index 5bd8d6d7969adf92db03e1cdfbbdc0f6adc58d25..a5388abc08cb29c604df1cdfd7d16988fc255ac9 100644
--- a/core/tests/Drupal/FunctionalTests/Installer/DistributionProfileTest.php
+++ b/core/tests/Drupal/FunctionalTests/Installer/DistributionProfileTest.php
@@ -55,7 +55,7 @@ protected function setUpLanguage() {
     // Verify that the requested theme is used.
     $this->assertRaw($this->info['distribution']['install']['theme']);
     // Verify that the "Choose profile" step does not appear.
-    $this->assertNoText('profile');
+    $this->assertSession()->pageTextNotContains('profile');
 
     parent::setUpLanguage();
   }
diff --git a/core/tests/Drupal/FunctionalTests/Installer/DistributionProfileTranslationQueryTest.php b/core/tests/Drupal/FunctionalTests/Installer/DistributionProfileTranslationQueryTest.php
index 2ca5c9ea5069db0f0a6af09ed6de97e6c5adec94..ebc9b62b619d0e2c7d03ab1bcd53be72ca3f6d2a 100644
--- a/core/tests/Drupal/FunctionalTests/Installer/DistributionProfileTranslationQueryTest.php
+++ b/core/tests/Drupal/FunctionalTests/Installer/DistributionProfileTranslationQueryTest.php
@@ -101,7 +101,7 @@ protected function setUpSettings() {
     // Verify that the requested theme is used.
     $this->assertRaw($this->info['distribution']['install']['theme']);
     // Verify that the "Choose profile" step does not appear.
-    $this->assertNoText('profile');
+    $this->assertSession()->pageTextNotContains('profile');
 
     parent::setUpSettings();
   }
@@ -119,7 +119,7 @@ public function testInstalled() {
     // Verify German was configured but not English.
     $this->drupalGet('admin/config/regional/language');
     $this->assertSession()->pageTextContains('German');
-    $this->assertNoText('English');
+    $this->assertSession()->pageTextNotContains('English');
   }
 
   /**
diff --git a/core/tests/Drupal/FunctionalTests/Installer/DistributionProfileTranslationTest.php b/core/tests/Drupal/FunctionalTests/Installer/DistributionProfileTranslationTest.php
index 6a4712adab4d2918706791c1f419174a40b52a25..e43d7b39217606142ae2d829aa2020a6b19d0b3a 100644
--- a/core/tests/Drupal/FunctionalTests/Installer/DistributionProfileTranslationTest.php
+++ b/core/tests/Drupal/FunctionalTests/Installer/DistributionProfileTranslationTest.php
@@ -92,7 +92,7 @@ protected function setUpSettings() {
     // Verify that the requested theme is used.
     $this->assertRaw($this->info['distribution']['install']['theme']);
     // Verify that the "Choose profile" step does not appear.
-    $this->assertNoText('profile');
+    $this->assertSession()->pageTextNotContains('profile');
 
     parent::setUpSettings();
   }
@@ -110,7 +110,7 @@ public function testInstalled() {
     // Verify German was configured but not English.
     $this->drupalGet('admin/config/regional/language');
     $this->assertSession()->pageTextContains('German');
-    $this->assertNoText('English');
+    $this->assertSession()->pageTextNotContains('English');
   }
 
   /**
diff --git a/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigNoConfigTest.php b/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigNoConfigTest.php
index acdb6b22de5d241ad18a5264fb3f0b3aacfabc06..ddc256a45766d7595fb7b5a0a821d367236381af 100644
--- a/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigNoConfigTest.php
+++ b/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigNoConfigTest.php
@@ -39,7 +39,7 @@ public function testConfigSync() {
     $this->assertSession()->pageTextContains('This import is empty and if applied would delete all of your configuration, so has been rejected.');
 
     // Ensure there is no continuation button.
-    $this->assertNoText('Save and continue');
+    $this->assertSession()->pageTextNotContains('Save and continue');
     $this->assertSession()->buttonNotExists('edit-submit');
   }
 
diff --git a/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigNoSystemSiteTest.php b/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigNoSystemSiteTest.php
index bc1483da612d0d879543e9ebfd598bf268bb9073..96499dc3364ecc1bd2fadab542cade0892339413 100644
--- a/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigNoSystemSiteTest.php
+++ b/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigNoSystemSiteTest.php
@@ -35,7 +35,7 @@ public function testConfigSync() {
     $this->assertSession()->pageTextContains('This import does not contain system.site configuration, so has been rejected.');
 
     // Ensure there is no continuation button.
-    $this->assertNoText('Save and continue');
+    $this->assertSession()->pageTextNotContains('Save and continue');
     $this->assertSession()->buttonNotExists('edit-submit');
   }
 
diff --git a/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigSyncDriectoryProfileMismatchTest.php b/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigSyncDriectoryProfileMismatchTest.php
index 3af52960667a4eb4ad8892596202cccac4ee0df4..bee5418af3cc32b63d5f117b650b80d4916f26c3 100644
--- a/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigSyncDriectoryProfileMismatchTest.php
+++ b/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigSyncDriectoryProfileMismatchTest.php
@@ -54,7 +54,7 @@ public function testConfigSync() {
     $this->assertSession()->pageTextContains('The selected installation profile minimal does not match the profile stored in configuration testing_config_install_multilingual.');
 
     // Ensure there is no continuation button.
-    $this->assertNoText('Save and continue');
+    $this->assertSession()->pageTextNotContains('Save and continue');
     $this->assertSession()->buttonNotExists('edit-submit');
   }
 
diff --git a/core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationMultipleLanguageTest.php b/core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationMultipleLanguageTest.php
index a8d783a0e5e7442c9e8a9ccbbf446e10d25085a1..4e6aaddf57b2ff58d263779ca632a8103c1da71a 100644
--- a/core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationMultipleLanguageTest.php
+++ b/core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationMultipleLanguageTest.php
@@ -89,7 +89,7 @@ public function testTranslationsLoaded() {
       $this->assertSession()->pageTextContains('English');
     }
     else {
-      $this->assertNoText('English');
+      $this->assertSession()->pageTextNotContains('English');
     }
 
     // Verify the strings from the translation files were imported.
diff --git a/core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationQueryTest.php b/core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationQueryTest.php
index 6c20e5426adcda6a9f5ebb9c31581dde7291ccb9..be24236edeebaf995a56f281bd0e25f1a8298704 100644
--- a/core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationQueryTest.php
+++ b/core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationQueryTest.php
@@ -63,7 +63,7 @@ public function testInstaller() {
     // Verify German was configured but not English.
     $this->drupalGet('admin/config/regional/language');
     $this->assertSession()->pageTextContains('German');
-    $this->assertNoText('English');
+    $this->assertSession()->pageTextNotContains('English');
   }
 
   /**
diff --git a/core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationTest.php b/core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationTest.php
index 40af4c935c4351bdcf82f06652b0bc6f2a2f93be..a67ac13782c5f500283508a8d2b5ae8df8580c09 100644
--- a/core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationTest.php
+++ b/core/tests/Drupal/FunctionalTests/Installer/InstallerTranslationTest.php
@@ -86,7 +86,7 @@ public function testInstaller() {
     // Verify German was configured but not English.
     $this->drupalGet('admin/config/regional/language');
     $this->assertSession()->pageTextContains('German');
-    $this->assertNoText('English');
+    $this->assertSession()->pageTextNotContains('English');
 
     // The current container still has the english as current language, rebuild.
     $this->rebuildContainer();
diff --git a/core/tests/Drupal/FunctionalTests/Installer/MultipleDistributionsProfileTest.php b/core/tests/Drupal/FunctionalTests/Installer/MultipleDistributionsProfileTest.php
index 1cf2aa589d8a92138996c68e444cbd30223ed169..1c03b84049261b974854c51521a87673ab92a4c2 100644
--- a/core/tests/Drupal/FunctionalTests/Installer/MultipleDistributionsProfileTest.php
+++ b/core/tests/Drupal/FunctionalTests/Installer/MultipleDistributionsProfileTest.php
@@ -59,7 +59,7 @@ protected function setUpLanguage() {
     // Verify that the requested theme is used.
     $this->assertRaw('bartik');
     // Verify that the "Choose profile" step does not appear.
-    $this->assertNoText('profile');
+    $this->assertSession()->pageTextNotContains('profile');
 
     parent::setUpLanguage();
   }
diff --git a/core/tests/Drupal/Tests/Listeners/DeprecationListenerTrait.php b/core/tests/Drupal/Tests/Listeners/DeprecationListenerTrait.php
index aadbf5a701d000528b53f926dfa662f987fc8b55..bd7330d365051184f033ee10829041ce2a4079cd 100644
--- a/core/tests/Drupal/Tests/Listeners/DeprecationListenerTrait.php
+++ b/core/tests/Drupal/Tests/Listeners/DeprecationListenerTrait.php
@@ -120,7 +120,6 @@ public static function getSkippedDeprecations() {
       "The \"Drupal\Tests\Listeners\DrupalListener\" class uses \"PHPUnit\Framework\TestListenerDefaultImplementation\" that is deprecated The `TestListener` interface is deprecated.",
       "The \"PHPUnit\Framework\TestSuite\" class is considered internal This class is not covered by the backward compatibility promise for PHPUnit. It may change without further notice. You should not use it from \"Drupal\Tests\TestSuites\TestSuiteBase\".",
       // Simpletest's legacy assertion methods.
-      'AssertLegacyTrait::assertNoText() is deprecated in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->responseNotContains() or $this->assertSession()->pageTextNotContains() instead. See https://www.drupal.org/node/3129738',
       'AssertLegacyTrait::assertRaw() is deprecated in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->responseContains() instead. See https://www.drupal.org/node/3129738',
       'AssertLegacyTrait::assertNoRaw() is deprecated in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->responseNotContains() instead. See https://www.drupal.org/node/3129738',
       // PHPUnit 9.
diff --git a/core/tests/Drupal/Tests/RequirementsPageTrait.php b/core/tests/Drupal/Tests/RequirementsPageTrait.php
index 0c2cc2a114553d806895ded71f528f42291ed656..0c0871c85d07b6e8f6a1329b95dbb94e6992b5b3 100644
--- a/core/tests/Drupal/Tests/RequirementsPageTrait.php
+++ b/core/tests/Drupal/Tests/RequirementsPageTrait.php
@@ -14,7 +14,7 @@ protected function updateRequirementsProblem() {
     // Assert a warning is shown on older test environments.
     $links = $this->getSession()->getPage()->findAll('named', ['link', 'try again']);
     if ($links && version_compare(phpversion(), \Drupal::MINIMUM_SUPPORTED_PHP) < 0) {
-      $this->assertNoText('Errors found');
+      $this->assertSession()->pageTextNotContains('Errors found');
       $this->assertWarningSummaries(['PHP']);
       $this->clickLink('try again');
       $this->checkForMetaRefresh();
@@ -36,7 +36,7 @@ protected function updateRequirementsProblem() {
    *   a warning not in the list is present, a fail is raised.
    */
   protected function continueOnExpectedWarnings($expected_warnings = []) {
-    $this->assertNoText('Errors found');
+    $this->assertSession()->pageTextNotContains('Errors found');
     $this->assertWarningSummaries($expected_warnings);
     $this->clickLink('continue anyway');
     $this->checkForMetaRefresh();