Skip to content

badeball/cypress-cucumber-preprocessor

This branch is 507 commits ahead of, 2 commits behind Klaveness-Digital/cypress-cucumber-preprocessor:master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

1580175 · Mar 30, 2025
Mar 26, 2025
Mar 27, 2025
Jan 17, 2025
Mar 26, 2025
Mar 26, 2025
Sep 28, 2024
Aug 5, 2024
Mar 27, 2025
Oct 28, 2020
Dec 10, 2023
May 13, 2023
Apr 29, 2021
Mar 26, 2025
Mar 26, 2025
Oct 28, 2020
Mar 26, 2025
Sep 28, 2024
Aug 28, 2023
Oct 3, 2024
Aug 5, 2024
Feb 21, 2025
Sep 30, 2024
May 10, 2023
Aug 28, 2023

Repository files navigation

cypress-cucumber-preprocessor

Build status Npm package weekly downloads

This preprocessor aims to provide a developer experience and behavior similar to that of Cucumber, to Cypress.

ℹ️ The repository has recently moved from github.com/TheBrainFamily to github.com/badeball. Read more about the transfer of ownership here.

Installation

$ npm install @badeball/cypress-cucumber-preprocessor

Introduction

The preprocessor (with its dependencies) parses Gherkin documents and allows you to write tests as shown below.

# cypress/e2e/duckduckgo.feature
Feature: duckduckgo.com
  Scenario: visiting the frontpage
    When I visit duckduckgo.com
    Then I should see a search bar
// cypress/e2e/duckduckgo.ts
import { When, Then } from "@badeball/cypress-cucumber-preprocessor";

When("I visit duckduckgo.com", () => {
  cy.visit("https://www.duckduckgo.com");
});

Then("I should see a search bar", () => {
  cy.get("input").should(
    "have.attr",
    "placeholder",
    "Search the web without being tracked"
  );
});

Building

Building can be done once using:

$ npm run build

Or upon file changes with:

$ npm run watch

There are multiple types of tests, all ran using npm scripts:

$ npm run test:fmt
$ npm run test:types
$ npm run test:unit
$ npm run test:integration # make sure to build first
$ npm run test # runs all of the above

Attribution

A special thanks goes out to Łukasz Gandecki for developing and maintaining the cypress-cucumber integration before me, in addition to all other contributors. Some of the work has partially been sponsored by Klaveness Digital.

About

Run cucumber/gherkin-syntaxed specs with Cypress

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 55.8%
  • Gherkin 43.5%
  • JavaScript 0.7%