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 🙏

© 2025 – Pkg Stats / Ryan Hefner

cypress-playwright-data-gen

v1.0.11

Published

A simple Cypress & Playwright plugin for generating realistic test data using Faker.js.

Downloads

142

Readme

cypress-playwright-data-gen

A lightweight fake data generator for Cypress and Playwright tests — create realistic test data like users, cards, institutions, and more in seconds!

NPM

Installation steps:

Install using npm or yarn:

npm install cypress-playwright-data-gen
yarn add cypress-playwright-data-gen

Usage In Cypress

  • Importing - Add the commands in your cypress/support/e2e.js (or commands.js):
import 'cypress-playwright-data-gen/cypress/commands';

Then you can use the custom commands anywhere in your tests:

Just an example — OrangeHRM doesn’t have public signup, so let’s imagine we were testing a form or registration flow:

//Generate user data (Firstname, Lastname, Email, etc)
it('uses generated user data for a signup-style test', () => {
  cy.generateUser().then((user) => {
    cy.visit('https://example.com/register');
    cy.get('#firstName').type(user.firstName);
    cy.get('#lastName').type(user.lastName);
    cy.get('#email').type(user.email);
    cy.get('#password').type(user.password);
    cy.get('#submit').click();
    cy.log(`Generated user: ${user.firstName} ${user.lastName}, email: ${user.email}`);
  });
});

//Generate card data (Card number, Cvv, Expiry date)
it('generates card data for payment-related tests', () => {
  cy.generateCard().then((card) => {
    cy.log(`Card Number: ${card.number}`);
    cy.log(`Expiry: ${card.expiryMonth}/${card.expiryYear}`);
    cy.log(`CVV: ${card.cvv}`);
  });
});

Usage In Playwright

  • Importing - Import the generators directly and use them in your Playwright tests:
import { generateUser, generateCard, generateAddress, generateTransaction, generateInstitution } 
  from 'cypress-playwright-data-gen/playwright/utils';

Then you can use them anywhere in your Playwright tests:

Just an example — OrangeHRM doesn’t have public signup, so let’s imagine we were testing a form or registration flow:

import { test, expect } from '@playwright/test';
import { generateUser, generateCard } from 'cypress-playwright-data-gen/playwright/utils';

//Generate user data (Firstname, Lastname, Email, etc)
test('uses generated user data for a signup-style test', async ({ page }) => {
  const user = generateUser();
  await page.goto('https://example.com/register');
  await page.fill('#firstName', user.firstName);
  await page.fill('#lastName', user.lastName);
  await page.fill('#email', user.email);
  await page.fill('#password', user.password);
  await page.click('#submit');
  console.log(`Generated user: ${user.firstName} ${user.lastName}, email: ${user.email}`);
});


//Generate card data (Card number, Cvv, Expiry date)
test('generates card data for payment-related tests', async () => {
  const card = generateCard();
  console.log(`Card Number: ${card.number}`);
  console.log(`Expiry: ${card.expiryMonth}/${card.expiryYear}`);
  console.log(`CVV: ${card.cvv}`);
});

🧩 Available Generators

| Generator | Attributes | |------------|-------------| | 👤 generateUser() | fullName, firstName, lastName, username, password, userId, avatar, email, phone, address | | 💳 generateCard() | cardNumber, cvv, expiry | | 🏠 generateAddress() | street, city, state, postalCode, country | | 🏦 generateInstitution() | institutionId, name, type, country, branchCode, contactEmail, phone | | 💰 generateTransaction() | amount, currency, type, date, merchant, transactionId, status |