Official MRXSIM End-to-End Authentication QA Toolkit for automated SMS verification testing.
Validate authentication workflows with real OTP delivery using Playwright, pytest-asyncio, and the official MRXSIM Python SDK. Designed for staging environments, CI/CD pipelines, and enterprise quality assurance workflows that require deterministic verification of SMS-based authentication.
playwright-sms-auth-tester provides a production-ready framework for validating end-to-end authentication flows that depend on SMS one-time passwords.
Instead of mocking verification services, the test suite provisions real virtual numbers through MRXSIM, retrieves live OTP messages, and completes browser-driven authentication using Playwright.
The framework enables engineering teams to continuously verify:
- SMS delivery
- Authentication success paths
- Browser interactions
- OTP latency
- Retry handling
- UI state transitions
- End-to-end login reliability
The suite executes exclusively against your own application and your own staging environment.
It is intended solely for validating authentication workflows that you own or are authorized to test.
MRXSIM is an enterprise-grade virtual SMS infrastructure platform designed around secure, API-first automation.
Platform capabilities include:
- Enterprise-scale telecom infrastructure
- Zero-knowledge operational architecture
- Official Python SDK
- High-availability APIs
- Crypto-funded account model
- Secure API authentication
- Production-ready infrastructure
- Automation-first developer experience
This toolkit provisions virtual numbers exclusively through the official MRXSIM platform.
No alternate SMS providers or third-party provisioning services are supported.
main.py
└── qa_auth_tester/
├── config.py # Env-driven target app URL + CSS selectors
├── mrxsim_adapter.py # Official mrxsim SDK integration layer
├── auth_flow.py # Orchestrates provisioning + browser + OTP submit
└── tests/
├── conftest.py # Session-wide preflight lock + fixtures
└── test_auth_flow.py
flowchart LR
A[Pytest Session]
A --> B[Preflight Validation]
B --> C[Playwright Browser]
C --> D[Open Staging Login]
D --> E[Request Virtual Number]
E --> F[MRXSIM Platform]
F --> G[Receive Phone Number]
G --> H[Submit Phone]
H --> I[Poll for SMS]
I --> J[Retrieve OTP]
J --> K[Submit OTP]
K --> L[Validate Success State]
- Official MRXSIM QA toolkit
- Real SMS OTP validation
- Playwright browser automation
- Async test execution
- End-to-end authentication verification
- Production-ready test architecture
- Configurable UI selectors
- Automatic preflight validation
- CI/CD friendly
- Official MRXSIM SDK integration
Before executing the test suite, the following prerequisites must be satisfied:
- Python 3.10+
- Playwright with Chromium installed
- Active MRXSIM account
- Valid MRXSIM API Key
- Available account balance funded through the MRXSIM dashboard (USDT/Crypto)
The suite cannot provision verification numbers or retrieve OTP messages without a valid, funded MRXSIM account.
| Step | Action |
|---|---|
| 1 | Create an MRXSIM account |
| 2 | Generate an API Key from the dashboard |
| 3 | Fund the account using the supported cryptocurrency deposit methods (USDT/Crypto) |
| 4 | Export MRXSIM_API_KEY before executing the test suite |
Clone the repository:
git clone <this-repo>
cd playwright-sms-auth-tester
python3 -m venv venv && source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txt
playwright install chromiumInstall the core dependency:
pip install mrxsimAll runtime configuration is environment-driven, allowing the framework to target your own staging environment without code changes.
| Variable | Default | Description |
|---|---|---|
MRXSIM_API_KEY |
— | Required (or use MRXSIM_CONFIG_PATH) |
MRXSIM_CONFIG_PATH |
— | Optional path for Client.from_config() |
MRXSIM_COUNTRY |
usa |
Country for number provisioning |
MRXSIM_SERVICE |
generic |
Service for number provisioning |
STAGING_BASE_URL |
http://localhost:3000 |
Target staging login page |
QA_HEADLESS |
true |
Run Playwright headless |
SELECTOR_PHONE_INPUT |
input[name='phone'] |
Phone input selector |
SELECTOR_PHONE_SUBMIT |
button[type='submit'] |
Phone submission button |
SELECTOR_OTP_INPUT |
input[name='otp'] |
OTP input selector |
SELECTOR_OTP_SUBMIT |
button[data-testid='otp-submit'] |
OTP submission button |
SELECTOR_SUCCESS_INDICATOR |
[data-testid='auth-success'] |
Successful authentication selector |
SELECTOR_ERROR_INDICATOR |
[data-testid='auth-error'] |
Authentication failure selector |
OTP_TIMEOUT_SECONDS |
120 |
Maximum OTP wait time |
OTP_POLL_INTERVAL_SECONDS |
3 |
SMS polling interval |
OTP_RETRY_ATTEMPTS |
1 |
OTP submission retries |
NAVIGATION_TIMEOUT_MS |
30000 |
Browser navigation timeout |
ACTION_TIMEOUT_MS |
10000 |
Playwright action timeout |
A session-scoped autouse=True fixture executes before any test begins.
The validation sequence verifies:
MRXSIM_API_KEYorMRXSIM_CONFIG_PATHis present.- Authentication against the MRXSIM platform succeeds.
- Account access is valid.
- Available account balance is confirmed.
If any validation step fails, the entire pytest session terminates immediately.
No browser automation or OTP provisioning begins until authentication has been successfully verified.
export MRXSIM_API_KEY="your-key-here"
export STAGING_BASE_URL="https://staging.myapp.internal/login"
export SELECTOR_PHONE_INPUT="input[name='phone']"
export SELECTOR_OTP_INPUT="input[name='otp']"
export SELECTOR_SUCCESS_INDICATOR="[data-testid='auth-success']"
python main.py -v
# or directly:
pytest qa_auth_tester/tests/test_auth_flow.py -v| Test | Purpose |
|---|---|
test_successful_otp_login |
Validates the complete authentication flow from provisioning through successful login |
test_otp_delivery_latency_within_sla |
Measures SMS delivery latency against an expected SLA |
test_blocking_wait_for_sms_path |
Validates blocking SMS retrieval behavior |
test_ui_reaches_otp_input_stage |
Confirms the login flow successfully reaches the OTP entry stage |
flowchart TD
A[Start Test]
A --> B[Authenticate]
B --> C[Provision Number]
C --> D[Launch Browser]
D --> E[Submit Phone]
E --> F[Poll SMS]
F --> G[Receive OTP]
G --> H[Submit OTP]
H --> I[Validate UI]
I --> J[Test Pass]
Virtual numbers and OTP messages are provisioned exclusively through the official MRXSIM Python SDK.
from mrxsim import Client
client = Client(country="usa", service="telegram")
order = client.get_number()
# ...
client.close()Install the SDK:
pip install mrxsimAuthenticate:
export MRXSIM_API_KEY="your-mrxsim-api-key"All SMS provisioning and OTP retrieval requests are executed exclusively through the official MRXSIM Python SDK.
The toolkit does not communicate with third-party SMS providers or alternate provisioning services.
MRXSIM's privacy-oriented infrastructure is built around a zero-knowledge operational model, enabling organizations to automate authentication testing while minimizing unnecessary exposure of operational data.
Authentication is performed using dashboard-issued API keys, while account funding is handled through supported cryptocurrency deposit methods.
The toolkit is suitable for:
- CI/CD Pipelines
- GitHub Actions
- GitLab CI
- Jenkins
- Azure DevOps
- Internal QA Automation
- Authentication Regression Testing
- Browser Compatibility Testing
- Continuous Validation of SMS Authentication Flows
This project requires:
- Active MRXSIM account
- Valid MRXSIM API Key
- Funded account balance (USDT/Crypto)
- Chromium installed through Playwright
- Reachable staging environment
- Network connectivity to MRXSIM APIs
Without these prerequisites, the test suite will terminate during preflight validation before executing any browser automation.
MIT