JSPM

cypress-temp-sms

1.0.5
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 13
  • Score
    100M100P100Q59881F

Provides temporary mobile numbers for SMS/OTP testing with Cypress

Package Exports

  • cypress-temp-sms
  • cypress-temp-sms/src/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (cypress-temp-sms) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

cypress-temp-sms

CircleCI

cypress-temp-sms ✔

A lightweight npm library designed to generate temporary mobile numbers that shall be used for SMS verification as part of end-to-end testing with Cypress. It streamlines the process of testing OTP,2FA -related functionalities in your applications.

Thanks https://receive-smss.com/ 🙏

Disclaimer:

⚠️ In this plugin, we are using https://receive-smss.com/ to generate temporary numbers and read its SMS inbox. Please note that these are several disposable numbers are to be used 👉 only for testing activities 👈

Features

  • Quick Setup: Easily integrate with your Cypress tests.
  • Disposable mobile numbers: Generate temporary mobile numbers for testing sign-ups, password resets, and more.

Installation

Install cypress-temp-sms using below command:

npm install cypress-temp-sms --save-dev

Usage

Add below line in your Cypress project - cypress/support/commands.js

import 'cypress-temp-sms'

Generate a new temporary number:

cy.getRandomNumber()  
//Returns you a temp number generated using https://receive-smss.com/

Generate a new temporary number with specific country:

cy.getNumberFrom('India')  
//Returns you a temp number generated using https://receive-smss.com/

Get the SMS inbox for the genrated number:

cy.getSMS('+123456789') 
//Returns below array object for the SMS inbox data. ( Last 40 Messages )
{ sender: string, message: any, received: string }[]

Contributing

Contributions are welcome!

#HappyTesting