npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

cypress-pipedream-plugin

v1.2.5

Published

Cypress Plugin | Enhances Cypress testing capabilities by providing convenient commands for retrieving received SMS history from Pipedream. Simplify your end-to-end testing workflow by effortlessly integrating SMS history verification into your Cypress te

Downloads

284

Readme

Retrieve SMS history from Pipedream

This npm library enhances Cypress testing capabilities by providing convenient commands for retrieving received SMS history from Pipedream.
Simplify your end-to-end testing workflow by effortlessly integrating SMS history verification into your Cypress tests.

Install

$ npm install cypress-pipedream-plugin --save-dev

Alternatively, you can install it as a global module:

$ npm install -g cypress-pipedream-plugin

Prerequisites

A Pipedream source: https://pipedream.com/sources/new.
Pay attention to set the Body Only option to true when creating the source, if you haven't and you have already created the Pipedream-Source enables it here: https://pipedream.com/sources/{your-source}/configuration

Added commands

| Commands | Notes | | --------------------------------- | -------------------------------------------------------------------------------------------------------------- | | cy.getNewestMessage() | Attempts to retrieve last (NEWEST) SMS for a specific Pipedream Source History within a specified time limit. | | cy.getOldestMessage() | Attempts to retrieve first (OLDEST) SMS for a specific Pipedream Source History within a specified time limit. | | cy.clearMessagesHistory() | Clears the SMS history for a specific Pipedream Source. | | cy.clearHistorySendSmsAndGetSMS() | This command simplifies the usage by executing the following commands in sequence: |

cy.clearMessagesHistory() //
cy.get('[data-cy="send-sms"]', { timeout: 120000 }).click() // Command to send the SMS from the frontend
cy.getNewestMessage()

According to cypress documentation adding the data-cy tag to your frontend, is the best way to keep your test updated and maintainable.

Configuration

Inside cypress/support/e2e.js

At the top of your support file (usually cypress/support/e2e.js for e2e testing type):

import 'cypress-pipedream-plugin'

Inside your environment file

You MUST set these environment variables to make this plugin working

| Parameter | Mandatory | Notes | Default | | ------------------- | --------- | --------------------------------------------------------------------------------- | ------------------------------- | | pipedreamBearer | TRUE | Bearer used for Pipedream Auth | \ | | pipedreamSourceID | TRUE | Your Pipedream Source ID | \ | | pipedreamMaxRetries | FALSE | Max retires value for the commands cy.getOldestMessage() or cy.getNewestMessage() | 120 (seconds) | | pipedreamFolderPath | FALSE | Folder where the SMS body will be saved | 'cypress/fixtures/sms-response' | | pipedreamFileName | FALSE | File name in which the message will be written | 'message.json' |

To set these variables dynamically in a multi environment cypress-test, you can use the following plugin: cypress-env

Considerations

To check the file contents, you can use the following command:

cy.readFile('cypress/fixtures/sms_response/message.json', {
	timeout: 60000,
	retries: 3,
}).then((message) {
  ... // do something with the saved message
})

Missing configuration error:

────────────────────────────────────────────────────────────────────────────────────────────────────

  Running:  myFirstTest.cy.js                                                               (1 of 1)

    An uncaught error was detected outside of a test (Attempt 1 of 2)
    Error: The following error originated from your test code, not from Cypress.
  1) An uncaught error was detected outside of a test

  0 passing (1s)
  1 failing

  1) An uncaught error was detected outside of a test:
     Error: The following error originated from your test code, not from Cypress.

  > CYPRESS-PIPEDREAM-PLUGIN | Missing environment variables: env('pipedreamBearer') & env('pipedreamSourceID') needed

────────────────────────────────────────────────────────────────────────────────────────────────────

THE JOB IS DONE!

Happy testing to everyone!

ALEC-JS