Cook your Gherkin in Cypress Cucumber!

Let’s get started!

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

cypress open
npx cypress open

Best IDE support for Gherkin

Wanna hear more?

--

--

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