Skip to main content

COMM::SMS

Automate SMS reception and extract its content.

Properties

PropertyDescriptionTypeRequired
contactPhone number to receive SMS, including country code (e.g., +14081234567) without spaces or special charactersstringtrue
withinTime limit in milliseconds to receive the SMS from the test start time. Defaults to 3000ms.longfalse

Output

📝 Note: Accessible using context["last_output"]

KeyDescriptionType
messageThe content of the received SMSstring
timeTakenTime taken to receive the SMS, in millisecondslong
errorError message if the SMS is not received within the specified timestring

Example

smsTests.yml
tests:
receiveSmsTest:
tasks:
- expect: expects.receiveSms
validate: scripts.validateSms

expects:
receiveSms:
type: COMM::SMS
props:
contact: <contact_number>
within: <time_in_ms>

scripts:
validateSms: assert context["last_output"]["message"] == "<expected_sms_content>"

Example Output

{
"message": "Your verification code is 123456",
"timeTaken": 1500,
"error": null
}