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

codeceptjs-webhooksite-helper

v1.1.11

Published

Webhook.site Helper for codeceptjs

Downloads

16

Readme

"Buy Me A Coffee"

codeceptjs-webhooksite-helper

CodeceptJS webhooksite helper wraps webhooksite APIs to test incoming HTTP requests and emails.

NPM package: https://www.npmjs.com/package/codeceptjs-webhooksite-helper

Installation

npm i codeceptjs-webhooksite-helper --save-dev

Configuration

This helper should be added in your codeceptjs config file: codecept.conf.*

Example:

{
...
   helpers: {
    REST: {
      prettyPrintJson: true
    },
    WebhooksiteHelper: {
      require: 'codeceptjs-webhooksite-helper',
    }
   }
...
}

Usage

  • To use this helper, you must enable REST helper
  • If there is auto-complete for I actor, try running npx codeceptjs def
  • Some provided actions:
/**
   * Get webhook.site uuid/token
   */
  getWebhookSiteToken(): Promise<string>;

  /**
   * Get webhook.site url
   * @param  {String} token
   */
  getWebhookSiteToken(token?): Promise<string>;

  /**
   * Get webhook.site unique email address
   */
  getWebhookSiteUniqueEmailAddress(): Promise<string>;

  /**
   * Get data sent to webhook.site, it could be either HTTP requests or email
   * @param  {String} token
   */
  getDataSentToWebhookSite(token?): Promise<any>;

Options

Only token that you need to provide in config level, otherwise you can provide the token when calling the steps.

Example:

Feature('Webhook tests');

Scenario.only('Get sent object from webhook.site',  async ({ I }) => {
    await I.getDataSentToWebhookSite()
});

Output

Webhook tests --
    [1]  Starting recording promises
    Timeouts: 
 › [Session] Starting singleton browser session
  Get sent object from webhook.site
    I get data sent to webhook site 
    › [Request] {"baseURL":"https://webhook.site/token/c4e2e097-ac9b-473b-bf64-be3ee9d99710/requests","headers":{}}
    › [Response] {"data":[{"uuid":"be120beb-65e8-4956-aa1e-ce1bc9508770","type":"web","token_id":"c4e2e097-ac9b-473b-bf64-be3ee9d99710","ip":"87.173.212.50","hostname":"webhook.site","method":"POST","user_agent":"insomnia/2021.4.1","content":"{\"a\": \"hello\"}","query":null,"headers":{"connection":["close"],"content-length":["14"],"accept":["*/*"],"content-type":["application/json"],"user-agent":["insomnia/2021.4.1"],"host":["webhook.site"]},"url":"https://webhook.site/c4e2e097-ac9b-473b-bf64-be3ee9d99710","size":14,"files":[],"created_at":"2023-03-07 13:52:43","updated_at":"2023-03-07 13:52:43","sorting":1678197163390912,"custom_action_output":[]}],"total":1,"per_page":50,"current_page":1,"is_last_page":true,"from":1,"to":1}
  ✔ OK in 237ms


  OK  | 1 passed   // 651ms