cypress-temp-sms
TypeScript icon, indicating that this package has built-in type declarations

1.0.5 • Public • Published

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

Package Sidebar

Install

npm i cypress-temp-sms

Weekly Downloads

10

Version

1.0.5

License

none

Unpacked Size

12.2 kB

Total Files

12

Last publish

Collaborators

  • madhan_raj