code: public function assertNoErrorMessages()
      {
          foreach ($this->getMessagesContainers('error') as $element) {
              // Some modules are inserted an empty container for errors before
              // they are arise. The "Clientside Validation" - one of them.
              $text = trim($element->getText());
  
              if ('' !== $text) {
                  throw new \RuntimeException(sprintf(
                      'The page "%s" contains following error messages: "%s".',
                      self::$pageUrl,
                      $text
                  ));
              }
          }
  
          /** @var NodeElement $formElement */
          foreach ($this->getSession()->getPage()->findAll('css', 'input, select, textarea') as $formElement) {
              if ($formElement->hasClass('error')) {
                  throw new \Exception(sprintf(
                      'Element "#%s" has an error class.',
                      $formElement->getAttribute('id')
                  ));
              }
          }
      }
docs: Check that the page have no error messages and fields - error classes.
  
  @throws \RuntimeException
  @throws \Exception
  
  @Then /^(?:|I )should see no errors(?:| on the page)$/