Description
Cucumber.js is the JavaScript implementation of Cucumber and runs on both Node.js and modern web browsers.
Cucumber.js alternatives and similar modules
Based on the "Testing" category.
Alternatively, view Cucumber.js alternatives based on common mentions on social networks and blogs.
-
Playwright
Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API. -
Mocha
โ๏ธ simple, flexible, fun javascript test framework for node.js & the browser -
jasmine
Simple JavaScript testing framework for browsers and node.js -
Nightwatch
End-to-end testing framework written in Node.js and using the W3C Webdriver API -
volkswagen
:see_no_evil: Volkswagen detects when your tests are being run in a CI server, and makes them pass. -
WebdriverIO
Next-gen browser and mobile automation test framework for Node.js -
CasperJS
Navigation scripting and testing utility for PhantomJS and SlimerJS -
istanbul
Yet another JS code coverage tool that computes statement, line, function and branch coverage with module loader hooks to transparently add coverage when running tests. Supports all JS coverage use cases including unit tests, server side functional tests and browser tests. Built for scale. -
fast-check
Property based testing framework for JavaScript (like QuickCheck) written in TypeScript -
toxy
Hackable HTTP proxy for resiliency testing and simulated network conditions -
loadtest
Runs a load test on the selected URL. Easy to extend minimally for your own ends. -
uvu
uvu is an extremely fast and lightweight test runner for Node.js and the browser -
power-assert
Power Assert in JavaScript. Provides descriptive assertion messages through standard assert interface. No API is the best API. -
testdouble.js (AKA td.js)
A minimal test double library for TDD with JavaScript -
testcontainers-node
Testcontainers is a NodeJS library that supports tests, providing lightweight, throwaway instances of common databases, Selenium web browsers, or anything else that can run in a Docker container. -
abstruse
Abstruse is a free and open-source CI/CD platform that tests your models and code. -
Crusher
๐งโโ๏ธ Fast low-code testing framework โฑ๏ธ Create test in <60 secs -
Mochify
โ๏ธ TDD with Browserify, Mocha, Headless Chrome and WebDriver -
testen
:heavy_check_mark: Run tests for multiple versions of Node.js in local env.
Appwrite - The Open Source Firebase alternative introduces iOS support
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of Cucumber.js or a related project?
README
Cucumber Automated tests in plain language, for Node.js
Cucumber is a tool for running automated tests written in plain language. Because they're written in plain language, they can be read by anyone on your team. Because they can be read by anyone, you can use them to help improve communication, collaboration and trust on your team.
This is the JavaScript implementation of Cucumber. It runs on maintained versions of Node.js. You can quickly try it via CodeSandbox, or read on to get started locally in a couple of minutes.
Looking to contribute? Read our code of conduct first, then check the [contributing guide](./CONTRIBUTING.md) to get up and running.
Install
Cucumber is available on npm:
$ npm install @cucumber/cucumber
Get Started
Let's take this example of something to test:
class Greeter {
sayHello() {
return 'hello'
}
}
First, write your feature in features/greeting.feature
:
Feature: Greeting
Scenario: Say hello
When the greeter says hello
Then I should have heard "hello"
Next, implement your steps in features/support/steps.js
:
const assert = require('assert')
const { When, Then } = require('@cucumber/cucumber')
const { Greeter } = require('../../src')
When('the greeter says hello', function () {
this.whatIHeard = new Greeter().sayHello()
});
Then('I should have heard {string}', function (expectedResponse) {
assert.equal(this.whatIHeard, expectedResponse)
});
Finally, run Cucumber:
$ npx cucumber-js
And see the output:
[Terminal output showing a successful test run with 1 scenario and 2 steps, all passing](./docs/images/readme-output.png)
If you learn best by example, we have a repo with several example projects, that might help you get going.
Documentation
The following documentation is for main
, which might contain some unreleased features. See [documentation for older versions](./docs/older_versions.md) if you need it.
- [Installation](./docs/installation.md)
- [CLI](./docs/cli.md)
- [Configuration](./docs/configuration.md)
- Support Code
- [API Reference](./docs/support_files/api_reference.md)
- [Attachments](./docs/support_files/attachments.md)
- [Data Tables](./docs/support_files/data_table_interface.md)
- [Hooks](./docs/support_files/hooks.md)
- [Step Definitions](./docs/support_files/step_definitions.md)
- [Timeouts](./docs/support_files/timeouts.md)
- [World](./docs/support_files/world.md)
- Guides
- [Debugging](./docs/debugging.md)
- [Dry run](./docs/dry_run.md)
- [ES Modules](./docs/esm.md)
- [Failing fast](./docs/fail_fast.md)
- [Filtering which scenarios run](./docs/filtering.md)
- [Formatters for feedback and reporting](./docs/formatters.md)
- [Parallel running for speed](./docs/parallel.md)
- [Profiles for composable configuration](./docs/profiles.md)
- [Rerunning just failures](./docs/rerun.md)
- [Retrying flaky scenarios](./docs/retry.md)
- [Snippets for undefined steps](./docs/snippets.md)
- [Transpiling (from TypeScript etc)](./docs/transpiling.md)
- [FAQ](./docs/faq.md)
Support
Support is available from the community if you need it.