title: How do I use Cypress to detect output of setCustomValidity on HTML5 Form Validation
body: <p>I am using the latest version of Cypress to build functional tests for my application Javascript. I am running them on both the built-in Electron browser and on Chrome on Mac OS X (all updates/upgrades applied to both browser and OS). I have the same problem when running the tests in both browsers. </p>
  
  <p>One of my JS functions is invoked when a form value is changed. It checks the value and if it is invalid, uses the HTML5 setCustomValidity() function on that input to set a message and prevent the form from submitting. This has the correct effect in the browser.</p>
  
  <p>In Cypress I thought I could write a test check to see if this setCustomValidity() call has been made by doing something like:</p>
  
  <pre><code>cy.get('#myinputelement').its('validationMessage').should('have.value', 'My custom validation message')
  </code></pre>
  
  <p>But it complains that the input element does not have the attribute 'validationMessage' (even though it does show up in the DOM in the browser console). The input element matching the selector definitely does exist, as calling .type() on the same correctly fills it with a value.</p>
  
  <p>Can Cypress see the validityMessage attribute at all? If not, how do I go about testing for JS calls to setCustomValidity() from Cypress?</p>