Cypress is a browser automation tool that can be used with MailSlurp to test SMS automation such as login and sign-up app flows. In this post we will demonstrate how to setup Cypress to fetch and read real text messages from phone numbers we create in MailSlurp. We will use the Cypress SMS plugin to achieve this (or we could use the MailSlurp client directly).

The code for this examples can be found on Github.

Setup and install

First install Cypress JS and configure the config file:

Write a test

We will test the sign-up process for a demonstration app. The app allows sign-up with a phone number and sends a verification code to the users via SMS. The code must then be extracted and entered into the app to complete sign-up.