https://cypress.io logo
Verify javaScript redirects to email
# i-need-help
g
Hi All My application uses javascript redirects to open an email client with subject, body, link etc. For example,
Copy code
<html>
  <button id="email">Email</button>
  <script>
    document.querySelector('#email').addEventListener('click', () => {
      window.location.href = 'mailto:?subject=XXXXXX&body=YYYYYYlink:%20https:/localhost:12345/id'
    })
  </script>
</html>
I don't want the email client to open and need to verify the content of the email when click the button. Is there a way to do that? Thanks