Gherkin — Checkout Feature (Background, Outline, Doc String)
The source feature for this whole group: a Background with a data table, a plain scenario, a Scenario Outline expanded by two Examples tables, and a scenario asserting against a doc string. It compiles to exactly six pickles and 32 pickle steps — the numbers the cucumber-messages and cucumber.json twins next to it report.
# language: en
@checkout @smoke
Feature: Checkout totals
As a shopper
I want the cart total to include tax and discounts
So that I am never surprised at the payment step
Background:
Given the catalogue contains:
| sku | name | price |
| NX-1042 | Sample desk lamp | 12.99 |
| NX-2087 | Sample notebook | 4.50 |
And the tax rate is 20 percent
@pricing
Scenario: A single-item cart shows tax separately
Given my cart is empty
When I add 1 of "NX-1042"
Then the subtotal is "12.99"
And the tax is "2.60"
And the total is "15.59"
@pricing @outline
Scenario Outline: Quantity multiplies the subtotal
Given my cart is empty
When I add <quantity> of "<sku>"
Then the subtotal is "<subtotal>"
Examples: whole units
| sku | quantity | subtotal |
| NX-1042 | 1 | 12.99 |
| NX-1042 | 3 | 38.97 |
| NX-2087 | 2 | 9.00 |
@edge
Examples: boundary quantities
| sku | quantity | subtotal |
| NX-1042 | 0 | 0.00 |
@receipt
Scenario: The receipt renders as plain text
Given my cart contains 1 of "NX-1042"
When I request the receipt
Then the receipt reads:
"""
Novus Checkout SAMPLE receipt
1 x Sample desk lamp 12.99
Tax (20 percent) 2.60
Total 15.59
"""Specifications
- Seed
- 61200
- Encoding
- UTF-8
- Line Endings
- LF
- Gherkin Dialect
- en
- Scenarios
- 2
- Scenario Outlines
- 1
- Examples Tables
- 2
- Example Rows
- 4
- Pickles
- 6
- Background Steps
- 2
- Data Tables
- 1
- Doc Strings
- 1
- Feature Tags
- 2
- Total Pickle Steps
- 32
Testing contract
Expected to pass- Scenario
- Compile a Gherkin feature into pickles and count the steps a runner will execute.
- Expected result
- 6 pickles and 32 pickle steps are produced, matching the pickle envelopes in the cucumber-messages twin exactly.
What is a .feature file?
A .feature file holds a Gherkin specification: a business-readable, plain-text description of behaviour written as Feature, Background, Scenario, and Scenario Outline blocks whose steps begin with Given, When, Then, And, or But. Scenario Outlines are parameterised by an Examples table, and tags such as @smoke mark subsets of the suite. Cucumber, Behave, SpecFlow, and Behat all read the same grammar, with localised keyword sets available for non-English specifications.
How to use this file
Use an example .feature file to test Gherkin parsers, step-definition matchers, linters, and editor tooling — verifying tag inheritance, Scenario Outline expansion against the Examples table, docstring and data-table arguments, and behaviour on deliberately malformed keywords.
How to use this file for testing
“Gherkin — Checkout Feature (Background, Outline, Doc String)” is a deterministic Novus Examples fixture for Code parsing, Conversion testing, Editor testing. Short, known-correct source files in many languages with classes, functions, generics, enums, and error handling — for testing parsers, linters, formatters, language detection, and diff viewers.
Documented properties for this file: seed 61200 · UTF-8 · LF. Compare results against paired or grouped companions on this page when present (clean↔damaged, searchable↔scanned, or format twins) so scores stay reproducible across runs.
Download the file once, keep the path stable in CI or local scripts, and treat the spec table as the contract: dimensions, seeds, field lists, and roles are intentional. Corrupt or invalid samples are labelled as such — expect parsers to fail loudly rather than silently accept them.
Test and coverage reports document their totals (suites, cases, passes, failures, skips, covered lines) in the spec table. Point your CI dashboard, coverage gate, or report converter at the file and assert those counts survive; format twins carry identical numbers so a conversion can be scored exactly.
Related files
- featureGherkin — Background, Feature Tags and HooksA named Background whose two steps are prepended to all three scenarios, plus feature-level tags that every scenario inherits and scenario-level tags that only some carry. Tag filtering is where this file earns its keep: @slow selects one scenario by its own tag and all three by inheritance from the feature.

- featureGherkin — Data Table and Doc String ArgumentsA step argument table with a header row, followed by two doc strings — one plain and one carrying a json content type after the opening delimiter. Doc string indentation is relative to the delimiter, so the receipt body must keep its internal column alignment while losing the six leading spaces.

- featureGherkin — Rule Keyword (Gherkin 6)Two Rule blocks, the first with its own Background that applies only to the examples inside it. Parsers written before Gherkin 6 either reject Rule outright or, worse, hoist the Background to the whole feature and add a step to the third example that was never there.

- featureGherkin — Scenario Outline with Two Examples TablesOne outline expanded by two separate Examples tables, the second of which carries its own @edge tag. Expansion must produce five scenarios, and only the two from the tagged table may match a run filtered on @edge — a distinction parsers that flatten the tables lose.

- featureGherkin — Step Argument and Expression TypesSteps exercising every argument shape a step-definition matcher has to handle: quoted strings with escaped inner quotes, integers, decimals, a comma-and-and list, the But keyword, and angle brackets in a plain Scenario where they are literal text rather than outline placeholders.

- robotRobot Framework — Checkout SuiteA complete Robot Framework suite with all four common sections, scalar, list and dictionary variables, a continued line using ..., and user keywords with arguments. Robot separates arguments on two or more spaces, so a parser splitting on a single space merges every keyword call into one token.

Generated by generation/testing.py. Free for any use, no attribution required — license.