COMM::SMS
Automate SMS reception and extract its content.
Properties
Property | Description | Type | Required |
---|---|---|---|
contact | Phone number to receive SMS, including country code (e.g., +14081234567) without spaces or special characters | string | true |
within | Time limit in milliseconds to receive the SMS from the test start time. Defaults to 3000ms. | long | false |
Output
📝 Note: Accessible using
context["last_output"]
Key | Description | Type |
---|---|---|
message | The content of the received SMS | string |
timeTaken | Time taken to receive the SMS, in milliseconds | long |
error | Error message if the SMS is not received within the specified time | string |
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
}