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

nilgiricucumber

v0.0.7

Published

This is Nilgiri framework which Help user to generate Bdd code with Playwright Script

Readme

nilgiricucumber: A Core Component of the Nilgiri Framework

The nilgiricucumber module integrates Cucumber and Playwright to simplify and enhance automated BDD testing. It generates feature files, step definitions, and test scripts, making it easier to write structured, reusable test cases.


Prerequisites

  1. Ensure you have Node.js and TypeScript installed on your machine.

    • Download Node.js from here.
    • To install TypeScript globally, run:
      npm install -g typescript
  2. IDE: Use an IDE that supports TypeScript and Node.js, such as VSCode or WebStorm.

  3. AI API Key and Endpoint : Have your AI API key and endpoint ready for AI-based code generation .


Setup: Install and Run

Step 1: Install Nilgiri Cucumber

npm install nilgiricucumber@latest --save-dev

Step 2: Generate BDD Test Files

To run the generateTestFiles method, import and call it in your script:

Example: Create new test.ts file and copy paste the below example code ,

replace your apiUrl, apiKey , xlsxFilePath and websiteURL with correct values .

Example usage:

import { generateTestFiles } from 'nilgiricucumber';

const config = {
  apiUrl: 'https://api.openai.com/v1/completions',
  apiKey: 'sk-xxxxxx12345',
  xlsxFilePath: 'path/to/excel.xlsx',
  websiteURL: 'https://example.com'
};

generateTestFiles(config)
  .then(() => console.log('BDD test files generated successfully!'))
  .catch(err => console.error('Error:', err));

Parameters

| Parameter | Type | Description | Example | |--------------------|--------|---------------------------------------------------------------|---------------------------------------------| | apiUrl | string | The endpoint URL of the AI service . | 'https://api.openai.com/v1/completions' | | apiKey | string | The API key for authentication . | 'sk-xxxxxx12345' | | xlsxFilePath | string | Path to the Excel sheet containing test scenarios. | 'path/to/excel.xlsx' | | websiteURL | string | The URL of the system under test. | 'https://example.com' |


Running the Application

If using TypeScript:

  1. Compile the TypeScript file:
    tsc <your-file-name>.ts
    node <your-file-name>.js

If using ts-node (without compiling separately):

npx ts-node <your-file-name>.ts

📂 Where to Find the AI Generated Test Scripts ?

After running generateTestFiles(config), the following files will be created:

output.feature - This contains the generated Cucumber feature file with test scenarios.

output.ts - This is the Step Definition file that maps steps from the feature file to Playwright test actions.

📌 Location of Generated Files

These files will be saved in your project root folder or the default output directory based on your system settings.

✅ How to View the Files?

Open your file explorer and navigate to the project directory.

In VSCode or any IDE, check the left-hand file explorer.

Run the following command in your terminal to confirm the files exist:

ls -l output.*

📌 Note: You can now review and modify the generated test files before executing them.

  • Automated BDD test generation with feature files and step definitions.
  • Integrates with Playwright for powerful end-to-end testing.
  • Supports AI-driven test case generation for enhanced automation.
  • Works with TypeScript and JavaScript seamlessly.

For any support, please create an issue on the Nilgiri Cucumber GitHub repository.