Skip to main content
Your app texts a one-time passcode to the provisioned number, and a JavaScript step in the test fetches the latest message and pulls the code out. Use a single number for serial runs; lease numbers from a pool when tests run in parallel.
Prerequisite: A Momentic-provisioned phone number. Request one.

Single-number setup

If you only need OTP login from one fixed number (or your tests don’t run in parallel), fetch the latest message and pull the code out:
Then add a Type step with value {{ env.OTP_CODE }}.

Parallel runs against the same OTP flow

If you run the same OTP login test in parallel (e.g. multiple shards in CI), two tests can race on the same inbound code. Lease a number from your pool so each shard gets its own. Momentic releases it back to the pool when the test finishes.
See sms.lease() for full options (TTL, fail-fast, optional manual release).
Both examples poll for up to 30 seconds, well within the JavaScript step’s 90-second default timeout. For longer polls, raise the step’s Timeout field, up to 600 seconds.