Freedom251 › JavaScript Testing Frameworks
Cucumber.js

What Cucumber.js is
Cucumber.js is the JavaScript implementation of Cucumber, an open-source tool for checking software against executable specifications. It reads scenarios written in Gherkin, a structured plain-text format usually saved in `.feature` files, and reports whether each scenario succeeds or fails. Step definitions connect each Gherkin step to code that performs the described action. They can use Cucumber Expressions or regular expressions, but not mix the two syntaxes in one expression.
The project supports Behaviour-Driven Development, which emphasizes discovery, collaboration, and examples. Install `@cucumber/cucumber` as a development dependency with npm or Yarn; the setup requires Node.js. The command-line executable runs feature files, including in continuous integration, and parallel execution is supported. Reporter plugins can produce scenario reports. Publishing with `--publish` is available from version 7.3.0; published reports are public and deleted after 24 hours. Cucumber.js works with browser automation tools such as Selenium WebDriver, but is not itself one. It is free and available for Linux, macOS, Windows, and self-hosted environments.
Who it suits
Cucumber.js suits JavaScript teams using Node.js who want to define software behavior in Gherkin and check scenarios from the command line or continuous integration. It may also fit teams using browser automation tools that need executable specifications alongside them.
What it does well
- Free and open source.
- Runs feature files from the command line.
- Supports continuous integration and parallel execution.
- Report plugins show scenario outcomes.
- Works with browser automation tools such as Selenium WebDriver.
What to know first
- Requires Node.js and npm or Yarn.
- Global installation does not work with support files.
- Published reports are publicly accessible.
- Cucumber.js is not a browser automation tool.
Plans
| Plan | Billed and limits | Price |
|---|---|---|
| Cucumber.js (@cucumber/cucumber) | Available as an npm module · install as a development dependency | Free |
| Cucumber.js | Available as an npm module · installed as a development dependency | Free |
As cucumber.io lists them, read 4 Oct 2026. The maker's own page has the final word.
Getting started
- Install Node.js and choose npm or Yarn.
- Add `@cucumber/cucumber` as a development dependency using npm or Yarn.
- Write scenarios in Gherkin and save them in `.feature` files.
- Connect scenario steps to code with step definitions.
- Run feature files with the Cucumber.js command-line executable.
Cucumber.js turns Gherkin scenarios into executable checks for Node.js projects. It is best suited to JavaScript teams using Behaviour-Driven Development to make examples part of collaboration and testing. Its open-source model is a clear advantage, but teams must connect scenarios to code themselves and install the package locally.
Overview
Cucumber evaluates plain-text specifications and reports success or failure for each scenario. The scenarios use Gherkin and are typically kept in .feature files alongside the software in source control, giving teams a shared format for examples of expected behavior. They become useful checks only when step definitions connect each step to code that performs the described actions, so teams should be ready to maintain both the scenarios and their implementation.
Cucumber.js is the stable, canonical JavaScript implementation, distributed as the @cucumber/cucumber npm module for Node.js. The project describes @cucumber/node as pre-1.0.0 and subject to change; teams choosing Cucumber for JavaScript should use the canonical package. The project says thousands of companies rely on Cucumber tests to validate software, though that does not remove the effort of fitting scenarios to an application.
Key features
Scenarios and step definitions
Step definitions can use Cucumber Expressions or regular expressions, but the syntaxes cannot be mixed within one expression. This offers a choice in how teams match scenario steps to code, while requiring consistency within each expression. Cucumber.js includes a command-line executable for running feature files and supports parallel execution.
Reports and CI
Reporter plugins can produce results showing which scenarios passed or failed. Options include built-in, separately installed and custom plugins, allowing teams to select or build a reporting approach suited to their workflow. Cucumber can run in continuous integration, and Cucumber Reports can include links to detected Git commits and CI runs.
Report publishing is supported by Cucumber-JS version 7.0.0 and above; the --publish option is supported from version 7.3.0. Published reports are publicly accessible and deleted after 24 hours, so this option is unsuitable for results that must remain private. Cucumber Reports says report data is stored in US data centers and encrypted at rest.
Browser automation and security
Cucumber is not a browser automation tool, but it can work with tools such as Selenium WebDriver. Teams seeking browser checks need to pair it with an automation tool rather than expect Cucumber.js to drive a browser by itself.
The project has a security policy for contacting maintainers about security issues and advises against defining environment variables containing secrets globally. Users can take questions to Discord, GitHub Discussions or Stack Overflow. Cucumber says its intellectual property assets transitioned from SmartBear Software to the Open Source Collective in December 2024.
Pricing
Cucumber.js is free and open source, with two free plan entries priced at $0. Both describe availability as an npm module installed as a development dependency. There is no free trial to distinguish from the free offering, and no paid tier is described; the cost advantage comes with the setup and maintenance work of writing step definitions and project-level installation.
Platforms
Cucumber.js supports Node.js and is available for Linux, macOS, Windows and self-hosted environments. The JavaScript setup requires Node.js and either npm or Yarn. Install @cucumber/cucumber as a development dependency; a global install will not work because globally installed modules cannot be imported or required in support files.
Who it's for
Cucumber.js is a strong fit for Node.js teams that want executable Gherkin examples to support a Behaviour-Driven Development process built around discovery, collaboration and examples. It is less suitable for teams looking for a ready-made browser automation tool or unwilling to implement and maintain step definitions. Teams should also avoid global installation and treat published reports as public.
Pros and cons
- Pros: Free, open-source tooling turns Gherkin scenarios into per-scenario pass-or-fail checks, with source-controlled feature files that can sit beside the software.
- Pros: Command-line execution, parallel runs, reporter plugins and CI support give teams several ways to fit checks into development workflows.
- Cons: Step definitions must connect each scenario to working code, creating ongoing implementation and maintenance work.
- Cons: Global installation is unsupported, and browser automation requires a separate tool such as Selenium WebDriver.
- Cons: Published reports are public, even though they are deleted after 24 hours; sensitive results should not be published this way.
Alternatives
For a broader comparison, see JavaScript Testing Frameworks and Test Automation Software. Consider these alternatives when their stated scope or platform coverage better matches your project:
- Karma is free and covers more platforms, but its software is deprecated, with no new features or general bug fixes.
- QUnit is a free, open-source JavaScript testing framework distributed through CDN, npm and Yarn.
- Web Test Runner is an alternative for teams focused on modern web development and browser work.
- Pure Test is a free, Apache-2.0 open-source option for supported web and self-hosted platforms.
- Vitest is a free, open-source option for its listed Linux, macOS, web and Windows platforms.
- Testem is a free, MIT-licensed JavaScript test runner for Linux, macOS and Windows.
- Mocha is a free, open-source JavaScript test framework installed as a development dependency.
- Rstest is a free, MIT-licensed JavaScript and TypeScript testing framework for its listed extension and web platforms.
Verdict
Choose Cucumber.js if your Node.js team wants Gherkin examples to serve as executable, collaborative checks and is prepared to maintain the step definitions behind them. Its main draw is a free, established approach to scenario-based testing with CI and reporting support. Look elsewhere if you need browser automation built in, or if your workflow depends on globally installed packages or private published reports.
Verdict
Cucumber.js gives Node.js teams a way to connect plain-text Gherkin scenarios to code and check the results. Note that reports published with `--publish` are public and deleted after 24 hours.
Questions
Is Cucumber.js free?
Yes. Cucumber.js is free and open source, and the listed plans cost nothing.
What does Cucumber.js run on?
It runs on Node.js and is available as the `@cucumber/cucumber` npm module.
How do I install it?
The setup requires Node.js and npm or Yarn. Install `@cucumber/cucumber` as a development dependency.
Is Cucumber.js a browser automation tool?
No. It works with browser automation tools such as Selenium WebDriver, but is not itself a browser automation tool.
Can it publish reports?
Yes. Publishing through `--publish` is supported from version 7.3.0. Published reports are public and deleted after 24 hours.
Where can users ask questions?
The Cucumber community directs users to Discord, GitHub Discussions and Stack Overflow.
Facts from Cucumber.js's own pages
- Audience
- The project says thousands of companies rely on Cucumber tests to validate their software. · cucumber.io, 4 Oct 2026
- BDD
- Cucumber supports Behaviour-Driven Development, a process built around discovery, collaboration and examples. · cucumber.io, 4 Oct 2026
- CI integration
- Cucumber can be run in continuous integration, and Cucumber Reports can include links to detected Git commits and CI runs. · reports.cucumber.io, 4 Oct 2026
- Command line
- Cucumber.js includes an executable for running feature files from the command line. · cucumber.io, 4 Oct 2026
- Expressions
- Step definitions can use Cucumber Expressions or regular expressions, but the two syntaxes cannot be mixed in one expression. · cucumber.io, 4 Oct 2026
- Gherkin
- Cucumber scenarios use Gherkin syntax, and feature files are typically stored in source control alongside the software. · cucumber.io, 4 Oct 2026
- Global install limitation
- Cucumber does not work when installed globally because globally installed modules cannot be imported or required in support files. · cucumber.io, 4 Oct 2026
- Installation
- The documentation shows installing `@cucumber/cucumber` as a development dependency with npm or Yarn. · cucumber.io, 4 Oct 2026
- Integrations
- Cucumber says it is not a browser automation tool, but works with browser automation tools such as Selenium WebDriver. · cucumber.io, 4 Oct 2026
- JavaScript install
- Cucumber.js is available as the @cucumber/cucumber npm module and can also be installed with Yarn as a development dependency. · cucumber.io, 4 Oct 2026
- Language
- Cucumber.js is the JavaScript implementation of Cucumber and is available as an npm module for Node.js. · cucumber.io, 4 Oct 2026
- Maintainer status
- The project describes @cucumber/cucumber as the stable canonical JavaScript implementation, while @cucumber/node is pre-1.0.0 and may change. · cucumber.io, 4 Oct 2026
- Prerequisites
- The JavaScript setup instructions require Node.js and either npm or Yarn. · cucumber.io, 4 Oct 2026
- Project ownership
- Cucumber says its intellectual property assets transitioned from SmartBear Software to the Open Source Collective in December 2024. · cucumber.io, 4 Oct 2026
- Purpose
- Cucumber reads executable specifications written in plain text and checks whether software conforms to them, reporting success or failure for each scenario. · cucumber.io, 4 Oct 2026
- Report data
- The Cucumber Reports service states that published report data is stored in US data centers and encrypted at rest. · reports.cucumber.io, 4 Oct 2026
- Reporting
- Cucumber uses reporter plugins to produce reports showing which scenarios passed or failed, including built-in, separately installed, and custom plugins. · cucumber.io, 4 Oct 2026
- Report privacy
- Published reports are publicly accessible and deleted after 24 hours. · reports.cucumber.io, 4 Oct 2026
- Report publishing
- Publishing to Cucumber Reports is supported by Cucumber-JS version 7.0.0 and above. · cucumber.io, 4 Oct 2026
- Reports
- Cucumber.js supports publishing reports with the --publish option from version 7.3.0. · reports.cucumber.io, 4 Oct 2026
- Security
- The project says it has a security policy that explains how to contact maintainers about security issues. · cucumber.io, 4 Oct 2026
- Security guidance
- Cucumber advises users not to define environment variables containing secrets globally. · cucumber.io, 4 Oct 2026
- Specifications
- Cucumber scenarios are written in Gherkin, a structured plain text format stored in `.feature` files. · cucumber.io, 4 Oct 2026
- Step definitions
- Step definitions connect Gherkin steps to programming code that performs the described actions. · cucumber.io, 4 Oct 2026
Where Cucumber.js stands on Freedom251
- JavaScript Testing Frameworks#1 of 23
- Test Automation Software#7 of 45
