diff --git a/core/modules/simpletest/src/Tests/UiPhpUnitOutputTest.php b/core/modules/simpletest/src/Tests/UiPhpUnitOutputTest.php
index e032cef941..c2ebfc92c4 100644
--- a/core/modules/simpletest/src/Tests/UiPhpUnitOutputTest.php
+++ b/core/modules/simpletest/src/Tests/UiPhpUnitOutputTest.php
@@ -35,9 +35,9 @@ public function testOutput() {
 
     // Check that there are <br> tags for the HTML output by
     // SimpletestUiPrinter.
-    $this->assertEqual($output[19], 'HTML output was generated<br />');
+    $this->assertEqual($output[20], 'HTML output was generated<br />');
     // Check that URLs are printed as HTML links.
-    $this->assertIdentical(strpos($output[20], '<a href="http'), 0);
+    $this->assertIdentical(strpos($output[21], '<a href="http'), 0);
   }
 
 }
diff --git a/core/tests/Drupal/Tests/WebAssert.php b/core/tests/Drupal/Tests/WebAssert.php
index 8149551700..4b98a18517 100644
--- a/core/tests/Drupal/Tests/WebAssert.php
+++ b/core/tests/Drupal/Tests/WebAssert.php
@@ -416,6 +416,30 @@ public function assertEscaped($raw) {
     $this->responseContains(Html::escape($raw));
   }
 
+  /**
+   * Checks that page HTML (response content) contains text.
+   *
+   * @param string|object $text
+   *   Text value. Any non-string value will be cast to string.
+   *
+   * @throws ExpectationException
+   */
+  public function responseContains($text) {
+    parent::responseContains((string) $text);
+  }
+
+  /**
+   * Checks that page HTML (response content) does not contains text.
+   *
+   * @param string|object $text
+   *   Text value. Any non-string value will be cast to string.
+   *
+   * @throws ExpectationException
+   */
+  public function responseNotContains($text) {
+    parent::responseNotContains((string) $text);
+  }
+
   /**
    * Asserts a condition.
    *
