diff --git a/core/tests/Drupal/Tests/WebAssert.php b/core/tests/Drupal/Tests/WebAssert.php
index f2b2855..cc8b2b2 100644
--- a/core/tests/Drupal/Tests/WebAssert.php
+++ b/core/tests/Drupal/Tests/WebAssert.php
@@ -501,4 +501,31 @@ public function hiddenFieldValueNotEquals($field, $value, TraversableElement $co
     $this->assert(!preg_match($regex, $actual), $message);
   }
 
+  /**
+   * Asserts that several pieces of markup are in a given order in the page.
+   *
+   * @param string[] $items
+   *   An ordered list of strings.
+   *
+   * @throws \Behat\Mink\Exception\ExpectationException
+   *   When any of the given string is not found.
+   */
+  public function orderInPage(array $items) {
+    $text = $this->session->getPage()->getHtml();
+    $strings = [];
+    foreach ($items as $item) {
+      if (($pos = strpos($text, $item)) === FALSE) {
+        throw new ExpectationException("Cannot find '$item' in the page", $this->session->getDriver());
+      }
+      $strings[$pos] = $item;
+    }
+    ksort($strings);
+    $ordered = implode(', ', array_map(function ($item) {
+      return "'$item'";
+    }, $items));
+    if ($items !== array_values($strings)) {
+      throw new ExpectationException("Strings were not correctly ordered as: $ordered.", $this->session->getDriver());
+    }
+  }
+
 }
