testingsmstestrigor

How do I test a text message (SMS) with testRigor?


I'm using testRigor and our system sends text messages. How do I test that a text message has been received?


Solution

  • It is possible by using Twilio. You can go to https://www.twilio.com/ to create a Twilio account and get your first phone number from them. It is even possible with their free version. Once done, you can go to Twilio dashboard and get Account SID, Auth Token, and Phone Number. You then can go to testRigor and specify those 3 parameters in Settings/Integration under Twilio section. Once this is done you can use that phone number you got from Twilio on your system and then you'll be able to use the following testRigor code (assuming your phone number you got from Twilio is +12345678902):

    check that sms to "+12345678902" is delivered
    

    For example, a 2-factor authentication login test can look like this:

    click "Sign in"
    enter "jacob" into "Username"
    enter "jacobs-secure-password" into "Password"
    click "Verify me"
    check that sms to "+12345678902" is delivered and matches regex "Code\:\d\d\d\d" and save it as "sms"
    extract value by regex "(?<=Code\:)[0-9]{4}" from "sms" and save it as "confirmationCode"
    enter saved value "confirmationCode" into "code"
    click "Continue to Login"
    check that page contains text "Welcome, Jacob!"