diff --git a/core/modules/system/tests/modules/test_page_test/src/Form/TestForm.php b/core/modules/system/tests/modules/test_page_test/src/Form/TestForm.php
index c619a7d..affe910 100644
--- a/core/modules/system/tests/modules/test_page_test/src/Form/TestForm.php
+++ b/core/modules/system/tests/modules/test_page_test/src/Form/TestForm.php
@@ -35,6 +35,12 @@ public function buildForm(array $form, FormStateInterface $form_state) {
       '#default_value' => 'Test name',
     ];
 
+    $form['description'] = [
+      '#type' => 'textfield',
+      '#title' => 'Description',
+      '#default_value' => '',
+    ];
+
     $form['options'] = [
       '#type' => 'select',
       '#title' => 'Options',
diff --git a/core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php b/core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php
index 1cf46fc..78d4bee 100644
--- a/core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php
+++ b/core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php
@@ -412,7 +412,7 @@ protected function assertNoLinkByHref($href) {
    *   $this->assertSession()->fieldValueNotEquals() instead.
    */
   protected function assertNoFieldById($id, $value = '') {
-    if ($this->getSession()->getPage()->findField($id)) {
+    if ($this->getSession()->getPage()->findField($id) && isset($value)) {
       $this->assertSession()->fieldValueNotEquals($id, (string) $value);
     }
     else {
diff --git a/core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php b/core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php
index b555fb6..4586c9a 100644
--- a/core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php
+++ b/core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\FunctionalTests;
 
+use Behat\Mink\Exception\ExpectationException;
 use Drupal\Component\Utility\Html;
 use Drupal\Core\Url;
 use Drupal\Tests\BrowserTestBase;
@@ -148,9 +149,9 @@ public function testLegacyTextAsserts() {
   }
 
   /**
-   * Tests legacy XPath asserts.
+   * Tests legacy field asserts.
    */
-  public function testLegacyXPathAsserts() {
+  public function testLegacyFieldAsserts() {
     $this->drupalGet('test-field-xpath');
     $this->assertFieldsByValue($this->xpath("//h1[@class = 'page-title']"), NULL);
     $this->assertFieldsByValue($this->xpath('//table/tbody/tr[2]/td[1]'), 'one');
@@ -163,6 +164,29 @@ public function testLegacyXPathAsserts() {
 
     $this->assertNoFieldByXPath('//notexisting');
     $this->assertNoFieldByXPath("//input[@id = 'edit-name']", 'wrong value');
+
+    $this->assertNoFieldById('name');
+    $this->assertNoFieldById('name', 'not the value');
+    $this->assertNoFieldById('notexisting');
+    $this->assertNoFieldById('notexisting', NULL);
+
+    // Test that the assertion fails correctly if no value is passed in.
+    try {
+      $this->assertNoFieldById('description');
+      $this->fail('The "description" field, with no value was not found.');
+    }
+    catch (ExpectationException $e) {
+      $this->pass('The "description" field, with no value was found.');
+    }
+
+    // Test that the assertion fails correctly if a NULL value is passed in.
+    try {
+      $this->assertNoFieldById('name', NULL);
+      $this->fail('The "name" field was not found.');
+    }
+    catch (ExpectationException $e) {
+      $this->pass('The "name" field was found.');
+    }
   }
 
   /**
