Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cypress-cucumber-preprocessor

Package Overview
Dependencies
Maintainers
1
Versions
77
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cypress-cucumber-preprocessor

Run gherkin-syntaxed specs with cypress.io

  • 4.3.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
213K
decreased by-6.04%
Maintainers
1
Weekly downloads
 
Created

What is cypress-cucumber-preprocessor?

The cypress-cucumber-preprocessor npm package allows you to use Cucumber with Cypress for behavior-driven development (BDD). It enables you to write your test scenarios in Gherkin syntax and execute them using Cypress.

What are cypress-cucumber-preprocessor's main functionalities?

Gherkin Syntax Support

This feature allows you to write test scenarios in Gherkin syntax, which is a human-readable format. The above code demonstrates a simple login feature with a scenario for successful login.

Feature: Login functionality

  Scenario: Successful login
    Given I am on the login page
    When I enter valid credentials
    Then I should see the dashboard

Step Definitions

Step definitions map the Gherkin steps to actual Cypress commands. The code sample shows how to define steps for visiting the login page, entering credentials, and verifying the dashboard URL.

const { Given, When, Then } = require('cypress-cucumber-preprocessor/steps');

Given('I am on the login page', () => {
  cy.visit('/login');
});

When('I enter valid credentials', () => {
  cy.get('input[name=username]').type('user');
  cy.get('input[name=password]').type('password');
  cy.get('button[type=submit]').click();
});

Then('I should see the dashboard', () => {
  cy.url().should('include', '/dashboard');
});

Tagging Scenarios

You can tag scenarios to categorize and filter them during test execution. The code sample shows a scenario tagged with @smoke, which can be used to run only smoke tests.

Feature: Login functionality

  @smoke
  Scenario: Successful login
    Given I am on the login page
    When I enter valid credentials
    Then I should see the dashboard

Other packages similar to cypress-cucumber-preprocessor

Keywords

FAQs

Package last updated on 04 Oct 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc