Skip to content

Latest commit

 

History

History
54 lines (40 loc) · 1.53 KB

quick-start.md

File metadata and controls

54 lines (40 loc) · 1.53 KB

Installation

See badeball/cypress-cucumber-preprocessor for a public, community-maintained edition and installation instructions.

Configuration

Configure specPattern with "**/*.feature", using EG. cypress.config.ts.

import { defineConfig } from "cypress";

export default defineConfig({
  e2e: {
    specPattern: "**/*.feature"
  }
});

Configure your preferred bundler to process features files, with examples for

Read more about configuration options at docs/configuration.md.

Write a test

Write Gherkin documents and add a file for type definitions with a corresponding name (read more about how step definitions are resolved in docs/step-definitions.md). Reading docs/cucumber-basics.md is highly recommended.

# cypress/e2e/duckduckgo.feature
Feature: duckduckgo.com
  Scenario: visting the frontpage
    When I visit duckduckgo.com
    Then I should see a search bar
// cypress/e2e/duckduckgo.ts
import { When, Then } from "@klaveness/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"
  );
});