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

cypress open
npx cypress open

Best IDE support for Gherkin

Wanna hear more?

--

--

--

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

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Is There an API To Get Precious Metals Rates In Pound Sterling With JSON Format?

How to Implement Unit Testing in Node.js

Making GIFs in JavaScript

Functors Dissected

useRef and useState, which one should you use and why?

Materialize: To 1.0 and Beyond

Chrome Extension for Data Scraping

Deno 1.0 Overcome Node JS

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

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

More from Medium

Cypress get(), find() and within() methods

Ways to skip test cases in Cypress.io

The small thing I hope I knew before writing frontend tests

Kick Start Your Career With Cypress