npm.io
1.0.9 • Published 1 year ago

cypress-webhookdotsite

Licence
MIT
Version
1.0.9
Deps
1
Size
9 kB
Vulns
0
Weekly
0
Stars
2

Node.js Package

NPM

cypress-webhookdotsite

cypress npm extension to allow for email and webhook testing through webhook.site

What is it?

Webhook.site is a developer tool that provides email and webhook testing. This is a third party library and I have no affiliation to webhook.site or any of its partners.

Installation

npm install cypress-webhookdotsite --save-dev

Once downloaded, add the following line to cypress/support/index.js to import the commands into your Cypress project:

require('cypress-webhookdotsite');
Example Usage
cy.webhookGenerateToken({
  apikey: 'ff07eb99-ed12-4f55-8fa1-65c7567d41b9',
  password: 'Password1234',
}).then((token) => {
  cy.log(`Token: ${token}`);
  cy.webhookGetEmailAddress({
    token: token,
    apikey: 'ff07eb99-ed12-4f55-8fa1-65c7567d41b9',
    password: 'Password1234',
  }).then((emailAddress) => {
    console.log(emailAddress);
    cy.log(`Email Address: ${emailAddress}`);
  });
  cy.webhookGetURI({
    token: token,
    apikey: 'ff07eb99-ed12-4f55-8fa1-65c7567d41b9',
    password: 'Password1234',
  }).then((webHookURI) => {
    console.log(webHookURI);
    cy.log(`WebHook URI: ${webHookURI}`);
    cy.request(webHookURI);
  });
  cy.webhookGetAllRequests({
    token: token,
    apikey: 'ff07eb99-ed12-4f55-8fa1-65c7567d41b9',
    password: 'Password1234',
  }).then((responses) => {
    console.log(responses);
    responses.forEach((response) => {
      cy.log(`Response: ${response.ip}`);
    });
  });
});

Keywords