Cook your Gherkin in Cypress Cucumber!

Let’s get started!

  1. Installation
npm install --save-dev cypress-cucumber-preprocessor
const cucumber = require('cypress-cucumber-preprocessor').defaultmodule.exports = (on, config) => {
on('file:preprocessor', cucumber())
}
{
"testFiles": "**/*.feature"
}
Feature: SignIn

I want to access the system while login

@focus
Scenario: User can sign in with valid creds
Given @nav I'm on the client page
When @signIn I enter valid username as "admin"
When @signIn I enter valid password
Then @signIn I click to Submit
Then @signin.assertions I can see the Dashboard
import { Given } from "cypress-cucumber-preprocessor/steps";
const url = 'https://testpractices.com'
Given('@nav I'm on the client page', () => {
cy.visit(url)
})
When('@signIn I enter valid username as {string}', (username) => {
cy.get.('@userNameInput').type(username);
})

Run

Launch your Cypress GUI Runner in your favourite way!

cypress open
npx cypress open

Best IDE support for Gherkin

To get the best support with intellisence in your IDE, with Visual Studio Code you can get Cucumber (Gherkin) Full Support extension imported from the marketplace.

Wanna hear more?

Cypress with Cucumber processing is not just what I mentioned above! I have only scratched the surface to give you the appetizer.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Rashmi Sandarekha

Rashmi Sandarekha

17 Followers

Software Quality Assurance Lead fascinated in Test Automation. Storyteller and a technical writer.