diff -u b/core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php b/core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php --- b/core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php +++ b/core/tests/Drupal/FunctionalTests/AssertLegacyTrait.php @@ -611,12 +611,11 @@ $found = FALSE; if ($fields) { foreach ($fields as $field) { - if ($field->getAttribute('type') == 'checkbox') { - // Checkbox with the correct checked state if the value was passed - // as a boolean. - $found = !is_bool($value) || $field->isChecked() === $value; + if ($field->getAttribute('value') == $value) { + // Input element with correct value. + $found = TRUE; } - elseif ($field->getTagName() == 'select' && $field->find('xpath', '//option[@value = ' . (new Escaper())->escapeLiteral($value) . ' and @selected = "selected"]')) { + elseif ($field->find('xpath', '//option[@value = ' . (new Escaper())->escapeLiteral($value) . ' and @selected = "selected"]')) { // Select element with an option. $found = TRUE; } @@ -624,10 +623,6 @@ // Text area with correct text. $found = TRUE; } - elseif ($field->getAttribute('value') == $value) { - // Input element with correct value. - $found = TRUE; - } } } }