Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cypress-otp

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cypress-otp

Encode a Cypress fixture with Protocol Buffers

  • 1.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
56K
decreased by-7.14%
Maintainers
1
Weekly downloads
 
Created
Source

Cypress OTP

Enter a valid OTP token in your UI tests

Build Status Build Cron Renovate enabled Commitizen friendly Open Source Love npm

Cypress OTP

Use this plugin to insert a valid OTP token in a Cypress test.

Installation

npm i -D cypress-otp
# or
yarn add -D cypress-otp

then open your cypress/plugins/index.js file and register a new task

module.exports = on => {
  on("task", {
    generateOTP: require("cypress-otp")
  });
};

How to use it

To get an OTP code

cy.task("generateOTP", "YOUR_SECRET").then(token => {
  cy.get("#otp-token").type(token);
});

Take a look at the example test source code.

Tips

  • the plugin saves the last used secret so you can avoid to pass it every time. You can even set it at the beginning of your test suite
before(() => {
  cy.task("generateOTP", "YOUR_SECRET");
});

and then consume the generateOTP task

cy.task("generateOTP").then(token => {
  cy.get("#otp-token").type(token);
});

Contributors

Thanks goes to these wonderful people (emoji key):

Stefano Magni
Stefano Magni

💻 ⚠️

This project follows the all-contributors specification. Contributions of any kind welcome!

Keywords

FAQs

Package last updated on 08 Apr 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc