title: How can we test the alert and the text it is displaying using Cypress.io Js automation framework?
body: <p>How can we test the alert and text inside is displaying using Cypress.io Js automation framework? I am unable to figure out the relevant example in Cypress documentation, please advise.</p>
  
  <pre><code>describe('Test an alert and the text displaying', function() {
  it('Verify alert and its text content', function(){
      cy.visit('http://www.seleniumeasy.com/test/javascript-alert-box-demo.html')     
      cy.get('button').contains('Click me!').click()
      cy.on ('window:alert', 'I am an alert box!')    
  
      })
  
  })
  </code></pre>