SMS and Phone Calls

SMS and Phone Calls

SMS

You can send messages thanks to testRigor’s Twilio integration. There is a section in the application settings under Integrations for setting Twilio parameters; it is required for sending messages.

You can add custom steps like:
sms "+15344297154" with body "this is content" and validate it was sent
Or
send sms to "+15344297154" with content "this is content"
send message to "+15344297154" with text "this is content" and check it was delivered
send message from "+15551234567" to "+15344297154" with text "this is content" and check it was failed message from "+15551234567" to "+15344297154" with body "this is content" and check it was not delivered

The number from which to send a message is optional in the settings and may need to be allocated prior to using.

You can also check SMS messages and validate and store their contents:
check that sms from "+12345678901" to "+12345678902" contains "Code" and matches regex "Code\:\d\d\d\d" and save it as "sms"
You can then additionally apply the extract value command to get the code:
check that sms to "+12345678902" 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"
The number from, number to, and body can be taken from stored values or parameterized strings. Additionally, the message body may be a multiline string:
send sms from stored value "allocatedNumber" to stored value "answerPhoneNumber" with content from string with parameters starting from next line and ending with <END>
${answerCode} b
<END>

Phone Calls

testRigor supports making calls through Twilio. As with SMS, Twilio parameters are required in the settings for making calls.

After the integration is set up, you can add custom steps like:
call "+15344297154" and validate it was picked up
make call to "+15344297154" and check it was answered
call to +15344297154

OTP / 2-factor authentication

testRigor supports two-factor authentication (2FA). Below are a couple of examples:

Testing 2FA with a text message (this requires the Twilio integration):
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!"
Testing 2FA via an email:
check that email to saved value "newEmail" was received
grab value by template "######" and save it as "OTP"
switch to tab "1"
enter stored value "OTP" into "code"

Google Authenticator support for Gmail 2FA

Through Gmail 2FA support, testRigor users can use 2FA within test cases. Refer to this article on how to configure the Gmail account and the test suite in testRigor application.

Test your knowledge

capture value by regex “(?<=Code:)[0-9]{4}” from “sms” and save it as “authCode”
pull value by regex “(?<=Code:)[0-9]{4}” from “sms” and log it
extract value by regex “(?<=Code:)[0-9]{4}” from “sms” and save it as “confirmationCode”
decipher value using “(?<=Code:)[0-9]{4}” and store as “2FA_code
Multiple correct answers
grab value of “[0-9]{6}” from “sms” and save it as “authCode”
extract value by regex “(?<=Code:)[0-9]{4}” from “sms” and save it as “confirmationCode”
grab value of “[0-9]{5}” from “sms” and save it as “verificationCode”
extract value by regex “(?<=Code:)[0-9]{5}” from “sms” and save it as “confirmationCode”
decipher value using “(?<=Code:)[0-9]{6}” from “sms” and store as “2FA_code”
Multiple correct answers
call “+15344297154” and validate it was picked up
call through twilio “+15344297154” and validate it was picked up
make call to “+15344297154” and check it was answered
call phone number “+15344297154” and verify that it was picked up